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. Payload String zerlegen

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    Payload String zerlegen

    This topic has been deleted. Only users with topic management privileges can see it.
    • 66er
      66er @mickym last edited by 66er

      @mickym

      Hallo und schönen Sonntag.

      Nochmals Danke für Deine bisherige Unterstützung.

      Das Gelernte konnte ich inzwischen auf weitere Gerätetypen umsetzen. Soweit so gut. 👍

      Doch nun scheitere ich an einem Gerät mit 4 Kanälen, der JSON ist entsprechend umfangreicher:

      {"ble":{},"cloud":{"connected":false},"eth":{"ip":null},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"input:2":{"id":2,"state":false},"input:3":{"id":3,"state":false},"mqtt":{"connected":true},"switch:0":{"id": 0, "source": "UI", "output": false, "apower": 0.000, "voltage": 237.237,"aenergy": {"total":0.021,"by_minute":[0.000,0.000,0.000],"minute_ts":1633241652},"temperature":{"tC":null, "tF":null}},"switch:1":{"id": 1, "source": "init", "output": false, "apower": 0.000, "voltage": 237.292,"aenergy": {"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1633241652},"temperature":{"tC":null, "tF":null}},"switch:2":{"id": 2, "source": "init", "output": false, "apower": 0.000, "voltage": 238.268,"aenergy": {"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1633241652},"temperature":{"tC":null, "tF":null}},"switch:3":{"id": 3, "source": "init", "output": false, "apower": 0.000, "voltage": 238.230,"aenergy": {"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1633241651},"temperature":{"tC":null, "tF":null}},"sys":{"mac":"95CCA87E43AC","restart_required":false,"time":"08:14","unixtime":1633241653,"uptime":741,"ram_size":236340,"ram_free":147172,"fs_size":474641,"fs_free":317515,"available_updates":{"beta":{"version":"0.9.0-beta1"}}},"wifi":{"sta_ip":"192.168.1.182","status":"got ip","ssid":"IoT","rssi":-58}}
      

      Wie bekomme ich da die 4 Werte "output" sauber raus? Obwohl ich nach Deiner Vorlage auch hier vorgegangen bin, kommen am Debug-Node auch Meldungen der anderen Kanäle raus.

      Bin für Deine Unterstützung sehr dankbar.

      Edit:
      So sieht mein aktuelles Ergebnis aus:

      Bildschirmfoto vom 2021-10-03 11-01-06.png

      Auch die von Dir gezeigte Pfadübernahme aus dem DEBUG bringt mir leider nicht das gewünschte Ergebnis.

      66er 1 Reply Last reply Reply Quote 0
      • 66er
        66er @66er last edited by

        Gefühlt 1000 Versuche später:

        Geschafft und erledigt. 👍
        (Freu' mich, denn am Besten bleibt es haften, wenn man selbst drauf gekommen ist. 😉 )

        Die einzelnen Kanäle habe ich nun mittels eines "Switch" mit 4 Bedingungen gefiltert. Der restliche Ablauf funktioniert dann unverändert. 😊

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

          @66er Ehrlich gesagt verstehe ich das Problem nicht. Man kann auch diese Werte ganz normal über den Pfad selektieren (Pfad kopieren):

          a61217ba-03cf-4891-99c1-8b2c3eff1459-image.png

          [
             {
                 "id": "f86a9994.9674a8",
                 "type": "inject",
                 "z": "169f5b00.a13415",
                 "name": "",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "{\"ble\":{},\"cloud\":{\"connected\":false},\"eth\":{\"ip\":null},\"input:0\":{\"id\":0,\"state\":false},\"input:1\":{\"id\":1,\"state\":false},\"input:2\":{\"id\":2,\"state\":false},\"input:3\":{\"id\":3,\"state\":false},\"mqtt\":{\"connected\":true},\"switch:0\":{\"id\": 0, \"source\": \"UI\", \"output\": false, \"apower\": 0.000, \"voltage\": 237.237,\"aenergy\": {\"total\":0.021,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241652},\"temperature\":{\"tC\":null, \"tF\":null}},\"switch:1\":{\"id\": 1, \"source\": \"init\", \"output\": false, \"apower\": 0.000, \"voltage\": 237.292,\"aenergy\": {\"total\":0.000,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241652},\"temperature\":{\"tC\":null, \"tF\":null}},\"switch:2\":{\"id\": 2, \"source\": \"init\", \"output\": false, \"apower\": 0.000, \"voltage\": 238.268,\"aenergy\": {\"total\":0.000,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241652},\"temperature\":{\"tC\":null, \"tF\":null}},\"switch:3\":{\"id\": 3, \"source\": \"init\", \"output\": false, \"apower\": 0.000, \"voltage\": 238.230,\"aenergy\": {\"total\":0.000,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241651},\"temperature\":{\"tC\":null, \"tF\":null}},\"sys\":{\"mac\":\"95CCA87E43AC\",\"restart_required\":false,\"time\":\"08:14\",\"unixtime\":1633241653,\"uptime\":741,\"ram_size\":236340,\"ram_free\":147172,\"fs_size\":474641,\"fs_free\":317515,\"available_updates\":{\"beta\":{\"version\":\"0.9.0-beta1\"}}},\"wifi\":{\"sta_ip\":\"192.168.1.182\",\"status\":\"got ip\",\"ssid\":\"IoT\",\"rssi\":-58}}",
                 "payloadType": "str",
                 "x": 270,
                 "y": 1280,
                 "wires": [
                     [
                         "6cd75bd9.78f334"
                     ]
                 ]
             },
             {
                 "id": "6cd75bd9.78f334",
                 "type": "json",
                 "z": "169f5b00.a13415",
                 "name": "",
                 "property": "payload",
                 "action": "",
                 "pretty": false,
                 "x": 440,
                 "y": 1280,
                 "wires": [
                     [
                         "d59ab49f.83adb8",
                         "e409ee82.60264",
                         "7e3fb303.82128c",
                         "efc2f40c.3bb7f8",
                         "b65c559e.7ae848"
                     ]
                 ]
             },
             {
                 "id": "efc2f40c.3bb7f8",
                 "type": "change",
                 "z": "169f5b00.a13415",
                 "name": "switch3",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "payload[\"switch:3\"].output",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 640,
                 "y": 1340,
                 "wires": [
                     [
                         "1011a999.7fcb76"
                     ]
                 ]
             },
             {
                 "id": "7e3fb303.82128c",
                 "type": "change",
                 "z": "169f5b00.a13415",
                 "name": "switch2",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "payload[\"switch:2\"].output",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 640,
                 "y": 1300,
                 "wires": [
                     [
                         "4d31248e.23a35c"
                     ]
                 ]
             },
             {
                 "id": "e409ee82.60264",
                 "type": "change",
                 "z": "169f5b00.a13415",
                 "name": "switch1",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "payload[\"switch:1\"].output",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 640,
                 "y": 1260,
                 "wires": [
                     [
                         "91670dba.155fc"
                     ]
                 ]
             },
             {
                 "id": "d59ab49f.83adb8",
                 "type": "change",
                 "z": "169f5b00.a13415",
                 "name": "switch0",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "payload[\"switch:0\"].output",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 640,
                 "y": 1220,
                 "wires": [
                     [
                         "5c94d229.fcf79c"
                     ]
                 ]
             },
             {
                 "id": "b65c559e.7ae848",
                 "type": "debug",
                 "z": "169f5b00.a13415",
                 "name": "",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "true",
                 "targetType": "full",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 420,
                 "y": 1360,
                 "wires": []
             },
             {
                 "id": "5c94d229.fcf79c",
                 "type": "debug",
                 "z": "169f5b00.a13415",
                 "name": "switch0",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 820,
                 "y": 1220,
                 "wires": []
             },
             {
                 "id": "91670dba.155fc",
                 "type": "debug",
                 "z": "169f5b00.a13415",
                 "name": "switch1",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 820,
                 "y": 1260,
                 "wires": []
             },
             {
                 "id": "4d31248e.23a35c",
                 "type": "debug",
                 "z": "169f5b00.a13415",
                 "name": "switch2",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 820,
                 "y": 1300,
                 "wires": []
             },
             {
                 "id": "1011a999.7fcb76",
                 "type": "debug",
                 "z": "169f5b00.a13415",
                 "name": "switch3",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 820,
                 "y": 1340,
                 "wires": []
             }
          ]
          

          Verstehe nicht warum man da irgendwas filtern muss - klappt ganz normal:

          66er 1 Reply Last reply Reply Quote 0
          • 66er
            66er @mickym last edited by 66er

            @mickym

            Danke für's Feedback.

            Vielleicht hatte sich auch bei mir ein Fehler eingeschlichen!?

            Stehe ja erst am Anfang mit MQTT und NodeRed.

            Da heißt es schon mal hinfallen, aufstehen und weitermachen.

            Danke nochmal. 👍

            (PS: Werde es nochmal gegenchecken. Sollte dann ja auch bei mir laufen.)

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

              @66er Du kannst auch jedes Switch Objekt nur auf die Objektebene herauslösen und dann die Eigenschaften eines Switches in einem 2. Schritt bearbeiten. Deiner Fantasie sind keine Grenzen gesetzt:

              f54354a0-c8fb-41f2-8e38-7508b181b48b-image.png

              [
                 {
                     "id": "f86a9994.9674a8",
                     "type": "inject",
                     "z": "169f5b00.a13415",
                     "name": "",
                     "props": [
                         {
                             "p": "payload"
                         }
                     ],
                     "repeat": "",
                     "crontab": "",
                     "once": false,
                     "onceDelay": 0.1,
                     "topic": "",
                     "payload": "{\"ble\":{},\"cloud\":{\"connected\":false},\"eth\":{\"ip\":null},\"input:0\":{\"id\":0,\"state\":false},\"input:1\":{\"id\":1,\"state\":false},\"input:2\":{\"id\":2,\"state\":false},\"input:3\":{\"id\":3,\"state\":false},\"mqtt\":{\"connected\":true},\"switch:0\":{\"id\": 0, \"source\": \"UI\", \"output\": false, \"apower\": 0.000, \"voltage\": 237.237,\"aenergy\": {\"total\":0.021,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241652},\"temperature\":{\"tC\":null, \"tF\":null}},\"switch:1\":{\"id\": 1, \"source\": \"init\", \"output\": false, \"apower\": 0.000, \"voltage\": 237.292,\"aenergy\": {\"total\":0.000,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241652},\"temperature\":{\"tC\":null, \"tF\":null}},\"switch:2\":{\"id\": 2, \"source\": \"init\", \"output\": false, \"apower\": 0.000, \"voltage\": 238.268,\"aenergy\": {\"total\":0.000,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241652},\"temperature\":{\"tC\":null, \"tF\":null}},\"switch:3\":{\"id\": 3, \"source\": \"init\", \"output\": false, \"apower\": 0.000, \"voltage\": 238.230,\"aenergy\": {\"total\":0.000,\"by_minute\":[0.000,0.000,0.000],\"minute_ts\":1633241651},\"temperature\":{\"tC\":null, \"tF\":null}},\"sys\":{\"mac\":\"95CCA87E43AC\",\"restart_required\":false,\"time\":\"08:14\",\"unixtime\":1633241653,\"uptime\":741,\"ram_size\":236340,\"ram_free\":147172,\"fs_size\":474641,\"fs_free\":317515,\"available_updates\":{\"beta\":{\"version\":\"0.9.0-beta1\"}}},\"wifi\":{\"sta_ip\":\"192.168.1.182\",\"status\":\"got ip\",\"ssid\":\"IoT\",\"rssi\":-58}}",
                     "payloadType": "str",
                     "x": 330,
                     "y": 1320,
                     "wires": [
                         [
                             "6cd75bd9.78f334"
                         ]
                     ]
                 },
                 {
                     "id": "6cd75bd9.78f334",
                     "type": "json",
                     "z": "169f5b00.a13415",
                     "name": "",
                     "property": "payload",
                     "action": "",
                     "pretty": false,
                     "x": 500,
                     "y": 1320,
                     "wires": [
                         [
                             "d59ab49f.83adb8",
                             "e409ee82.60264",
                             "7e3fb303.82128c",
                             "efc2f40c.3bb7f8",
                             "b65c559e.7ae848"
                         ]
                     ]
                 },
                 {
                     "id": "efc2f40c.3bb7f8",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "switch3",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload[\"switch:3\"]",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 700,
                     "y": 1480,
                     "wires": [
                         [
                             "666be515.af213c",
                             "9b305a05.dd89e8"
                         ]
                     ]
                 },
                 {
                     "id": "7e3fb303.82128c",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "switch2",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload[\"switch:2\"]",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 700,
                     "y": 1400,
                     "wires": [
                         [
                             "1306fb28.2e72e5",
                             "ffe7aeed.e875e"
                         ]
                     ]
                 },
                 {
                     "id": "e409ee82.60264",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "switch1",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload[\"switch:1\"]",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 700,
                     "y": 1320,
                     "wires": [
                         [
                             "1ab33829.4b2438",
                             "9a153f8f.51f3a"
                         ]
                     ]
                 },
                 {
                     "id": "d59ab49f.83adb8",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "switch0",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload[\"switch:0\"]",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 700,
                     "y": 1240,
                     "wires": [
                         [
                             "10fa2b5a.1d3fd5",
                             "d9d71e77.faca5"
                         ]
                     ]
                 },
                 {
                     "id": "b65c559e.7ae848",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "true",
                     "targetType": "full",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 480,
                     "y": 1400,
                     "wires": []
                 },
                 {
                     "id": "10fa2b5a.1d3fd5",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "output",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.output",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1220,
                     "wires": [
                         [
                             "21f577ba.3b76c8"
                         ]
                     ]
                 },
                 {
                     "id": "d9d71e77.faca5",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "energy",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.aenergy.total",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1260,
                     "wires": [
                         [
                             "f8d0d07f.86fff"
                         ]
                     ]
                 },
                 {
                     "id": "1ab33829.4b2438",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "output",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.output",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1300,
                     "wires": [
                         [
                             "d763e07f.5c467"
                         ]
                     ]
                 },
                 {
                     "id": "9a153f8f.51f3a",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "energy",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.aenergy.total",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1340,
                     "wires": [
                         [
                             "ae57bd4a.003a3"
                         ]
                     ]
                 },
                 {
                     "id": "1306fb28.2e72e5",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "output",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.output",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1380,
                     "wires": [
                         [
                             "63096a35.170df4"
                         ]
                     ]
                 },
                 {
                     "id": "ffe7aeed.e875e",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "energy",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.aenergy.total",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1420,
                     "wires": [
                         [
                             "678ced56.3d2c44"
                         ]
                     ]
                 },
                 {
                     "id": "666be515.af213c",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "output",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.output",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1460,
                     "wires": [
                         [
                             "85150103.9bf37"
                         ]
                     ]
                 },
                 {
                     "id": "9b305a05.dd89e8",
                     "type": "change",
                     "z": "169f5b00.a13415",
                     "name": "energy",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.aenergy.total",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 890,
                     "y": 1500,
                     "wires": [
                         [
                             "5dfb6b7f.67f114"
                         ]
                     ]
                 },
                 {
                     "id": "21f577ba.3b76c8",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 0 output",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1220,
                     "wires": []
                 },
                 {
                     "id": "f8d0d07f.86fff",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 0 energy",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1260,
                     "wires": []
                 },
                 {
                     "id": "d763e07f.5c467",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 1 output",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1300,
                     "wires": []
                 },
                 {
                     "id": "ae57bd4a.003a3",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 1 energy",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1340,
                     "wires": []
                 },
                 {
                     "id": "63096a35.170df4",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 2 output",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1380,
                     "wires": []
                 },
                 {
                     "id": "678ced56.3d2c44",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 2 energy",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1420,
                     "wires": []
                 },
                 {
                     "id": "85150103.9bf37",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 3 output",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1460,
                     "wires": []
                 },
                 {
                     "id": "5dfb6b7f.67f114",
                     "type": "debug",
                     "z": "169f5b00.a13415",
                     "name": "switch 3 energy",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1080,
                     "y": 1500,
                     "wires": []
                 }
              ]
              

              66er 1 Reply Last reply Reply Quote 0
              • 66er
                66er @mickym last edited by

                @mickym
                Sieht ja fast aus, wie mein Ergebnis. 👍

                So bin ich zu Erfolg gekommen:
                Bildschirmfoto vom 2021-10-03 14-18-14.png

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

                  @66er Falls Du das nur in eigene DP wegschreiben willst, dann kannst Dir ja mal meinen Subflow anschauen:

                  https://forum.iobroker.net/topic/43856/json-string-oder-java-object-in-iobroker-struktur

                  Seit Admin 5 musst Du dann zwar noch etwas nacharbeiten, in dem Du mit einem Skript die fehlenden Objekte noch erzeugst. Aber falls Du ihn nutzen willst, bekommst Du so alles in DP zerlegt.

                  IN meinen Augen ist das zwar nicht sinnvoll, aber ich sehe ja, dass Du mit Deinem Flow nichts anderes machst.

                  Oder Du nimmst den mqtt-Adapter im iobroker - dann hast Du ebenfalls alles als einzelne Datenpunkte.

                  66er 1 Reply Last reply Reply Quote 0
                  • 66er
                    66er @mickym last edited by 66er

                    @mickym sagte in Payload String zerlegen:

                    ...

                    IN meinen Augen ist das zwar nicht sinnvoll, aber ich sehe ja, dass Du mit Deinem Flow nichts anderes machst.

                    Schau mir den anderen Link natürlich noch an.

                    Warum ist das nicht sinnvoll? (Ich lerne mich ja gerade erst ein und wenn ich hier was falsch mache, sollte ich verstehen warum.)

                    Versuchsweise schreibe ich die Werte da rein und visualisiere sie dann.

                    Leider geben die Geräte nur einen "Sammelstring" nach MQTT und keine einzelnen, direkt verwertbare Datenpunkte.

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

                      @66er OK zum Visualisieren hängt davon ab, was Du halt nutzt. Für VIS ja.

                      Wenn Du das Node-Red Dashborad nutzt, dann fütterst Du ja den switch mit der payload und der Switch behält ja den Status.
                      Aber Du hast Recht für VIS ist es sinnvoll.

                      Ansonsten ist zwar schön alles in eigene Datenpunkte zu schreiben, aber gibt Dir ja keinen Mehrwert, weil die Info letztlich in dem JSON String enthalten ist. Wie gesagt für VIS ist es sinnvoll.

                      66er 1 Reply Last reply Reply Quote 0
                      • 66er
                        66er @mickym last edited by 66er

                        @mickym

                        Ja, ich nutze VIS.

                        Hier noch ein Screenshot von MQTT:

                        Bildschirmfoto vom 2021-10-03 16-27-21.png

                        Im RPC-String unter events steht alles drin.

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

                          @66er Ja wie gesagt, wenn Du nur das wieder in DP speicherst, was Du visualisierst - passt das schon!!!

                          66er 1 Reply Last reply Reply Quote 0
                          • 66er
                            66er @mickym last edited by

                            @mickym

                            Prima,

                            und ja: alle anderen Datenpunkt bleiben im JSON ohne das ich die anpacke.

                            Danke, wieder mein Wissen und Verständnis für MQTT erweitert.👍

                            R 1 Reply Last reply Reply Quote 0
                            • R
                              rieders @66er last edited by rieders

                              Hallo

                              Ich versuche gerade mein Stromzähler String zu zerlegen.
                              Eine Verbindung zum mqtt-Broker besteht, die Daten werden auch im Debug angezeigt.

                              Ich habe schon einiges Versuch, ich bekomme einfach nicht die Werte einzeln angezeigt.

                              Smartmeter_Garten/tele/SENSOR : msg.payload : string[643]
                              "{"Time":"2023-01-13T12:54:35","SDM630":{"1":178,"Voltage_P1":231.88,"Voltage_P2":231.5,"Voltage_P3":232.49,"Current_P1":0,"Current_P2":0.1,"Current_P3":0,"Power_P1":0,"Power_P2":22.35,"Power_P3":0,"Frequenz":50.01,"Total":534.694,"phase_angle":-9.73,"Import_nres":186.145,"Export_nres":348.549,"Export_P1":13.568,"Export_P2":334.981,"Export_P3":0,"Import_P1":19.409,"Import_P2":131.003,"Import_P3":35.733,"L1_total_kwh":32.977,"L2_total_kwh":465.984,"L3_total_kwh":35.733,"Blindleistung_L1":0,"Blindleistung_L2":-7.734,"Blindleistung_L3":0,"Scheinleistung_L1":0,"Scheinleistung_L2":22.627,"Scheinleistung_L3":0,"VAh_since_last_reset":565.815}}"

                              Screenshot 2023-01-13 130004.png

                              Ich hoffe jemand kann mir weiter helfen.


                              [
                              {
                              "id": "553525487db580b5",
                              "type": "mqtt in",
                              "z": "eb71b4cddc9da37a",
                              "name": "Smartmeter_Garten/tele/SENSOR",
                              "topic": "Smartmeter_Garten/tele/SENSOR",
                              "qos": "2",
                              "datatype": "auto-detect",
                              "broker": "e7e1e2255e66e588",
                              "nl": false,
                              "rap": true,
                              "rh": "2",
                              "inputs": 0,
                              "x": 180,
                              "y": 260,
                              "wires": [
                              [
                              "04a7ba72539a5cb1",
                              "df378652670347e0"
                              ]
                              ]
                              },
                              {
                              "id": "b0fcb45d6d8ab9f4",
                              "type": "ui_gauge",
                              "z": "eb71b4cddc9da37a",
                              "name": "Test",
                              "group": "67140eec2a9994a9",
                              "order": 0,
                              "width": 0,
                              "height": 0,
                              "gtype": "gage",
                              "title": "Voltage_P1",
                              "label": "",
                              "format": "{{Value}}",
                              "min": "1",
                              "max": "260",
                              "colors": [
                              "#b30000",
                              "#e6e600",
                              "#00b815"
                              ],
                              "seg1": "",
                              "seg2": "",
                              "x": 890,
                              "y": 260,
                              "wires": []
                              },
                              {
                              "id": "9faaac80e56b9d83",
                              "type": "ui_chart",
                              "z": "eb71b4cddc9da37a",
                              "name": "",
                              "group": "67140eec2a9994a9",
                              "order": 0,
                              "width": 0,
                              "height": 0,
                              "label": "chart",
                              "chartType": "line",
                              "legend": "false",
                              "xformat": "HH:mm:ss",
                              "interpolate": "linear",
                              "nodata": "",
                              "dot": false,
                              "ymin": "0",
                              "ymax": "260",
                              "removeOlder": 1,
                              "removeOlderPoints": "",
                              "removeOlderUnit": "3600",
                              "cutout": 0,
                              "useOneColor": false,
                              "useUTC": false,
                              "colors": [
                              "#1f77b4",
                              "#aec7e8",
                              "#ff7f0e",
                              "#2ca02c",
                              "#98df8a",
                              "#d62728",
                              "#ff9896",
                              "#9467bd",
                              "#c5b0d5"
                              ],
                              "outputs": 1,
                              "useDifferentColor": false,
                              "x": 890,
                              "y": 320,
                              "wires": [
                              []
                              ]
                              },
                              {
                              "id": "04a7ba72539a5cb1",
                              "type": "json",
                              "z": "eb71b4cddc9da37a",
                              "name": "V1",
                              "property": "payload",
                              "action": "",
                              "pretty": false,
                              "x": 450,
                              "y": 200,
                              "wires": [
                              [
                              "35354018b6c6c095",
                              "639599639f78788c"
                              ]
                              ]
                              },
                              {
                              "id": "6f72cb37f4aa2278",
                              "type": "debug",
                              "z": "eb71b4cddc9da37a",
                              "name": "debug 1",
                              "active": true,
                              "tosidebar": true,
                              "console": false,
                              "tostatus": false,
                              "complete": "payload",
                              "targetType": "msg",
                              "statusVal": "",
                              "statusType": "auto",
                              "x": 900,
                              "y": 200,
                              "wires": []
                              },
                              {
                              "id": "35354018b6c6c095",
                              "type": "debug",
                              "z": "eb71b4cddc9da37a",
                              "name": "debug 2",
                              "active": true,
                              "tosidebar": true,
                              "console": false,
                              "tostatus": false,
                              "complete": "payload",
                              "targetType": "msg",
                              "statusVal": "",
                              "statusType": "auto",
                              "x": 620,
                              "y": 120,
                              "wires": []
                              },
                              {
                              "id": "639599639f78788c",
                              "type": "change",
                              "z": "eb71b4cddc9da37a",
                              "name": "",
                              "rules": [
                              {
                              "t": "set",
                              "p": "payload",
                              "pt": "msg",
                              "to": "payload["SDM630"].Voltage_P1",
                              "tot": "msg"
                              }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 670,
                              "y": 200,
                              "wires": [
                              [
                              "6f72cb37f4aa2278",
                              "b0fcb45d6d8ab9f4",
                              "9faaac80e56b9d83"
                              ]
                              ]
                              },
                              {
                              "id": "a5192d83b6ce2f1c",
                              "type": "mqtt out",
                              "z": "eb71b4cddc9da37a",
                              "name": "V1",
                              "topic": "Testzähler",
                              "qos": "",
                              "retain": "",
                              "respTopic": "",
                              "contentType": "",
                              "userProps": "",
                              "correl": "",
                              "expiry": "",
                              "broker": "d19896c9b4e98e28",
                              "x": 750,
                              "y": 340,
                              "wires": []
                              },
                              {
                              "id": "df378652670347e0",
                              "type": "function",
                              "z": "eb71b4cddc9da37a",
                              "name": "function 2",
                              "func": "\nreturn msg;payload["SDM630"].Voltage_P1",
                              "outputs": 1,
                              "noerr": 0,
                              "initialize": "",
                              "finalize": "",
                              "libs": [],
                              "x": 560,
                              "y": 340,
                              "wires": [
                              [
                              "a5192d83b6ce2f1c"
                              ]
                              ]
                              },
                              {
                              "id": "e7e1e2255e66e588",
                              "type": "mqtt-broker",
                              "name": "mqtt-broker",
                              "broker": "192.168.1.146",
                              "port": "1885",
                              "clientid": "",
                              "autoConnect": true,
                              "usetls": false,
                              "protocolVersion": "4",
                              "keepalive": "60",
                              "cleansession": true,
                              "birthTopic": "",
                              "birthQos": "0",
                              "birthPayload": "",
                              "birthMsg": {},
                              "closeTopic": "",
                              "closeQos": "0",
                              "closePayload": "",
                              "closeMsg": {},
                              "willTopic": "",
                              "willQos": "0",
                              "willPayload": "",
                              "willMsg": {},
                              "userProps": "",
                              "sessionExpiry": ""
                              },
                              {
                              "id": "67140eec2a9994a9",
                              "type": "ui_group",
                              "name": "Test",
                              "tab": "71f6d060a354b8d9",
                              "order": 1,
                              "disp": true,
                              "width": "6",
                              "collapse": false
                              },
                              {
                              "id": "d19896c9b4e98e28",
                              "type": "mqtt-broker",
                              "name": "Venus OS",
                              "broker": "192.168.1.37",
                              "port": "1883",
                              "clientid": "test-client",
                              "autoConnect": true,
                              "usetls": false,
                              "protocolVersion": "4",
                              "keepalive": "60",
                              "cleansession": true,
                              "birthTopic": "",
                              "birthQos": "0",
                              "birthPayload": "",
                              "birthMsg": {},
                              "closeTopic": "",
                              "closeQos": "0",
                              "closePayload": "",
                              "closeMsg": {},
                              "willTopic": "",
                              "willQos": "0",
                              "willPayload": "",
                              "willMsg": {},
                              "userProps": "",
                              "sessionExpiry": ""
                              },
                              {
                              "id": "71f6d060a354b8d9",
                              "type": "ui_tab",
                              "name": "Home",
                              "icon": "dashboard",
                              "disabled": false,
                              "hidden": false
                              }
                              ]

                              Grüße André

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

                                @rieders Am besten ist es aus dem Debugfenster einfach den Pfad kopieren. Sprich du schaust, was aus debug2 rauskommt und kopierst den Pfad, des Wertes den Du anzeigen willst.

                                copy path.gif

                                Wenn ich also Dein Objekt nehme (Dein Flow lässt sich nicht importieren, da Du keine CodeTags verwendest) und möchte den Total Wert in der Text Node anzeigen, gehe ich mit dem Cursor dahin und kopieren den Pfad:

                                cca960b2-944e-4f26-a76f-d729853f8e0f-image.png

                                Dann kommt folgendes raus:

                                payload.SDM630.Total
                                

                                Das kannst Du nun direkt in der text node verwenden oder die payload verändern um es dann in einer gauge anzuzeigen.

                                In der Text-Node:
                                16172d89-4af0-4c05-aa6c-a6859d47d6a5-image.png

                                Mit der Change-Node:
                                d79496f0-9682-4b6b-856d-ce10b22dd2d1-image.png

                                8b658eef-2178-44f5-a447-1d68ae48ca9e-image.png

                                Hier mal mein Flow richtig exportiert in CodeTags:
                                Code-Tags.gif

                                [
                                   {
                                       "id": "79cb540f2a41c739",
                                       "type": "inject",
                                       "z": "289f539dcc33814e",
                                       "name": "",
                                       "props": [
                                           {
                                               "p": "payload"
                                           }
                                       ],
                                       "repeat": "",
                                       "crontab": "",
                                       "once": false,
                                       "onceDelay": 0.1,
                                       "topic": "",
                                       "payload": "{\"Time\":\"2023-01-13T12:54:35\",\"SDM630\":{\"1\":178,\"Voltage_P1\":231.88,\"Voltage_P2\":231.5,\"Voltage_P3\":232.49,\"Current_P1\":0,\"Current_P2\":0.1,\"Current_P3\":0,\"Power_P1\":0,\"Power_P2\":22.35,\"Power_P3\":0,\"Frequenz\":50.01,\"Total\":534.694,\"phase_angle\":-9.73,\"Import_nres\":186.145,\"Export_nres\":348.549,\"Export_P1\":13.568,\"Export_P2\":334.981,\"Export_P3\":0,\"Import_P1\":19.409,\"Import_P2\":131.003,\"Import_P3\":35.733,\"L1_total_kwh\":32.977,\"L2_total_kwh\":465.984,\"L3_total_kwh\":35.733,\"Blindleistung_L1\":0,\"Blindleistung_L2\":-7.734,\"Blindleistung_L3\":0,\"Scheinleistung_L1\":0,\"Scheinleistung_L2\":22.627,\"Scheinleistung_L3\":0,\"VAh_since_last_reset\":565.815}}",
                                       "payloadType": "json",
                                       "x": 230,
                                       "y": 4260,
                                       "wires": [
                                           [
                                               "479307770498d089",
                                               "7e8331652d9d7389",
                                               "ae5bde5b22da03b0"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "479307770498d089",
                                       "type": "debug",
                                       "z": "289f539dcc33814e",
                                       "name": "Objekt",
                                       "active": true,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 390,
                                       "y": 4260,
                                       "wires": []
                                   },
                                   {
                                       "id": "c9e73544e1bfa520",
                                       "type": "ui_gauge",
                                       "z": "289f539dcc33814e",
                                       "name": "",
                                       "group": "57f13d6f733e5c9d",
                                       "order": 2,
                                       "width": 0,
                                       "height": 0,
                                       "gtype": "gage",
                                       "title": "Total",
                                       "label": "units",
                                       "format": "{{value}}",
                                       "min": 0,
                                       "max": "1000",
                                       "colors": [
                                           "#00b500",
                                           "#e6e600",
                                           "#ca3838"
                                       ],
                                       "seg1": "",
                                       "seg2": "",
                                       "className": "",
                                       "x": 630,
                                       "y": 4340,
                                       "wires": []
                                   },
                                   {
                                       "id": "7e8331652d9d7389",
                                       "type": "ui_text",
                                       "z": "289f539dcc33814e",
                                       "group": "57f13d6f733e5c9d",
                                       "order": 3,
                                       "width": 0,
                                       "height": 0,
                                       "name": "",
                                       "label": "Total",
                                       "format": "{{msg.payload.SDM630.Total}}",
                                       "layout": "row-spread",
                                       "className": "",
                                       "x": 390,
                                       "y": 4300,
                                       "wires": []
                                   },
                                   {
                                       "id": "ae5bde5b22da03b0",
                                       "type": "change",
                                       "z": "289f539dcc33814e",
                                       "name": "",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.SDM630.Total",
                                               "tot": "msg"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 430,
                                       "y": 4340,
                                       "wires": [
                                           [
                                               "c9e73544e1bfa520",
                                               "680cd23566aafb30"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "680cd23566aafb30",
                                       "type": "debug",
                                       "z": "289f539dcc33814e",
                                       "name": "Total",
                                       "active": true,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 630,
                                       "y": 4380,
                                       "wires": []
                                   },
                                   {
                                       "id": "57f13d6f733e5c9d",
                                       "type": "ui_group",
                                       "name": "Test",
                                       "tab": "20b3095113f94d70",
                                       "order": 2,
                                       "disp": true,
                                       "width": "6",
                                       "collapse": false,
                                       "className": ""
                                   },
                                   {
                                       "id": "20b3095113f94d70",
                                       "type": "ui_tab",
                                       "name": "Home",
                                       "icon": "dashboard",
                                       "order": 1,
                                       "disabled": false,
                                       "hidden": false
                                   }
                                ]
                                

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

                                  Vielen Dank für die Hilfe.

                                  Das Auslesen funktioniert super.
                                  Ich weiß nur nicht wie du aus dem debug2 den Pfad ausgelesen hast, bei mir sieht das ganz anders aus.

                                  Screenshot 2023-01-13 182121.png

                                  Jetzt kann ich die Daten an Venus OS übergeben und hoffentlich als virtualen Zähler sehen.

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

                                    @rieders Hab ich gar nicht, da ich deinen Flow ja nicht importieren konnte (nicht in CodeTags), aber Du hast ja die Daten zum Glück bzw. das Objekt gepostet und so habe ich es einfach in die Inject Node geschrieben. Du kannst übrigens direkt in ein Objekt wandeln lassen, dann kannst du das direkt nach der mqtt-In Node machen, in dem Du Dir ein analysiertes Objekt ausgeben lässt.

                                    0784168f-bbda-49ee-a717-c84130207778-image.png

                                    Dann brauchst nach der mqtt-In auch nichts mehr konvertieren.

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

                                      @mickym
                                      Sorry, das ich mich hier mit ranhänge. Mein Problem ist denk mal ähnlich.
                                      Ich möchte relatives Dimmen von KNX auf Zigbee umsetzen.
                                      Dazu müßte wohl auch der Payload zerlegt werden 🤔

                                      Hier die Ausgaben vom KNX.

                                      Taster ist gedrückt und soll runterdimmen:

                                      {"topic":"1/4/26","devicename":"","payload":{"decr_incr":0,"data":1},"payloadmeasureunit":"unknown","payloadsubtypevalue":"unknown","knx":{"event":"GroupValue_Write","dpt":"3.007","dptdesc":"Dimming control","source":"1.1.4","destination":"1/4/26","rawValue":[1]},"previouspayload":{"decr_incr":0,"data":0},"_msgid":"34735868e6770bd1"}
                                      

                                      Taster losgelassen, dimmen soll stoppen:

                                      {"topic":"1/4/26","devicename":"","payload":{"decr_incr":0,"data":0},"payloadmeasureunit":"unknown","payloadsubtypevalue":"unknown","knx":{"event":"GroupValue_Write","dpt":"3.007","dptdesc":"Dimming control","source":"1.1.4","destination":"1/4/26","rawValue":[0]},"previouspayload":{"decr_incr":0,"data":1},"_msgid":"a4982ca3e5461702"}
                                      

                                      Taster ist gedrückt und soll hochdimmen:

                                      {"topic":"1/4/26","devicename":"","payload":{"decr_incr":1,"data":1},"payloadmeasureunit":"unknown","payloadsubtypevalue":"unknown","knx":{"event":"GroupValue_Write","dpt":"3.007","dptdesc":"Dimming control","source":"1.1.4","destination":"1/4/26","rawValue":[9]},"previouspayload":{"decr_incr":0,"data":0},"_msgid":"12ada754ecbda05f"}
                                      

                                      Taster losgelassen, dimmen soll stoppen:

                                      {"topic":"1/4/26","devicename":"","payload":{"decr_incr":0,"data":0},"payloadmeasureunit":"unknown","payloadsubtypevalue":"unknown","knx":{"event":"GroupValue_Write","dpt":"3.007","dptdesc":"Dimming control","source":"1.1.4","destination":"1/4/26","rawValue":[0]},"previouspayload":{"decr_incr":1,"data":1},"_msgid":"dabb632a5c74b60d"}
                                      

                                      Änderungen sehe ich hier jeweils bei :
                                      {"decr_incr":x,"data":x}

                                      Die Befehle für die Zigbee Leuchtmittel hab ich getestet, bei direktem schicken auf den DP funktionieren die schonmal.
                                      z.B.
                                      hochdimmen={"brightness_move": 40}
                                      runterdimmen={"brightness_move": -40}
                                      stoppen={"brightness_move": 0}

                                      Hab schon etliche Stunden mit der "Change" Node rumprobiert, allerdings ohne Erfolg 😞

                                      Wie muß ich vorgehen, um die KNX Befehle auf Zigbee umzusetzen?

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

                                        @frankthegreat Na ja - da ist noch etwas mehr Logik im Spiel und das muss man sich trotz aller Flows genau überlegen. Ich hab ja mal einen softdimmer ähnlich mit einem vis Widget erstellt.

                                        das mit dem hoch und runter Dimmen - kann man grundsätzlich mit mehreren Arten machen wahrscheinlich gibts den brightness Datenpunkt im Zigbee auch als absolute Werte. Move geht auch und vereinfacht das Ganze wohl eher.

                                        33b2febe-49b6-4bd0-ae21-f25077572712-image.png

                                        Im Prinzip, wenn es sich so darstellt, dann wäre

                                        data: 1 immer gedrückt = dimmen
                                        data: 0 immer losgelassen = stoppen

                                        decr_incr: 1 bei data 1 = hochdimmen
                                        decr_incr: 0 bei data 1 = runterdimmen.

                                        Da wir immer stoppen egal wie gerade gedimmt wurde, ist uns egal welchen Zustand das Teil vorher hatte. Auf dieser Basis probieren wird das mal - kleinen Moment. 😉

                                        So müsste das jetzt mal quick & dirty funktionieren:

                                        5c24f2bb-adcb-4f19-af60-07cff983bff9-image.png

                                        Statt der Inject Node halt Deine KNX Nodes dran machen und hinten halt in den brightness_move Datenpunkt ausgeben.

                                        [
                                           {
                                               "id": "65b061e782f70ac9",
                                               "type": "inject",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim down",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "{\"decr_incr\":0,\"data\":1}",
                                               "payloadType": "json",
                                               "x": 340,
                                               "y": 140,
                                               "wires": [
                                                   [
                                                       "240e3279819f0eae"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "2e68f247a519c9b3",
                                               "type": "inject",
                                               "z": "f71771fc316ba18f",
                                               "name": "stop",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "{\"decr_incr\":0,\"data\":0}",
                                               "payloadType": "json",
                                               "x": 350,
                                               "y": 220,
                                               "wires": [
                                                   [
                                                       "240e3279819f0eae"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "7efd5166901d779b",
                                               "type": "inject",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim up",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "{\"decr_incr\":1,\"data\":1}",
                                               "payloadType": "json",
                                               "x": 350,
                                               "y": 180,
                                               "wires": [
                                                   [
                                                       "240e3279819f0eae"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "240e3279819f0eae",
                                               "type": "switch",
                                               "z": "f71771fc316ba18f",
                                               "name": "",
                                               "property": "payload.data",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "eq",
                                                       "v": "0",
                                                       "vt": "num"
                                                   },
                                                   {
                                                       "t": "eq",
                                                       "v": "1",
                                                       "vt": "num"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 2,
                                               "x": 530,
                                               "y": 180,
                                               "wires": [
                                                   [
                                                       "2e23dae4976566fd"
                                                   ],
                                                   [
                                                       "2e5b171c27e7e26a"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "2e23dae4976566fd",
                                               "type": "change",
                                               "z": "f71771fc316ba18f",
                                               "name": "stop dimming",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "0",
                                                       "tot": "num"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 830,
                                               "y": 160,
                                               "wires": [
                                                   [
                                                       "26db997e0e9ac3b2"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "2e5b171c27e7e26a",
                                               "type": "switch",
                                               "z": "f71771fc316ba18f",
                                               "name": "",
                                               "property": "payload.decr_incr",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "eq",
                                                       "v": "0",
                                                       "vt": "num"
                                                   },
                                                   {
                                                       "t": "eq",
                                                       "v": "1",
                                                       "vt": "num"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 2,
                                               "x": 670,
                                               "y": 220,
                                               "wires": [
                                                   [
                                                       "75612c32dc30ca8a"
                                                   ],
                                                   [
                                                       "28f8664528857291"
                                                   ]
                                               ],
                                               "outputLabels": [
                                                   "dim down",
                                                   "dim up"
                                               ]
                                           },
                                           {
                                               "id": "75612c32dc30ca8a",
                                               "type": "change",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim down",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "-40",
                                                       "tot": "num"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 840,
                                               "y": 200,
                                               "wires": [
                                                   [
                                                       "26db997e0e9ac3b2"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "28f8664528857291",
                                               "type": "change",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim up",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "40",
                                                       "tot": "num"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 850,
                                               "y": 240,
                                               "wires": [
                                                   [
                                                       "26db997e0e9ac3b2"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "26db997e0e9ac3b2",
                                               "type": "debug",
                                               "z": "f71771fc316ba18f",
                                               "name": "brightness move",
                                               "active": true,
                                               "tosidebar": true,
                                               "console": false,
                                               "tostatus": false,
                                               "complete": "payload",
                                               "targetType": "msg",
                                               "statusVal": "",
                                               "statusType": "auto",
                                               "x": 1040,
                                               "y": 200,
                                               "wires": []
                                           }
                                        ]
                                        

                                        Das geht auch mit einer switch Node - nur dann muss man halt JSONATA verwenden und bei der ersten Übereinstimmung stoppen - dafür schaut der Flow übersichtlicher aus.

                                        60202c94-439b-4837-818e-f1e2536f5fd8-image.png

                                        [
                                           {
                                               "id": "9c42920aa2d032db",
                                               "type": "switch",
                                               "z": "f71771fc316ba18f",
                                               "name": "",
                                               "property": "payload",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "jsonata_exp",
                                                       "v": "payload.data = 0",
                                                       "vt": "jsonata"
                                                   },
                                                   {
                                                       "t": "jsonata_exp",
                                                       "v": "payload.decr_incr = 0",
                                                       "vt": "jsonata"
                                                   },
                                                   {
                                                       "t": "jsonata_exp",
                                                       "v": "payload.decr_incr = 1",
                                                       "vt": "jsonata"
                                                   }
                                               ],
                                               "checkall": "false",
                                               "repair": false,
                                               "outputs": 3,
                                               "x": 670,
                                               "y": 380,
                                               "wires": [
                                                   [
                                                       "9b040f37641b3023"
                                                   ],
                                                   [
                                                       "af3bf63193955ef5"
                                                   ],
                                                   [
                                                       "fa5c8b6c4663ba2f"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "b20aff26a7c2e42c",
                                               "type": "inject",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim down",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "{\"decr_incr\":0,\"data\":1}",
                                               "payloadType": "json",
                                               "x": 480,
                                               "y": 340,
                                               "wires": [
                                                   [
                                                       "9c42920aa2d032db"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "00cc24ce0bd3bc46",
                                               "type": "inject",
                                               "z": "f71771fc316ba18f",
                                               "name": "stop",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "{\"decr_incr\":0,\"data\":0}",
                                               "payloadType": "json",
                                               "x": 490,
                                               "y": 420,
                                               "wires": [
                                                   [
                                                       "9c42920aa2d032db"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "291666bfb387eb09",
                                               "type": "inject",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim up",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "{\"decr_incr\":1,\"data\":1}",
                                               "payloadType": "json",
                                               "x": 490,
                                               "y": 380,
                                               "wires": [
                                                   [
                                                       "9c42920aa2d032db"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "9b040f37641b3023",
                                               "type": "change",
                                               "z": "f71771fc316ba18f",
                                               "name": "stop dimming",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "0",
                                                       "tot": "num"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 830,
                                               "y": 340,
                                               "wires": [
                                                   [
                                                       "f3660815c7c7b3df"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "af3bf63193955ef5",
                                               "type": "change",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim down",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "-40",
                                                       "tot": "num"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 840,
                                               "y": 380,
                                               "wires": [
                                                   [
                                                       "f3660815c7c7b3df"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "fa5c8b6c4663ba2f",
                                               "type": "change",
                                               "z": "f71771fc316ba18f",
                                               "name": "dim up",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "40",
                                                       "tot": "num"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 850,
                                               "y": 420,
                                               "wires": [
                                                   [
                                                       "f3660815c7c7b3df"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "f3660815c7c7b3df",
                                               "type": "debug",
                                               "z": "f71771fc316ba18f",
                                               "name": "brightness move",
                                               "active": true,
                                               "tosidebar": true,
                                               "console": false,
                                               "tostatus": false,
                                               "complete": "payload",
                                               "targetType": "msg",
                                               "statusVal": "",
                                               "statusType": "auto",
                                               "x": 1040,
                                               "y": 380,
                                               "wires": []
                                           }
                                        ]
                                        

                                        frankthegreat 1 Reply Last reply Reply Quote 1
                                        • frankthegreat
                                          frankthegreat @mickym last edited by

                                          @mickym
                                          Jepp...und läuft auf Anhieb 👏

                                          Supi, danke dir. Abend gerettet.

                                          Ich hatte hauptsächlich versucht in diesen DP zu schreiben. Da hatt's aber mit der Umwandlung nicht geklappt.

                                          ad15c50f-f263-4207-8323-632d962d7a97-grafik.png

                                          Aber so geht's natürlich auch.

                                          Nochmal DANKE 👍

                                          1 Reply Last reply Reply Quote 1
                                          • 1
                                            1984chris @rieders last edited by

                                            @rieders @rieders Hallo Ich habe das gleiche Problem wie du

                                            ![0_1684256284880_ausgabe.jpg](Uploading 100%)

                                            konntest du das wie in Debug2 darstellen?
                                            DANKE im Voraus

                                            LG Christoph

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            895
                                            Online

                                            31.8k
                                            Users

                                            80.0k
                                            Topics

                                            1.3m
                                            Posts

                                            7
                                            77
                                            12527
                                            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