Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Mehrere Datenpunkte mit einer variablen vergleichen

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Mehrere Datenpunkte mit einer variablen vergleichen

    This topic has been deleted. Only users with topic management privileges can see it.
    • mickym
      mickym Most Active @Renegade 0 last edited by mickym

      @renegade-0 sagte in Mehrere Datenpunkte mit einer variablen vergleichen:

                                                                                                                                  [                                                                                                                                                                                {                                                                                                                                                                                    "id": "1ae851a8.7c63de",                                                                                                                                                                                    "type": "tab",                                                                                                                                                                                    "label": "RFID-Check",                                                                                                                                                                                    "disabled": false,                                                                                                                                                                                    "info": ""                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "51113dd8.972204",                                                                                                                                                                                    "type": "ioBroker list",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "authorised",                                                                                                                                                                                    "topic": "0_userdata.0.door-server.door-RFID.*",                                                                                                                                                                                    "objType": "state",                                                                                                                                                                                    "regex": "",                                                                                                                                                                                    "asArray": "false",                                                                                                                                                                                    "onlyIDs": "true",                                                                                                                                                                                    "withValues": "true",                                                                                                                                                                                    "x": 550,                                                                                                                                                                                    "y": 200,                                                                                                                                                                                    "wires": [                                                                                                                                                                                        [                                                                                                                                                                                            "f064dd3d.75fe8",                                                                                                                                                                                            "689dcd8a.51a634"                                                                                                                                                                                        ]                                                                                                                                                                                    ]                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "a2577882.2efd08",                                                                                                                                                                                    "type": "ioBroker in",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "client/RFID",                                                                                                                                                                                    "topic": "mqtt.0.client.RFID",                                                                                                                                                                                    "payloadType": "value",                                                                                                                                                                                    "onlyack": "",                                                                                                                                                                                    "func": "all",                                                                                                                                                                                    "gap": "",                                                                                                                                                                                    "fireOnStart": "false",                                                                                                                                                                                    "x": 90,                                                                                                                                                                                    "y": 200,                                                                                                                                                                                    "wires": [                                                                                                                                                                                        [                                                                                                                                                                                            "9d981111.4543b"                                                                                                                                                                                        ]                                                                                                                                                                                    ]                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "9d981111.4543b",                                                                                                                                                                                    "type": "change",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "",                                                                                                                                                                                    "rules": [                                                                                                                                                                                        {                                                                                                                                                                                            "t": "move",                                                                                                                                                                                            "p": "payload",                                                                                                                                                                                            "pt": "msg",                                                                                                                                                                                            "to": "search",                                                                                                                                                                                            "tot": "msg"                                                                                                                                                                                        }                                                                                                                                                                                    ],                                                                                                                                                                                    "action": "",                                                                                                                                                                                    "property": "",                                                                                                                                                                                    "from": "",                                                                                                                                                                                    "to": "",                                                                                                                                                                                    "reg": false,                                                                                                                                                                                    "x": 300,                                                                                                                                                                                    "y": 200,                                                                                                                                                                                    "wires": [                                                                                                                                                                                        [                                                                                                                                                                                            "51113dd8.972204"                                                                                                                                                                                        ]                                                                                                                                                                                    ]                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "7d60e459.bed5bc",                                                                                                                                                                                    "type": "debug",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "",                                                                                                                                                                                    "active": true,                                                                                                                                                                                    "tosidebar": true,                                                                                                                                                                                    "console": false,                                                                                                                                                                                    "tostatus": true,                                                                                                                                                                                    "complete": "payload",                                                                                                                                                                                    "targetType": "msg",                                                                                                                                                                                    "statusVal": "payload",                                                                                                                                                                                    "statusType": "auto",                                                                                                                                                                                    "x": 1150,                                                                                                                                                                                    "y": 200,                                                                                                                                                                                    "wires": []                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "f064dd3d.75fe8",                                                                                                                                                                                    "type": "switch",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "Treffer?",                                                                                                                                                                                    "property": "payload",                                                                                                                                                                                    "propertyType": "msg",                                                                                                                                                                                    "rules": [                                                                                                                                                                                        {                                                                                                                                                                                            "t": "jsonata_exp",                                                                                                                                                                                            "v": "search = payload.val",                                                                                                                                                                                            "vt": "jsonata"                                                                                                                                                                                        }                                                                                                                                                                                    ],                                                                                                                                                                                    "checkall": "true",                                                                                                                                                                                    "repair": false,                                                                                                                                                                                    "outputs": 1,                                                                                                                                                                                    "x": 740,                                                                                                                                                                                    "y": 200,                                                                                                                                                                                    "wires": [                                                                                                                                                                                        [                                                                                                                                                                                            "8d0e7800.870138",                                                                                                                                                                                            "7e533710.fd4f68"                                                                                                                                                                                        ]                                                                                                                                                                                    ]                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "8d0e7800.870138",                                                                                                                                                                                    "type": "change",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "setze payload auf true",                                                                                                                                                                                    "rules": [                                                                                                                                                                                        {                                                                                                                                                                                            "t": "set",                                                                                                                                                                                            "p": "payload",                                                                                                                                                                                            "pt": "msg",                                                                                                                                                                                            "to": "true",                                                                                                                                                                                            "tot": "bool"                                                                                                                                                                                        }                                                                                                                                                                                    ],                                                                                                                                                                                    "action": "",                                                                                                                                                                                    "property": "",                                                                                                                                                                                    "from": "",                                                                                                                                                                                    "to": "",                                                                                                                                                                                    "reg": false,                                                                                                                                                                                    "x": 940,                                                                                                                                                                                    "y": 200,                                                                                                                                                                                    "wires": [                                                                                                                                                                                        [                                                                                                                                                                                            "7d60e459.bed5bc"                                                                                                                                                                                        ]                                                                                                                                                                                    ]                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "689dcd8a.51a634",                                                                                                                                                                                    "type": "debug",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "Test 1:",                                                                                                                                                                                    "active": true,                                                                                                                                                                                    "tosidebar": true,                                                                                                                                                                                    "console": false,                                                                                                                                                                                    "tostatus": false,                                                                                                                                                                                    "complete": "payload",                                                                                                                                                                                    "targetType": "msg",                                                                                                                                                                                    "statusVal": "",                                                                                                                                                                                    "statusType": "auto",                                                                                                                                                                                    "x": 740,                                                                                                                                                                                    "y": 340,                                                                                                                                                                                    "wires": []                                                                                                                                                                                },                                                                                                                                                                                {                                                                                                                                                                                    "id": "7e533710.fd4f68",                                                                                                                                                                                    "type": "debug",                                                                                                                                                                                    "z": "1ae851a8.7c63de",                                                                                                                                                                                    "name": "search",                                                                                                                                                                                    "active": true,                                                                                                                                                                                    "tosidebar": true,                                                                                                                                                                                    "console": false,                                                                                                                                                                                    "tostatus": false,                                                                                                                                                                                    "complete": "search",                                                                                                                                                                                    "targetType": "msg",                                                                                                                                                                                    "statusVal": "",                                                                                                                                                                                    "statusType": "auto",                                                                                                                                                                                    "x": 1030,                                                                                                                                                                                    "y": 340,                                                                                                                                                                                    "wires": []                                                                                                                                                                                }                                                                                                                                                                            ]                                            
      
      1. Fehler:

      905c55c1-0ea2-4755-8406-2d8dd6f79e90-image.png

      Dann setze mal den letzten Node - weg - der Dir true setzt - Du kannst dann den Namen direkt aus dem Objekt lesen.

      Exportiere mal die Datenpunkte unter der RFID - damit ichs selbst im Flow machen kann.

      R 1 Reply Last reply Reply Quote 0
      • R
        Renegade 0 @mickym last edited by

        @mickym
        Das mit dem ERgebnis klappt noch ned.

        [
            {
                "id": "1ae851a8.7c63de",
                "type": "tab",
                "label": "RFID-Check",
                "disabled": false,
                "info": ""
            },
            {
                "id": "51113dd8.972204",
                "type": "ioBroker list",
                "z": "1ae851a8.7c63de",
                "name": "authorised",
                "topic": "0_userdata.0.door-server.door-RFID.*",
                "objType": "state",
                "regex": "",
                "asArray": "false",
                "onlyIDs": "false",
                "withValues": "true",
                "x": 550,
                "y": 200,
                "wires": [
                    [
                        "f064dd3d.75fe8",
                        "7e533710.fd4f68"
                    ]
                ]
            },
            {
                "id": "a2577882.2efd08",
                "type": "ioBroker in",
                "z": "1ae851a8.7c63de",
                "name": "client/RFID",
                "topic": "mqtt.0.client.RFID",
                "payloadType": "value",
                "onlyack": "",
                "func": "all",
                "gap": "",
                "fireOnStart": "false",
                "x": 90,
                "y": 200,
                "wires": [
                    [
                        "9d981111.4543b"
                    ]
                ]
            },
            {
                "id": "9d981111.4543b",
                "type": "change",
                "z": "1ae851a8.7c63de",
                "name": "",
                "rules": [
                    {
                        "t": "move",
                        "p": "payload",
                        "pt": "msg",
                        "to": "search",
                        "tot": "msg"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 300,
                "y": 200,
                "wires": [
                    [
                        "51113dd8.972204"
                    ]
                ]
            },
            {
                "id": "7d60e459.bed5bc",
                "type": "debug",
                "z": "1ae851a8.7c63de",
                "name": "",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": true,
                "complete": "payload",
                "targetType": "msg",
                "statusVal": "payload",
                "statusType": "auto",
                "x": 1150,
                "y": 200,
                "wires": []
            },
            {
                "id": "f064dd3d.75fe8",
                "type": "switch",
                "z": "1ae851a8.7c63de",
                "name": "Treffer?",
                "property": "payload",
                "propertyType": "msg",
                "rules": [
                    {
                        "t": "jsonata_exp",
                        "v": "search = payload.val",
                        "vt": "jsonata"
                    }
                ],
                "checkall": "true",
                "repair": false,
                "outputs": 1,
                "x": 740,
                "y": 200,
                "wires": [
                    [
                        "7d60e459.bed5bc"
                    ]
                ]
            },
            {
                "id": "8d0e7800.870138",
                "type": "change",
                "z": "1ae851a8.7c63de",
                "name": "setze payload auf true",
                "rules": [
                    {
                        "t": "set",
                        "p": "payload",
                        "pt": "msg",
                        "to": "true",
                        "tot": "bool"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 700,
                "y": 500,
                "wires": [
                    []
                ]
            },
            {
                "id": "7e533710.fd4f68",
                "type": "debug",
                "z": "1ae851a8.7c63de",
                "name": "search",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "payload.val",
                "targetType": "jsonata",
                "statusVal": "",
                "statusType": "auto",
                "x": 1030,
                "y": 340,
                "wires": []
            }
        ]
        

        Datenpunkte

        {
          "0_userdata.0.door-server.door-RFID": {
            "_id": "0_userdata.0.door-server.door-RFID",
            "type": "channel",
            "common": {
              "name": "door-RFID",
              "role": "",
              "desc": "Zutrittsberechtigungen",
              "icon": ""
            },
            "native": {},
            "from": "system.adapter.admin.0",
            "user": "system.user.admin",
            "ts": 1623537286142,
            "acl": {
              "object": 1636,
              "owner": "system.user.admin",
              "ownerGroup": "system.group.administrator"
            }
          },
          "0_userdata.0.door-server.door-RFID.Hans_Dampf": {
            "_id": "0_userdata.0.door-server.door-RFID.Hans_Dampf",
            "type": "state",
            "common": {
              "name": "Hans Dampf",
              "role": "",
              "type": "number",
              "desc": "Manuell erzeugt",
              "read": true,
              "write": true,
              "def": false
            },
            "native": {},
            "from": "system.adapter.admin.0",
            "user": "system.user.admin",
            "ts": 1623537330521,
            "acl": {
              "object": 1636,
              "owner": "system.user.admin",
              "ownerGroup": "system.group.administrator",
              "state": 1636
            }
          },
          "0_userdata.0.door-server.door-RFID.Sabine_Schussel": {
            "_id": "0_userdata.0.door-server.door-RFID.Sabine_Schussel",
            "type": "state",
            "common": {
              "name": "Sabine Schussel",
              "role": "",
              "type": "string",
              "desc": "Manuell erzeugt",
              "read": true,
              "write": true,
              "def": false
            },
            "native": {},
            "from": "system.adapter.admin.0",
            "user": "system.user.admin",
            "ts": 1623537366599,
            "acl": {
              "object": 1636,
              "owner": "system.user.admin",
              "ownerGroup": "system.group.administrator",
              "state": 1636
            }
          }
        }
        
        mickym 1 Reply Last reply Reply Quote 0
        • mickym
          mickym Most Active @Renegade 0 last edited by

          So das Problem ist wieder mal die Typ Konvertierung. Was hast Du in Deiner NodeRed Adapter Konfig. Hast Du diese ecklige OPtion raus gemacht, dass alles in Strings gewandelt wird?

          R 1 Reply Last reply Reply Quote 0
          • R
            Renegade 0 @mickym last edited by

            @mickym
            jetzt ja. 🙂

            mickym 1 Reply Last reply Reply Quote 0
            • mickym
              mickym Most Active @Renegade 0 last edited by mickym

              @renegade-0 sagte in Mehrere Datenpunkte mit einer variablen vergleichen:

              @mickym
              jetzt ja. 🙂

              Sollte man als erstes machen!!!!

              Wenn es Zahlen sind gehts nämlich jetzt, sonst musst halt konvertieren:

              8e3d790f-deac-41f2-96c3-1f9031d4a79e-image.png

              38e53ee1-c0c2-4378-93ba-f44bc2bb3d30-image.png

              Hier der Flow - auch mit Namen, wenn Du nicht nur true haben willst. 😉

              [
                 {
                     "id": "51113dd8.972204",
                     "type": "ioBroker list",
                     "z": "1ae851a8.7c63de",
                     "name": "authorised",
                     "topic": "0_userdata.0.door-server.door-RFID.*",
                     "objType": "state",
                     "regex": "",
                     "asArray": "false",
                     "onlyIDs": "false",
                     "withValues": "true",
                     "x": 550,
                     "y": 200,
                     "wires": [
                         [
                             "f064dd3d.75fe8",
                             "689dcd8a.51a634"
                         ]
                     ]
                 },
                 {
                     "id": "a2577882.2efd08",
                     "type": "ioBroker in",
                     "z": "1ae851a8.7c63de",
                     "name": "client/RFID",
                     "topic": "mqtt.0.client.RFID",
                     "payloadType": "value",
                     "onlyack": "",
                     "func": "all",
                     "gap": "",
                     "fireOnStart": "false",
                     "x": 80,
                     "y": 140,
                     "wires": [
                         [
                             "9d981111.4543b"
                         ]
                     ]
                 },
                 {
                     "id": "9d981111.4543b",
                     "type": "change",
                     "z": "1ae851a8.7c63de",
                     "name": "",
                     "rules": [
                         {
                             "t": "move",
                             "p": "payload",
                             "pt": "msg",
                             "to": "search",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 320,
                     "y": 200,
                     "wires": [
                         [
                             "51113dd8.972204"
                         ]
                     ]
                 },
                 {
                     "id": "7d60e459.bed5bc",
                     "type": "debug",
                     "z": "1ae851a8.7c63de",
                     "name": "Matched",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": true,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "payload",
                     "statusType": "auto",
                     "x": 1160,
                     "y": 120,
                     "wires": []
                 },
                 {
                     "id": "f064dd3d.75fe8",
                     "type": "switch",
                     "z": "1ae851a8.7c63de",
                     "name": "Treffer?",
                     "property": "payload",
                     "propertyType": "msg",
                     "rules": [
                         {
                             "t": "jsonata_exp",
                             "v": "search = payload.val",
                             "vt": "jsonata"
                         }
                     ],
                     "checkall": "true",
                     "repair": false,
                     "outputs": 1,
                     "x": 740,
                     "y": 200,
                     "wires": [
                         [
                             "8d0e7800.870138",
                             "7e533710.fd4f68",
                             "43a48ca8.55e674"
                         ]
                     ]
                 },
                 {
                     "id": "8d0e7800.870138",
                     "type": "change",
                     "z": "1ae851a8.7c63de",
                     "name": "setze payload auf true",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "true",
                             "tot": "bool"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 960,
                     "y": 120,
                     "wires": [
                         [
                             "7d60e459.bed5bc"
                         ]
                     ]
                 },
                 {
                     "id": "689dcd8a.51a634",
                     "type": "debug",
                     "z": "1ae851a8.7c63de",
                     "name": "Test 1:",
                     "active": false,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "true",
                     "targetType": "full",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 740,
                     "y": 340,
                     "wires": []
                 },
                 {
                     "id": "7e533710.fd4f68",
                     "type": "debug",
                     "z": "1ae851a8.7c63de",
                     "name": "search",
                     "active": false,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "search",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1030,
                     "y": 340,
                     "wires": []
                 },
                 {
                     "id": "eb860852.0e1938",
                     "type": "inject",
                     "z": "1ae851a8.7c63de",
                     "name": "",
                     "props": [
                         {
                             "p": "payload"
                         }
                     ],
                     "repeat": "",
                     "crontab": "",
                     "once": false,
                     "onceDelay": 0.1,
                     "topic": "",
                     "payload": "12345",
                     "payloadType": "num",
                     "x": 90,
                     "y": 240,
                     "wires": [
                         [
                             "9d981111.4543b"
                         ]
                     ]
                 },
                 {
                     "id": "43a48ca8.55e674",
                     "type": "change",
                     "z": "1ae851a8.7c63de",
                     "name": "",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.common.name",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 970,
                     "y": 200,
                     "wires": [
                         [
                             "5ab61be9.22b424"
                         ]
                     ]
                 },
                 {
                     "id": "5ab61be9.22b424",
                     "type": "debug",
                     "z": "1ae851a8.7c63de",
                     "name": "Wer bist Du?",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1190,
                     "y": 200,
                     "wires": []
                 }
              ]
              

              Ansonsten wenn Du die Zahlen als Strings miteinander vergleichen willst, musst halt in der switch Node konvertieren, also von

              6e938385-d301-4065-ace8-dc6fcb890cea-image.png

              in

              f0ed5dd0-d53e-4b6b-a22d-fbe2f2d98ad1-image.png

              R 1 Reply Last reply Reply Quote 0
              • R
                Renegade 0 @mickym last edited by

                @mickym

                habs jetzt mit etwas tüfteln wie folgt gelöst. Nicht schön, aber funktioniert. 😉

                [
                    {
                        "id": "1ae851a8.7c63de",
                        "type": "tab",
                        "label": "RFID-Check",
                        "disabled": false,
                        "info": ""
                    },
                    {
                        "id": "51113dd8.972204",
                        "type": "ioBroker list",
                        "z": "1ae851a8.7c63de",
                        "name": "authorised",
                        "topic": "0_userdata.0.door-server.door-RFID.*",
                        "objType": "state",
                        "regex": "",
                        "asArray": "false",
                        "onlyIDs": "false",
                        "withValues": "true",
                        "x": 550,
                        "y": 200,
                        "wires": [
                            [
                                "f064dd3d.75fe8"
                            ]
                        ]
                    },
                    {
                        "id": "a2577882.2efd08",
                        "type": "ioBroker in",
                        "z": "1ae851a8.7c63de",
                        "name": "client/RFID",
                        "topic": "mqtt.0.client.RFID",
                        "payloadType": "object",
                        "onlyack": "",
                        "func": "all",
                        "gap": "",
                        "fireOnStart": "false",
                        "x": 90,
                        "y": 200,
                        "wires": [
                            [
                                "9d981111.4543b"
                            ]
                        ]
                    },
                    {
                        "id": "9d981111.4543b",
                        "type": "change",
                        "z": "1ae851a8.7c63de",
                        "name": "",
                        "rules": [
                            {
                                "t": "move",
                                "p": "payload",
                                "pt": "msg",
                                "to": "search",
                                "tot": "msg"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 300,
                        "y": 200,
                        "wires": [
                            [
                                "51113dd8.972204"
                            ]
                        ]
                    },
                    {
                        "id": "7d60e459.bed5bc",
                        "type": "debug",
                        "z": "1ae851a8.7c63de",
                        "name": "Finish",
                        "active": true,
                        "tosidebar": true,
                        "console": false,
                        "tostatus": true,
                        "complete": "payload",
                        "targetType": "msg",
                        "statusVal": "payload",
                        "statusType": "auto",
                        "x": 1190,
                        "y": 140,
                        "wires": []
                    },
                    {
                        "id": "f064dd3d.75fe8",
                        "type": "switch",
                        "z": "1ae851a8.7c63de",
                        "name": "Treffer?",
                        "property": "payload",
                        "propertyType": "msg",
                        "rules": [
                            {
                                "t": "jsonata_exp",
                                "v": "search.val = payload.val",
                                "vt": "jsonata"
                            }
                        ],
                        "checkall": "false",
                        "repair": false,
                        "outputs": 1,
                        "x": 740,
                        "y": 200,
                        "wires": [
                            [
                                "8d0e7800.870138",
                                "ccff8fad.33733"
                            ]
                        ]
                    },
                    {
                        "id": "8d0e7800.870138",
                        "type": "change",
                        "z": "1ae851a8.7c63de",
                        "name": "setze payload auf true",
                        "rules": [
                            {
                                "t": "set",
                                "p": "payload",
                                "pt": "msg",
                                "to": "true",
                                "tot": "bool"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 980,
                        "y": 140,
                        "wires": [
                            [
                                "7d60e459.bed5bc"
                            ]
                        ]
                    },
                    {
                        "id": "7e533710.fd4f68",
                        "type": "debug",
                        "z": "1ae851a8.7c63de",
                        "name": "result",
                        "active": true,
                        "tosidebar": true,
                        "console": false,
                        "tostatus": false,
                        "complete": "payload",
                        "targetType": "msg",
                        "statusVal": "",
                        "statusType": "auto",
                        "x": 1190,
                        "y": 240,
                        "wires": []
                    },
                    {
                        "id": "ccff8fad.33733",
                        "type": "change",
                        "z": "1ae851a8.7c63de",
                        "name": "",
                        "rules": [
                            {
                                "t": "set",
                                "p": "payload",
                                "pt": "msg",
                                "to": "payload.common.name",
                                "tot": "msg"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 970,
                        "y": 240,
                        "wires": [
                            [
                                "7e533710.fd4f68"
                            ]
                        ]
                    }
                ]
                
                mickym 1 Reply Last reply Reply Quote 0
                • mickym
                  mickym Most Active @Renegade 0 last edited by

                  Was ist unschön - warum Du die RFID als objekt holst und nicht wie ich als Value - verstehe ich allerdings nicht.

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    Renegade 0 @mickym last edited by

                    @mickym

                    Da die als value im String kommt und ich die val aus der Liste als number bekomme. Also habe ich gleich die RFID als Objekt geholt, da ist es dann als number "konvertiert". 😉

                    mickym 1 Reply Last reply Reply Quote 0
                    • mickym
                      mickym Most Active @Renegade 0 last edited by mickym

                      @renegade-0 Ok - ansonsten habe ich Dir ja unten gezeigt, wie Du in der switch Node konvertierst - damit das alles matched. Wahrscheinlich sind sogar Strings besser - nicht dass es RFID mit führenden Nullen gibt. 😉

                      Aber was ist daran unschön. 😉 ???

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        Renegade 0 @mickym last edited by

                        @mickym
                        schöner wäre natürlich ein echtes konvertieren, aber so fit bin ich noch nicht. Bin ja ein Frischling auf dem Gebiet node-Red. 🙂

                        Kämpfe zb. gerade damit eine saubere Lösung zu finden, wenn eine Variable den Status von true auf false oder anders rum ändert, der switch dann sagt bei ture mache das und bei false das, aber leider kommen die werte aus der Var als bool und die switch kann kein bool.

                        mickym 1 Reply Last reply Reply Quote 0
                        • mickym
                          mickym Most Active @Renegade 0 last edited by

                          @renegade-0 Der Switch kann bool .)

                          603e6269-5e30-4439-af6e-dbafed45754a-image.png

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            Renegade 0 @mickym last edited by

                            @mickym
                            ahh, warum kann ich da ned einfach auswählen, wie bei den anderen?^^

                            Letzte Frage für heute, weil ich grad Dich als Genie dran hab. 🙂 Wie löst du es, wenn du quasi eine AND funktion brauchst. also wenn Var 1 +2 true, dann mach true?

                            mickym 2 Replies Last reply Reply Quote 0
                            • mickym
                              mickym Most Active @Renegade 0 last edited by mickym

                              @renegade-0

                              Mit JSONATA hast Du über $string() in String gewandelt. Das habe ich Dir unten gezeigt.

                              AND machst auch über JSONATA oder sammelst alles in einem Objekt, das mache ich bei vielen Verknüpfungen - da kann ich ggf. auch einen anderen Thread verweisen, wo ich das alles erklärt habe.

                              Die Nachrichten warten nicht aufeinander. Entweder vergleichst Du innerhalb eines Nachrichtenobjektes oder sammelst in Flow-Variablen.

                              266b3423-bb08-4f05-84a6-44ded15b9110-image.png

                              b40518b6-e9f9-49c4-86ec-f7793f0f3151-image.png

                              750c55b9-af81-4309-904d-04fdd2271bcd-image.png

                              Hier der Flow zu spielen:

                              [
                                 {
                                     "id": "4d5d7a10.756a74",
                                     "type": "inject",
                                     "z": "1121287c.817698",
                                     "name": "",
                                     "props": [
                                         {
                                             "p": "var1",
                                             "v": "25",
                                             "vt": "num"
                                         },
                                         {
                                             "p": "var2",
                                             "v": "hallo",
                                             "vt": "str"
                                         }
                                     ],
                                     "repeat": "",
                                     "crontab": "",
                                     "once": false,
                                     "onceDelay": 0.1,
                                     "topic": "",
                                     "payloadType": "str",
                                     "x": 670,
                                     "y": 560,
                                     "wires": [
                                         [
                                             "74314629.96c8b8"
                                         ]
                                     ]
                                 },
                                 {
                                     "id": "74314629.96c8b8",
                                     "type": "switch",
                                     "z": "1121287c.817698",
                                     "name": "",
                                     "property": "payload",
                                     "propertyType": "msg",
                                     "rules": [
                                         {
                                             "t": "jsonata_exp",
                                             "v": "var1 = 25 and var2 = 'hallo'",
                                             "vt": "jsonata"
                                         }
                                     ],
                                     "checkall": "true",
                                     "repair": false,
                                     "outputs": 1,
                                     "x": 850,
                                     "y": 560,
                                     "wires": [
                                         [
                                             "d6e9cd73.e8162"
                                         ]
                                     ]
                                 },
                                 {
                                     "id": "d6e9cd73.e8162",
                                     "type": "debug",
                                     "z": "1121287c.817698",
                                     "name": "var1 = 25 und var2 = hallo",
                                     "active": true,
                                     "tosidebar": true,
                                     "console": false,
                                     "tostatus": false,
                                     "complete": "true",
                                     "targetType": "full",
                                     "statusVal": "",
                                     "statusType": "auto",
                                     "x": 1090,
                                     "y": 560,
                                     "wires": []
                                 },
                                 {
                                     "id": "a83d9abb.c1d118",
                                     "type": "inject",
                                     "z": "1121287c.817698",
                                     "name": "",
                                     "props": [
                                         {
                                             "p": "var1",
                                             "v": "22",
                                             "vt": "num"
                                         },
                                         {
                                             "p": "var2",
                                             "v": "hallo",
                                             "vt": "str"
                                         }
                                     ],
                                     "repeat": "",
                                     "crontab": "",
                                     "once": false,
                                     "onceDelay": 0.1,
                                     "topic": "",
                                     "x": 670,
                                     "y": 500,
                                     "wires": [
                                         [
                                             "74314629.96c8b8"
                                         ]
                                     ]
                                 }
                              ]
                              

                              Für die Überwachung mehrere Zustände verweise ich auch einen anderen Beitrag von mir: https://forum.iobroker.net/topic/44765/gelöst-überwachung-eingeschaltete-verbraucher/3?_=1623542233576

                              Manche installieren sich auch eine UND Node. Ich denke man kommt ohne aus. Aber wer will kann ja zusätzliche NOdes installieren: https://flows.nodered.org/node/node-red-contrib-boolean-logic

                              R 1 Reply Last reply Reply Quote 0
                              • R
                                Renegade 0 @mickym last edited by

                                @mickym
                                perfekt danke dir. Damit werde ich mich morgen mal soielen. Also falls du mal an die österreichische Grenze kommst. Steht ein Bier, Kaffe, Tee oder was immer du willst gern für Dich bereit. 🙂

                                Und nochmals vielen Lieben Dank für die Rettung und deine Zeit.

                                mickym 1 Reply Last reply Reply Quote 0
                                • mickym
                                  mickym Most Active @Renegade 0 last edited by mickym

                                  @renegade-0 Soweit weg wohne ich nicht davon weg. 😉

                                  R 1 Reply Last reply Reply Quote 0
                                  • R
                                    Renegade 0 @mickym last edited by

                                    @mickym
                                    Na dann, die Prüfung ist bald rum.^^

                                    1 Reply Last reply Reply Quote 0
                                    • mickym
                                      mickym Most Active @Renegade 0 last edited by

                                      @renegade-0 sagte in Mehrere Datenpunkte mit einer variablen vergleichen:

                                      @mickym
                                      ahh, warum kann ich da ned einfach auswählen, wie bei den anderen?^^

                                      Letzte Frage für heute, weil ich grad Dich als Genie dran hab. 🙂 Wie löst du es, wenn du quasi eine AND funktion brauchst. also wenn Var 1 +2 true, dann mach true?

                                      Bei var1=true und var2= true (also beide Variablen enthalten einen Bool) - kannst in das JSONATA Feld natürlich einfach schreiben:

                                      var1 and var2

                                      88c78abc-59af-4532-acfa-a63ea616cfb6-image.png

                                      Der Switch leitet dann an diesen Ausgang wenn der gesamte Ausdruck im JSONATA Feld true ergibt.

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post

                                      Support us

                                      ioBroker
                                      Community Adapters
                                      Donate

                                      1.0k
                                      Online

                                      31.7k
                                      Users

                                      79.7k
                                      Topics

                                      1.3m
                                      Posts

                                      2
                                      25
                                      821
                                      Loading More Posts
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      Community
                                      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                      The ioBroker Community 2014-2023
                                      logo