Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Node-Red
  5. Payload String zerlegen

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    15
    1
    580

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    625

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    1.9k

Payload String zerlegen

Geplant Angeheftet Gesperrt Verschoben Node-Red
77 Beiträge 7 Kommentatoren 16.0k Aufrufe 7 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • 66er6 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.

    mickymM Offline
    mickymM Offline
    mickym
    Most Active
    schrieb am zuletzt editiert von
    #18

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

    Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

    66er6 1 Antwort Letzte Antwort
    0
    • mickymM mickym

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

      66er6 Offline
      66er6 Offline
      66er
      schrieb am zuletzt editiert von
      #19

      @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.:+1:

      LG
      Stefan

      R 1 Antwort Letzte Antwort
      0
      • 66er6 66er

        @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.:+1:

        R Offline
        R Offline
        rieders
        schrieb am zuletzt editiert von rieders
        #20

        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é

        mickymM 1 2 Antworten Letzte Antwort
        0
        • R 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é

          mickymM Offline
          mickymM Offline
          mickym
          Most Active
          schrieb am zuletzt editiert von mickym
          #21

          @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
             }
          ]
          

          Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

          R 1 Antwort Letzte Antwort
          1
          • mickymM 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 Offline
            R Offline
            rieders
            schrieb am zuletzt editiert von rieders
            #22

            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.

            mickymM 1 Antwort Letzte Antwort
            0
            • R 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.

              mickymM Offline
              mickymM Offline
              mickym
              Most Active
              schrieb am zuletzt editiert von mickym
              #23

              @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.

              Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

              frankthegreatF 1 Antwort Letzte Antwort
              0
              • mickymM 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.

                frankthegreatF Offline
                frankthegreatF Offline
                frankthegreat
                schrieb am zuletzt editiert von
                #24

                @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 :thinking_face:

                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 :disappointed:

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

                1 Antwort Letzte Antwort
                0
                • mickymM Offline
                  mickymM Offline
                  mickym
                  Most Active
                  schrieb am zuletzt editiert von mickym
                  #25

                  @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": []
                     }
                  ]
                  

                  Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                  frankthegreatF 1 Antwort Letzte Antwort
                  1
                  • mickymM 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": []
                       }
                    ]
                    

                    frankthegreatF Offline
                    frankthegreatF Offline
                    frankthegreat
                    schrieb am zuletzt editiert von
                    #26

                    @mickym
                    Jepp...und läuft auf Anhieb :clap:

                    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:

                    1 Antwort Letzte Antwort
                    1
                    • R 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é

                      1 Offline
                      1 Offline
                      1984chris
                      schrieb am zuletzt editiert von
                      #27

                      @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 Antwort Letzte Antwort
                      0
                      • 1 1984chris

                        @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 Offline
                        1 Offline
                        1984chris
                        schrieb am zuletzt editiert von
                        #28

                        @1984chris ausgabe.jpg

                        1 mickymM 2 Antworten Letzte Antwort
                        0
                        • 1 1984chris

                          @1984chris ausgabe.jpg

                          1 Offline
                          1 Offline
                          1984chris
                          schrieb am zuletzt editiert von
                          #29

                          @1984chris ich will die einzelnen Werte L1,L2,L3 Ströme A_L1,A_l2 usw an die influxDB übertragen

                          mickymM 1 Antwort Letzte Antwort
                          0
                          • 1 1984chris

                            @1984chris ausgabe.jpg

                            mickymM Offline
                            mickymM Offline
                            mickym
                            Most Active
                            schrieb am zuletzt editiert von
                            #30

                            @1984chris Wenn ich Dir helfen soll, dann solltest Du den Wert in die Zwischenablage kopieren und hier in Codetags einbetten.

                            Dann woher hast Du das - kommt das aus einer iobroker IN Node oder aus einer mqtt Node?

                            Willst Du alle Werte in einzelne Datenpunkte zerlegen oder nur einzelne Werte extrahieren und weiter verarbeiten?
                            Einzelne Werte kopierst Du in die Zwischenablage in dem Du mit der Maul im Debug Fenster neben den Wert fährst.

                            copy path.gif

                            Wenn Du es in der Zwischenablage hast, dann kopierst Du es bitte in Code-Tags wie hier dargestellt:

                            Code-Tags.gif

                            Und wie gesagt - wer es nett, wenn Du ein paar Zeilen dazu schreiben möchtest, was Du möchtest

                            Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                            1 Antwort Letzte Antwort
                            0
                            • 1 1984chris

                              @1984chris ich will die einzelnen Werte L1,L2,L3 Ströme A_L1,A_l2 usw an die influxDB übertragen

                              mickymM Offline
                              mickymM Offline
                              mickym
                              Most Active
                              schrieb am zuletzt editiert von mickym
                              #31

                              @1984chris sagte in Payload String zerlegen:

                              @1984chris ich will die einzelnen Werte L1,L2,L3 Ströme A_L1,A_l2 usw an die influxDB übertragen

                              Dann wäre es wohl sinnvoll einzelne Werte zu erstellen, dann empfehle ich Dir meinen Flow - der den ganzen JSON in einzelne Datenpunkte schreibt:

                              https://forum.iobroker.net/topic/43856/json-oder-javascript-objekt-in-iobroker-datenpunkte-zerlegen

                              Dann brauchst Du nur diesen Flow zu importieren.

                              Im 1. Post ist eigentlich alles beschrieben und welche Einstellungen Du machen willst. Falls Du noch Fragen hast, dann gerne. Also hängt davon ab, ob Du nur ein paar Werte haben willst oder alle Werte einzeln haben möchtest.

                              Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                              1 1 Antwort Letzte Antwort
                              0
                              • mickymM mickym

                                @1984chris sagte in Payload String zerlegen:

                                @1984chris ich will die einzelnen Werte L1,L2,L3 Ströme A_L1,A_l2 usw an die influxDB übertragen

                                Dann wäre es wohl sinnvoll einzelne Werte zu erstellen, dann empfehle ich Dir meinen Flow - der den ganzen JSON in einzelne Datenpunkte schreibt:

                                https://forum.iobroker.net/topic/43856/json-oder-javascript-objekt-in-iobroker-datenpunkte-zerlegen

                                Dann brauchst Du nur diesen Flow zu importieren.

                                Im 1. Post ist eigentlich alles beschrieben und welche Einstellungen Du machen willst. Falls Du noch Fragen hast, dann gerne. Also hängt davon ab, ob Du nur ein paar Werte haben willst oder alle Werte einzeln haben möchtest.

                                1 Offline
                                1 Offline
                                1984chris
                                schrieb am zuletzt editiert von
                                #32

                                @mickym ```

                                {"Time":"2023-05-16T19:45:29","Tagstrom":{"V_L1":233,"V_L3":236,"V_L3":236,"A_L1":0.63,"A_L2":2.33,"A_L3":0.32,"W_IN":590,"W_OUT":0,"kWh_total_IN":19147.756,"kWh_total_OUT":776.383},"WäPu":{"V_L1":232,"V_L3":236,"V_L3":235,"A_L1":0.48,"A_L2":0.00,"A_L3":0.02,"W_IN":112,"W_OUT":0,"kWh_total_IN":21698.535,"kWh_total_OUT":0.000}}
                                

                                die Daten kommen von einenm Nodred in mqtt ich bekomme das auf der Debugseite nicht so angezeigt wie du im Beispiel. Will die einzelnen Werte dan in eine influxDB und weiter mit GRAFANA....

                                mickymM 2 Antworten Letzte Antwort
                                0
                                • 1 1984chris

                                  @mickym ```

                                  {"Time":"2023-05-16T19:45:29","Tagstrom":{"V_L1":233,"V_L3":236,"V_L3":236,"A_L1":0.63,"A_L2":2.33,"A_L3":0.32,"W_IN":590,"W_OUT":0,"kWh_total_IN":19147.756,"kWh_total_OUT":776.383},"WäPu":{"V_L1":232,"V_L3":236,"V_L3":235,"A_L1":0.48,"A_L2":0.00,"A_L3":0.02,"W_IN":112,"W_OUT":0,"kWh_total_IN":21698.535,"kWh_total_OUT":0.000}}
                                  

                                  die Daten kommen von einenm Nodred in mqtt ich bekomme das auf der Debugseite nicht so angezeigt wie du im Beispiel. Will die einzelnen Werte dan in eine influxDB und weiter mit GRAFANA....

                                  mickymM Offline
                                  mickymM Offline
                                  mickym
                                  Most Active
                                  schrieb am zuletzt editiert von
                                  #33

                                  @1984chris Wie gesagt wenn Du alle Werte haben willst, hast Du meinen Flow importiert und das Erstellen von Objekten zugelassen?

                                  Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                                  1 Antwort Letzte Antwort
                                  0
                                  • 1 1984chris

                                    @mickym ```

                                    {"Time":"2023-05-16T19:45:29","Tagstrom":{"V_L1":233,"V_L3":236,"V_L3":236,"A_L1":0.63,"A_L2":2.33,"A_L3":0.32,"W_IN":590,"W_OUT":0,"kWh_total_IN":19147.756,"kWh_total_OUT":776.383},"WäPu":{"V_L1":232,"V_L3":236,"V_L3":235,"A_L1":0.48,"A_L2":0.00,"A_L3":0.02,"W_IN":112,"W_OUT":0,"kWh_total_IN":21698.535,"kWh_total_OUT":0.000}}
                                    

                                    die Daten kommen von einenm Nodred in mqtt ich bekomme das auf der Debugseite nicht so angezeigt wie du im Beispiel. Will die einzelnen Werte dan in eine influxDB und weiter mit GRAFANA....

                                    mickymM Offline
                                    mickymM Offline
                                    mickym
                                    Most Active
                                    schrieb am zuletzt editiert von mickym
                                    #34

                                    @1984chris sagte in Payload String zerlegen:

                                    {"Time":"2023-05-16T19:45:29","Tagstrom":{"V_L1":233,"V_L3":236,"V_L3":236,"A_L1":0.63,"A_L2":2.33,"A_L3":0.32,"W_IN":590,"W_OUT":0,"kWh_total_IN":19147.756,"kWh_total_OUT":776.383},"WäPu":{"V_L1":232,"V_L3":236,"V_L3":235,"A_L1":0.48,"A_L2":0.00,"A_L3":0.02,"W_IN":112,"W_OUT":0,"kWh_total_IN":21698.535,"kWh_total_OUT":0.000}}

                                    In dem Tagstrom ist ein komisches Zeichen - hast Du den String über Wert kopieren reinkopiert oder mit der Maus?

                                    {
                                        "Time": "2023-05-16T19:45:29",
                                        "Tagstrom": {
                                            "V_L1": 233,
                                            "V_L3": 236,
                                            "A_L1": 0.63,
                                            "A_L2": 2.33,
                                            "A_L3": 0.32,
                                            "W_IN": 590,
                                            "W_OUT": 0,
                                            "kWh_total_IN": 19147.756,
                                            "kWh_total_OUT": 776.383
                                        },
                                        "WäPu": {
                                            "V_L1": 232,
                                            "V_L3": 235,
                                            "A_L1": 0.48,
                                            "A_L2": 0,
                                            "A_L3": 0.02,
                                            "W_IN": 112,
                                            "W_OUT": 0,
                                            "kWh_total_IN": 21698.535,
                                            "kWh_total_OUT": 0
                                        }
                                    }
                                    

                                    So funktioniert es.

                                    Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                                    1 1 Antwort Letzte Antwort
                                    0
                                    • mickymM mickym

                                      @1984chris sagte in Payload String zerlegen:

                                      {"Time":"2023-05-16T19:45:29","Tagstrom":{"V_L1":233,"V_L3":236,"V_L3":236,"A_L1":0.63,"A_L2":2.33,"A_L3":0.32,"W_IN":590,"W_OUT":0,"kWh_total_IN":19147.756,"kWh_total_OUT":776.383},"WäPu":{"V_L1":232,"V_L3":236,"V_L3":235,"A_L1":0.48,"A_L2":0.00,"A_L3":0.02,"W_IN":112,"W_OUT":0,"kWh_total_IN":21698.535,"kWh_total_OUT":0.000}}

                                      In dem Tagstrom ist ein komisches Zeichen - hast Du den String über Wert kopieren reinkopiert oder mit der Maus?

                                      {
                                          "Time": "2023-05-16T19:45:29",
                                          "Tagstrom": {
                                              "V_L1": 233,
                                              "V_L3": 236,
                                              "A_L1": 0.63,
                                              "A_L2": 2.33,
                                              "A_L3": 0.32,
                                              "W_IN": 590,
                                              "W_OUT": 0,
                                              "kWh_total_IN": 19147.756,
                                              "kWh_total_OUT": 776.383
                                          },
                                          "WäPu": {
                                              "V_L1": 232,
                                              "V_L3": 235,
                                              "A_L1": 0.48,
                                              "A_L2": 0,
                                              "A_L3": 0.02,
                                              "W_IN": 112,
                                              "W_OUT": 0,
                                              "kWh_total_IN": 21698.535,
                                              "kWh_total_OUT": 0
                                          }
                                      }
                                      

                                      So funktioniert es.

                                      1 Offline
                                      1 Offline
                                      1984chris
                                      schrieb am zuletzt editiert von
                                      #35

                                      @mickym

                                      Mit der Maus, wenn ich über Wert kopieren reinkopiere kommt

                                      [123,34,84,105,109,101,34,58,34,50,48,50,51,45,48,53,45,49,54,84,49,57,58,52,53,58,50,57,34,44,34,84,97,103,115,116,114,111,109,1,34,58,123,34,86,95,76,49,34,58,50,51,51,44,34,86,95,76,51,34,58,50,51,54,44,34,86,95,76,51,34,58,50,51,54,44,34,65,95,76,49,34,58,48,46,54,51,44,34,65,95,76,50,34,58,50,46,51,51,44,34,65,95,76,51,34,58,48,46,51,50,44,34,87,95,73,78,34,58,53,57,48,44,34,87,95,79,85,84,34,58,48,44,34,107,87,104,95,116,111,116,97,108,95,73,78,34,58,49,57,49,52,55,46,55,53,54,44,34,107,87,104,95,116,111,116,97,108,95,79,85,84,34,58,55,55,54,46,51,56,51,125,44,34,87,195,164,80,117,34,58,123,34,86,95,76,49,34,58,50,51,50,44,34,86,95,76,51,34,58,50,51,54,44,34,86,95,76,51,34,58,50,51,53,44,34,65,95,76,49,34,58,48,46,52,56,44,34,65,95,76,50,34,58,48,46,48,48,44,34,65,95,76,51,34,58,48,46,48,50,44,34,87,95,73,78,34,58,49,49,50,44,34,87,95,79,85,84,34,58,48,44,34,107,87,104,95,116,111,116,97,108,95,73,78,34,58,50,49,54,57,56,46,53,51,53,44,34,107,87,104,95,116,111,116,97,108,95,79,85,84,34,58,48,46,48,48,48,125,125]
                                      
                                      mickymM 1 Antwort Letzte Antwort
                                      0
                                      • 1 1984chris

                                        @mickym

                                        Mit der Maus, wenn ich über Wert kopieren reinkopiere kommt

                                        [123,34,84,105,109,101,34,58,34,50,48,50,51,45,48,53,45,49,54,84,49,57,58,52,53,58,50,57,34,44,34,84,97,103,115,116,114,111,109,1,34,58,123,34,86,95,76,49,34,58,50,51,51,44,34,86,95,76,51,34,58,50,51,54,44,34,86,95,76,51,34,58,50,51,54,44,34,65,95,76,49,34,58,48,46,54,51,44,34,65,95,76,50,34,58,50,46,51,51,44,34,65,95,76,51,34,58,48,46,51,50,44,34,87,95,73,78,34,58,53,57,48,44,34,87,95,79,85,84,34,58,48,44,34,107,87,104,95,116,111,116,97,108,95,73,78,34,58,49,57,49,52,55,46,55,53,54,44,34,107,87,104,95,116,111,116,97,108,95,79,85,84,34,58,55,55,54,46,51,56,51,125,44,34,87,195,164,80,117,34,58,123,34,86,95,76,49,34,58,50,51,50,44,34,86,95,76,51,34,58,50,51,54,44,34,86,95,76,51,34,58,50,51,53,44,34,65,95,76,49,34,58,48,46,52,56,44,34,65,95,76,50,34,58,48,46,48,48,44,34,65,95,76,51,34,58,48,46,48,50,44,34,87,95,73,78,34,58,49,49,50,44,34,87,95,79,85,84,34,58,48,44,34,107,87,104,95,116,111,116,97,108,95,73,78,34,58,50,49,54,57,56,46,53,51,53,44,34,107,87,104,95,116,111,116,97,108,95,79,85,84,34,58,48,46,48,48,48,125,125]
                                        
                                        mickymM Offline
                                        mickymM Offline
                                        mickym
                                        Most Active
                                        schrieb am zuletzt editiert von mickym
                                        #36

                                        @1984chris Na OK - ich weiss nicht was Du da genau gemacht hast.

                                        Wie gesagt wenn Du meinen Flow importierst - habe ich gerade gemacht - dann erhälst Du folgende Struktur

                                        c6cd19df-a859-4e36-9534-ac1964a2e038-image.png

                                        Wenn Du mein Flow hast - dann brauchst Du nur die neue Node und eine iobroker-Out Node:

                                        355133c4-db41-47c4-b7d8-3ae44abb9fea-image.png

                                        wie gesagt die Fremdobjekte erstellen zulassen und in der Node angeben unter welchem Datenpunkt die Datenpunkte angelegt werden sollen:

                                        02dbccce-d95d-47e7-9cd5-e81cc697612a-image.png

                                        Hier zum Import:

                                        [
                                           {
                                               "id": "6e802f1553b18149",
                                               "type": "subflow",
                                               "name": "JSON or Obj to IOBroker",
                                               "info": "# Creates an IOBroker tree\n\nThis node creates an IOBroker tree out of an Java-Object or JSON String.\n\nThe object tree will be created under 0_userdata.0\nIn addition to the JSON-String or Java Object as `msg.payload` it is necessary to specify a `msg.top` properity in addition to the msg-Object.\n\nThe object tree will be created under 0_userdata.0\n\nExisting `msg.topic` entries will be deleted.\nAn iobroker-out node has to be appended to this subflow node. It is not part of the subflow itself. No topic should be specified in the iobroker out node.\n\nIs `msg.top` property isn't defined, the `top` property of the subflow-node is used. \n\nIn the properties of the subflow node a new property `keepTopic` has been added. Default is _false_ to keep the current behaviour. If set to _true_ then the originial topic will be placed between the `top` property of the subflow node and the property of the analyzed JSON object.\n\n**Attention:**\nIf msg.top and top is empty, all msg.topics (msg.topic) will be directly prefixed with 0_userdata.0. . \n\n**Update 13.09.2022:**\nSpaces in topics of objects are no longer replaced with underscores in objects. No differences between all data types.\n\n# Erstellt einen Objektbaum im ioBroker\n\nDiese Node erstellt einen Objektbaum im ioBroker aus einem JAVA Objekt bzw. einem JSON String. \n\nDer Baum wird in jedem Fall unter 0_userdata.0 erstellt und zwar unter dem Topic der in` msg.top` mitgegeben wurde. In der `msg.payload` befindet sich dann der JSON String oder das entsprechende Objekt.\n\nExistierende `msg.topic `Einträge werden gelöscht.\nEin entsprechende iobroker-out Node muss an den Flow angehängt werden. Sie ist nicht Bestandteil des Subflows. In dieser iobroker-out Node darf kein Topic angegeben werden. \n\nFalls msg.top nicht definiert wurde, wird der `top`-Wert der Subflow-Node verwendet.\n\nIn den Eigenschaften der Subflow-Node wurde ein neuer Parameter `keepTopic` hinzugefügt. Standardwert ist _false_, um das bisherige Verhalten beizubehalten. Setzt man die Eigenschaft auf _true_, dann wird das originale Topic zwischen der `top` Eigenschaft der Subflow-Node und Eigenschaft des analysierten JSON Objektes eingefügt.\n\n**Achtung:**\nWenn top und msg.top leer ist, werden alle msg.topics (msg.topic) direkt unter dem Präfix 0_userdata.0., angelegt bzw. ausgegeben. \n\n**Update 13.09.2022:**\nLeerzeichen werden in Topics von Objekten nicht mehr durch Unterstriche ersetzt. Es gibt keine Unterschiede mehr zwischen den Datentypen.",
                                               "category": "",
                                               "in": [
                                                   {
                                                       "x": 60,
                                                       "y": 160,
                                                       "wires": [
                                                           {
                                                               "id": "554b8c663bcb46c2"
                                                           }
                                                       ]
                                                   }
                                               ],
                                               "out": [
                                                   {
                                                       "x": 2620,
                                                       "y": 280,
                                                       "wires": [
                                                           {
                                                               "id": "0962842ebd23e0d7",
                                                               "port": 0
                                                           }
                                                       ]
                                                   }
                                               ],
                                               "env": [
                                                   {
                                                       "name": "top",
                                                       "type": "str",
                                                       "value": "objRoot"
                                                   },
                                                   {
                                                       "name": "keepTopic",
                                                       "type": "bool",
                                                       "value": "false"
                                                   }
                                               ],
                                               "meta": {},
                                               "color": "#E2D96E",
                                               "icon": "node-red/batch.svg"
                                           },
                                           {
                                               "id": "3e11e8338f694832",
                                               "type": "split",
                                               "z": "6e802f1553b18149",
                                               "name": "split object",
                                               "splt": "\\n",
                                               "spltType": "str",
                                               "arraySplt": 1,
                                               "arraySpltType": "len",
                                               "stream": false,
                                               "addname": "key",
                                               "x": 1370,
                                               "y": 160,
                                               "wires": [
                                                   [
                                                       "0562a4249c8b856b"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "0562a4249c8b856b",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "add key to topic",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "stateName",
                                                       "pt": "msg",
                                                       "to": "key",
                                                       "tot": "msg"
                                                   },
                                                   {
                                                       "t": "set",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "to": "topic  & '.' & key",
                                                       "tot": "jsonata"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 1560,
                                               "y": 160,
                                               "wires": [
                                                   [
                                                       "ddc90985bef0fafa"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "ddc90985bef0fafa",
                                               "type": "switch",
                                               "z": "6e802f1553b18149",
                                               "name": "is type?",
                                               "property": "payload",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "istype",
                                                       "v": "array",
                                                       "vt": "array"
                                                   },
                                                   {
                                                       "t": "istype",
                                                       "v": "object",
                                                       "vt": "object"
                                                   },
                                                   {
                                                       "t": "else"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 3,
                                               "x": 1740,
                                               "y": 160,
                                               "wires": [
                                                   [
                                                       "bfce19b206660fbe"
                                                   ],
                                                   [
                                                       "3e11e8338f694832"
                                                   ],
                                                   [
                                                       "1a8c03d866b85b12"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "bfce19b206660fbe",
                                               "type": "split",
                                               "z": "6e802f1553b18149",
                                               "name": "split array",
                                               "splt": "\\n",
                                               "spltType": "str",
                                               "arraySplt": 1,
                                               "arraySpltType": "len",
                                               "stream": false,
                                               "addname": "",
                                               "x": 780,
                                               "y": 280,
                                               "wires": [
                                                   [
                                                       "e89927810c6d75ec"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "e89927810c6d75ec",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "add index to topic",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "to": "topic  & '.' & parts.index",
                                                       "tot": "jsonata"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 970,
                                               "y": 280,
                                               "wires": [
                                                   [
                                                       "a4d1a5d04564dc77"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "f5d52c6a57d08904",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "finalize msg.topic",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "top",
                                                       "pt": "msg",
                                                       "to": "'0_userdata.0.' & top",
                                                       "tot": "jsonata"
                                                   },
                                                   {
                                                       "t": "set",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "to": "top & '.' & topic",
                                                       "tot": "jsonata"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 2170,
                                               "y": 240,
                                               "wires": [
                                                   [
                                                       "0962842ebd23e0d7"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "1a8c03d866b85b12",
                                               "type": "switch",
                                               "z": "6e802f1553b18149",
                                               "name": "is msg.top != null",
                                               "property": "top",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "nnull"
                                                   },
                                                   {
                                                       "t": "null"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 2,
                                               "x": 1950,
                                               "y": 280,
                                               "wires": [
                                                   [
                                                       "f5d52c6a57d08904"
                                                   ],
                                                   [
                                                       "74c895ce724750de"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "e023fe88445ce43e",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "",
                                               "rules": [
                                                   {
                                                       "t": "delete",
                                                       "p": "topic",
                                                       "pt": "msg"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 350,
                                               "y": 200,
                                               "wires": [
                                                   [
                                                       "3649300b4c233b10"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "3649300b4c233b10",
                                               "type": "switch",
                                               "z": "6e802f1553b18149",
                                               "name": "is type?",
                                               "property": "payload",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "istype",
                                                       "v": "json",
                                                       "vt": "json"
                                                   },
                                                   {
                                                       "t": "istype",
                                                       "v": "array",
                                                       "vt": "array"
                                                   },
                                                   {
                                                       "t": "istype",
                                                       "v": "object",
                                                       "vt": "object"
                                                   },
                                                   {
                                                       "t": "else"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 4,
                                               "x": 600,
                                               "y": 160,
                                               "wires": [
                                                   [
                                                       "fc7913a8524badb7"
                                                   ],
                                                   [
                                                       "bfce19b206660fbe"
                                                   ],
                                                   [
                                                       "3e11e8338f694832"
                                                   ],
                                                   [
                                                       "9ac3cc3681e8b6c6"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "1b8480cd2df7ba3f",
                                               "type": "comment",
                                               "z": "6e802f1553b18149",
                                               "name": "Array",
                                               "info": "",
                                               "x": 600,
                                               "y": 280,
                                               "wires": []
                                           },
                                           {
                                               "id": "b3541807672be040",
                                               "type": "comment",
                                               "z": "6e802f1553b18149",
                                               "name": "object",
                                               "info": "",
                                               "x": 1340,
                                               "y": 100,
                                               "wires": []
                                           },
                                           {
                                               "id": "a4d1a5d04564dc77",
                                               "type": "switch",
                                               "z": "6e802f1553b18149",
                                               "name": "is type?",
                                               "property": "payload",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "istype",
                                                       "v": "object",
                                                       "vt": "object"
                                                   },
                                                   {
                                                       "t": "istype",
                                                       "v": "array",
                                                       "vt": "array"
                                                   },
                                                   {
                                                       "t": "else"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 3,
                                               "x": 1160,
                                               "y": 280,
                                               "wires": [
                                                   [
                                                       "3e11e8338f694832"
                                                   ],
                                                   [
                                                       "bfce19b206660fbe"
                                                   ],
                                                   [
                                                       "a096a93bb82b7a93"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "74c895ce724750de",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "finalize msg.topic",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "top",
                                                       "pt": "msg",
                                                       "to": "top",
                                                       "tot": "env"
                                                   },
                                                   {
                                                       "t": "set",
                                                       "p": "top",
                                                       "pt": "msg",
                                                       "to": "'0_userdata.0.' & top",
                                                       "tot": "jsonata"
                                                   },
                                                   {
                                                       "t": "set",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "to": "top & '.' & topic",
                                                       "tot": "jsonata"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 2170,
                                               "y": 320,
                                               "wires": [
                                                   [
                                                       "0962842ebd23e0d7"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "554b8c663bcb46c2",
                                               "type": "switch",
                                               "z": "6e802f1553b18149",
                                               "name": "",
                                               "property": "keepTopic",
                                               "propertyType": "env",
                                               "rules": [
                                                   {
                                                       "t": "true"
                                                   },
                                                   {
                                                       "t": "false"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 2,
                                               "x": 170,
                                               "y": 160,
                                               "wires": [
                                                   [
                                                       "e30ba9f0483285e4"
                                                   ],
                                                   [
                                                       "e023fe88445ce43e"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "e30ba9f0483285e4",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "",
                                               "rules": [
                                                   {
                                                       "t": "change",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "from": "/",
                                                       "fromt": "str",
                                                       "to": ".",
                                                       "tot": "str"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 350,
                                               "y": 120,
                                               "wires": [
                                                   [
                                                       "3649300b4c233b10"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "0962842ebd23e0d7",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "translate invalid chars in topic",
                                               "rules": [
                                                   {
                                                       "t": "change",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "from": "..",
                                                       "fromt": "str",
                                                       "to": ".",
                                                       "tot": "str"
                                                   },
                                                   {
                                                       "t": "change",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "from": "€",
                                                       "fromt": "str",
                                                       "to": "EUR",
                                                       "tot": "str"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 2430,
                                               "y": 280,
                                               "wires": [
                                                   []
                                               ]
                                           },
                                           {
                                               "id": "9ac3cc3681e8b6c6",
                                               "type": "change",
                                               "z": "6e802f1553b18149",
                                               "name": "set topic, if empty",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "to": "topic ? topic : $type(payload)\t",
                                                       "tot": "jsonata"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 950,
                                               "y": 200,
                                               "wires": [
                                                   [
                                                       "a096a93bb82b7a93"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "fc7913a8524badb7",
                                               "type": "json",
                                               "z": "6e802f1553b18149",
                                               "name": "",
                                               "property": "payload",
                                               "action": "obj",
                                               "pretty": false,
                                               "x": 750,
                                               "y": 100,
                                               "wires": [
                                                   [
                                                       "d9e7bdd4c48a8aa1"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "d9e7bdd4c48a8aa1",
                                               "type": "switch",
                                               "z": "6e802f1553b18149",
                                               "name": "is type?",
                                               "property": "payload",
                                               "propertyType": "msg",
                                               "rules": [
                                                   {
                                                       "t": "istype",
                                                       "v": "array",
                                                       "vt": "array"
                                                   },
                                                   {
                                                       "t": "istype",
                                                       "v": "object",
                                                       "vt": "object"
                                                   },
                                                   {
                                                       "t": "else"
                                                   }
                                               ],
                                               "checkall": "true",
                                               "repair": false,
                                               "outputs": 3,
                                               "x": 900,
                                               "y": 100,
                                               "wires": [
                                                   [
                                                       "1520be42bcc2145e"
                                                   ],
                                                   [
                                                       "1520be42bcc2145e"
                                                   ],
                                                   [
                                                       "9ac3cc3681e8b6c6"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "a096a93bb82b7a93",
                                               "type": "junction",
                                               "z": "6e802f1553b18149",
                                               "x": 1380,
                                               "y": 280,
                                               "wires": [
                                                   [
                                                       "1a8c03d866b85b12"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "1520be42bcc2145e",
                                               "type": "junction",
                                               "z": "6e802f1553b18149",
                                               "x": 480,
                                               "y": 20,
                                               "wires": [
                                                   [
                                                       "3649300b4c233b10"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "ef7643b826aed308",
                                               "type": "subflow:6e802f1553b18149",
                                               "z": "1983aa28392732ca",
                                               "name": "",
                                               "env": [
                                                   {
                                                       "name": "top",
                                                       "value": "Sensor_903788",
                                                       "type": "str"
                                                   }
                                               ],
                                               "x": 550,
                                               "y": 2960,
                                               "wires": [
                                                   [
                                                       "2b9df08b75d20726"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "2b9df08b75d20726",
                                               "type": "ioBroker out",
                                               "z": "1983aa28392732ca",
                                               "name": "",
                                               "topic": "",
                                               "ack": "true",
                                               "autoCreate": "true",
                                               "stateName": "",
                                               "role": "",
                                               "payloadType": "",
                                               "readonly": "true",
                                               "stateUnit": "",
                                               "stateMin": "",
                                               "stateMax": "",
                                               "x": 780,
                                               "y": 2960,
                                               "wires": []
                                           }
                                        ]
                                        

                                        In der NodeRed Adapter konfig schauen, dass Fremdobjekte erstellt werden dürfen und die Konvertierung ausgeschaltet ist.

                                        cc96d5ff-99c1-49ae-b813-a0401695f6d1-image.png

                                        Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                                        1 1 Antwort Letzte Antwort
                                        0
                                        • mickymM mickym

                                          @1984chris Na OK - ich weiss nicht was Du da genau gemacht hast.

                                          Wie gesagt wenn Du meinen Flow importierst - habe ich gerade gemacht - dann erhälst Du folgende Struktur

                                          c6cd19df-a859-4e36-9534-ac1964a2e038-image.png

                                          Wenn Du mein Flow hast - dann brauchst Du nur die neue Node und eine iobroker-Out Node:

                                          355133c4-db41-47c4-b7d8-3ae44abb9fea-image.png

                                          wie gesagt die Fremdobjekte erstellen zulassen und in der Node angeben unter welchem Datenpunkt die Datenpunkte angelegt werden sollen:

                                          02dbccce-d95d-47e7-9cd5-e81cc697612a-image.png

                                          Hier zum Import:

                                          [
                                             {
                                                 "id": "6e802f1553b18149",
                                                 "type": "subflow",
                                                 "name": "JSON or Obj to IOBroker",
                                                 "info": "# Creates an IOBroker tree\n\nThis node creates an IOBroker tree out of an Java-Object or JSON String.\n\nThe object tree will be created under 0_userdata.0\nIn addition to the JSON-String or Java Object as `msg.payload` it is necessary to specify a `msg.top` properity in addition to the msg-Object.\n\nThe object tree will be created under 0_userdata.0\n\nExisting `msg.topic` entries will be deleted.\nAn iobroker-out node has to be appended to this subflow node. It is not part of the subflow itself. No topic should be specified in the iobroker out node.\n\nIs `msg.top` property isn't defined, the `top` property of the subflow-node is used. \n\nIn the properties of the subflow node a new property `keepTopic` has been added. Default is _false_ to keep the current behaviour. If set to _true_ then the originial topic will be placed between the `top` property of the subflow node and the property of the analyzed JSON object.\n\n**Attention:**\nIf msg.top and top is empty, all msg.topics (msg.topic) will be directly prefixed with 0_userdata.0. . \n\n**Update 13.09.2022:**\nSpaces in topics of objects are no longer replaced with underscores in objects. No differences between all data types.\n\n# Erstellt einen Objektbaum im ioBroker\n\nDiese Node erstellt einen Objektbaum im ioBroker aus einem JAVA Objekt bzw. einem JSON String. \n\nDer Baum wird in jedem Fall unter 0_userdata.0 erstellt und zwar unter dem Topic der in` msg.top` mitgegeben wurde. In der `msg.payload` befindet sich dann der JSON String oder das entsprechende Objekt.\n\nExistierende `msg.topic `Einträge werden gelöscht.\nEin entsprechende iobroker-out Node muss an den Flow angehängt werden. Sie ist nicht Bestandteil des Subflows. In dieser iobroker-out Node darf kein Topic angegeben werden. \n\nFalls msg.top nicht definiert wurde, wird der `top`-Wert der Subflow-Node verwendet.\n\nIn den Eigenschaften der Subflow-Node wurde ein neuer Parameter `keepTopic` hinzugefügt. Standardwert ist _false_, um das bisherige Verhalten beizubehalten. Setzt man die Eigenschaft auf _true_, dann wird das originale Topic zwischen der `top` Eigenschaft der Subflow-Node und Eigenschaft des analysierten JSON Objektes eingefügt.\n\n**Achtung:**\nWenn top und msg.top leer ist, werden alle msg.topics (msg.topic) direkt unter dem Präfix 0_userdata.0., angelegt bzw. ausgegeben. \n\n**Update 13.09.2022:**\nLeerzeichen werden in Topics von Objekten nicht mehr durch Unterstriche ersetzt. Es gibt keine Unterschiede mehr zwischen den Datentypen.",
                                                 "category": "",
                                                 "in": [
                                                     {
                                                         "x": 60,
                                                         "y": 160,
                                                         "wires": [
                                                             {
                                                                 "id": "554b8c663bcb46c2"
                                                             }
                                                         ]
                                                     }
                                                 ],
                                                 "out": [
                                                     {
                                                         "x": 2620,
                                                         "y": 280,
                                                         "wires": [
                                                             {
                                                                 "id": "0962842ebd23e0d7",
                                                                 "port": 0
                                                             }
                                                         ]
                                                     }
                                                 ],
                                                 "env": [
                                                     {
                                                         "name": "top",
                                                         "type": "str",
                                                         "value": "objRoot"
                                                     },
                                                     {
                                                         "name": "keepTopic",
                                                         "type": "bool",
                                                         "value": "false"
                                                     }
                                                 ],
                                                 "meta": {},
                                                 "color": "#E2D96E",
                                                 "icon": "node-red/batch.svg"
                                             },
                                             {
                                                 "id": "3e11e8338f694832",
                                                 "type": "split",
                                                 "z": "6e802f1553b18149",
                                                 "name": "split object",
                                                 "splt": "\\n",
                                                 "spltType": "str",
                                                 "arraySplt": 1,
                                                 "arraySpltType": "len",
                                                 "stream": false,
                                                 "addname": "key",
                                                 "x": 1370,
                                                 "y": 160,
                                                 "wires": [
                                                     [
                                                         "0562a4249c8b856b"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "0562a4249c8b856b",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "add key to topic",
                                                 "rules": [
                                                     {
                                                         "t": "set",
                                                         "p": "stateName",
                                                         "pt": "msg",
                                                         "to": "key",
                                                         "tot": "msg"
                                                     },
                                                     {
                                                         "t": "set",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "to": "topic  & '.' & key",
                                                         "tot": "jsonata"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 1560,
                                                 "y": 160,
                                                 "wires": [
                                                     [
                                                         "ddc90985bef0fafa"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "ddc90985bef0fafa",
                                                 "type": "switch",
                                                 "z": "6e802f1553b18149",
                                                 "name": "is type?",
                                                 "property": "payload",
                                                 "propertyType": "msg",
                                                 "rules": [
                                                     {
                                                         "t": "istype",
                                                         "v": "array",
                                                         "vt": "array"
                                                     },
                                                     {
                                                         "t": "istype",
                                                         "v": "object",
                                                         "vt": "object"
                                                     },
                                                     {
                                                         "t": "else"
                                                     }
                                                 ],
                                                 "checkall": "true",
                                                 "repair": false,
                                                 "outputs": 3,
                                                 "x": 1740,
                                                 "y": 160,
                                                 "wires": [
                                                     [
                                                         "bfce19b206660fbe"
                                                     ],
                                                     [
                                                         "3e11e8338f694832"
                                                     ],
                                                     [
                                                         "1a8c03d866b85b12"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "bfce19b206660fbe",
                                                 "type": "split",
                                                 "z": "6e802f1553b18149",
                                                 "name": "split array",
                                                 "splt": "\\n",
                                                 "spltType": "str",
                                                 "arraySplt": 1,
                                                 "arraySpltType": "len",
                                                 "stream": false,
                                                 "addname": "",
                                                 "x": 780,
                                                 "y": 280,
                                                 "wires": [
                                                     [
                                                         "e89927810c6d75ec"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "e89927810c6d75ec",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "add index to topic",
                                                 "rules": [
                                                     {
                                                         "t": "set",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "to": "topic  & '.' & parts.index",
                                                         "tot": "jsonata"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 970,
                                                 "y": 280,
                                                 "wires": [
                                                     [
                                                         "a4d1a5d04564dc77"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "f5d52c6a57d08904",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "finalize msg.topic",
                                                 "rules": [
                                                     {
                                                         "t": "set",
                                                         "p": "top",
                                                         "pt": "msg",
                                                         "to": "'0_userdata.0.' & top",
                                                         "tot": "jsonata"
                                                     },
                                                     {
                                                         "t": "set",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "to": "top & '.' & topic",
                                                         "tot": "jsonata"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 2170,
                                                 "y": 240,
                                                 "wires": [
                                                     [
                                                         "0962842ebd23e0d7"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "1a8c03d866b85b12",
                                                 "type": "switch",
                                                 "z": "6e802f1553b18149",
                                                 "name": "is msg.top != null",
                                                 "property": "top",
                                                 "propertyType": "msg",
                                                 "rules": [
                                                     {
                                                         "t": "nnull"
                                                     },
                                                     {
                                                         "t": "null"
                                                     }
                                                 ],
                                                 "checkall": "true",
                                                 "repair": false,
                                                 "outputs": 2,
                                                 "x": 1950,
                                                 "y": 280,
                                                 "wires": [
                                                     [
                                                         "f5d52c6a57d08904"
                                                     ],
                                                     [
                                                         "74c895ce724750de"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "e023fe88445ce43e",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "",
                                                 "rules": [
                                                     {
                                                         "t": "delete",
                                                         "p": "topic",
                                                         "pt": "msg"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 350,
                                                 "y": 200,
                                                 "wires": [
                                                     [
                                                         "3649300b4c233b10"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "3649300b4c233b10",
                                                 "type": "switch",
                                                 "z": "6e802f1553b18149",
                                                 "name": "is type?",
                                                 "property": "payload",
                                                 "propertyType": "msg",
                                                 "rules": [
                                                     {
                                                         "t": "istype",
                                                         "v": "json",
                                                         "vt": "json"
                                                     },
                                                     {
                                                         "t": "istype",
                                                         "v": "array",
                                                         "vt": "array"
                                                     },
                                                     {
                                                         "t": "istype",
                                                         "v": "object",
                                                         "vt": "object"
                                                     },
                                                     {
                                                         "t": "else"
                                                     }
                                                 ],
                                                 "checkall": "true",
                                                 "repair": false,
                                                 "outputs": 4,
                                                 "x": 600,
                                                 "y": 160,
                                                 "wires": [
                                                     [
                                                         "fc7913a8524badb7"
                                                     ],
                                                     [
                                                         "bfce19b206660fbe"
                                                     ],
                                                     [
                                                         "3e11e8338f694832"
                                                     ],
                                                     [
                                                         "9ac3cc3681e8b6c6"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "1b8480cd2df7ba3f",
                                                 "type": "comment",
                                                 "z": "6e802f1553b18149",
                                                 "name": "Array",
                                                 "info": "",
                                                 "x": 600,
                                                 "y": 280,
                                                 "wires": []
                                             },
                                             {
                                                 "id": "b3541807672be040",
                                                 "type": "comment",
                                                 "z": "6e802f1553b18149",
                                                 "name": "object",
                                                 "info": "",
                                                 "x": 1340,
                                                 "y": 100,
                                                 "wires": []
                                             },
                                             {
                                                 "id": "a4d1a5d04564dc77",
                                                 "type": "switch",
                                                 "z": "6e802f1553b18149",
                                                 "name": "is type?",
                                                 "property": "payload",
                                                 "propertyType": "msg",
                                                 "rules": [
                                                     {
                                                         "t": "istype",
                                                         "v": "object",
                                                         "vt": "object"
                                                     },
                                                     {
                                                         "t": "istype",
                                                         "v": "array",
                                                         "vt": "array"
                                                     },
                                                     {
                                                         "t": "else"
                                                     }
                                                 ],
                                                 "checkall": "true",
                                                 "repair": false,
                                                 "outputs": 3,
                                                 "x": 1160,
                                                 "y": 280,
                                                 "wires": [
                                                     [
                                                         "3e11e8338f694832"
                                                     ],
                                                     [
                                                         "bfce19b206660fbe"
                                                     ],
                                                     [
                                                         "a096a93bb82b7a93"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "74c895ce724750de",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "finalize msg.topic",
                                                 "rules": [
                                                     {
                                                         "t": "set",
                                                         "p": "top",
                                                         "pt": "msg",
                                                         "to": "top",
                                                         "tot": "env"
                                                     },
                                                     {
                                                         "t": "set",
                                                         "p": "top",
                                                         "pt": "msg",
                                                         "to": "'0_userdata.0.' & top",
                                                         "tot": "jsonata"
                                                     },
                                                     {
                                                         "t": "set",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "to": "top & '.' & topic",
                                                         "tot": "jsonata"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 2170,
                                                 "y": 320,
                                                 "wires": [
                                                     [
                                                         "0962842ebd23e0d7"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "554b8c663bcb46c2",
                                                 "type": "switch",
                                                 "z": "6e802f1553b18149",
                                                 "name": "",
                                                 "property": "keepTopic",
                                                 "propertyType": "env",
                                                 "rules": [
                                                     {
                                                         "t": "true"
                                                     },
                                                     {
                                                         "t": "false"
                                                     }
                                                 ],
                                                 "checkall": "true",
                                                 "repair": false,
                                                 "outputs": 2,
                                                 "x": 170,
                                                 "y": 160,
                                                 "wires": [
                                                     [
                                                         "e30ba9f0483285e4"
                                                     ],
                                                     [
                                                         "e023fe88445ce43e"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "e30ba9f0483285e4",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "",
                                                 "rules": [
                                                     {
                                                         "t": "change",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "from": "/",
                                                         "fromt": "str",
                                                         "to": ".",
                                                         "tot": "str"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 350,
                                                 "y": 120,
                                                 "wires": [
                                                     [
                                                         "3649300b4c233b10"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "0962842ebd23e0d7",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "translate invalid chars in topic",
                                                 "rules": [
                                                     {
                                                         "t": "change",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "from": "..",
                                                         "fromt": "str",
                                                         "to": ".",
                                                         "tot": "str"
                                                     },
                                                     {
                                                         "t": "change",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "from": "€",
                                                         "fromt": "str",
                                                         "to": "EUR",
                                                         "tot": "str"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 2430,
                                                 "y": 280,
                                                 "wires": [
                                                     []
                                                 ]
                                             },
                                             {
                                                 "id": "9ac3cc3681e8b6c6",
                                                 "type": "change",
                                                 "z": "6e802f1553b18149",
                                                 "name": "set topic, if empty",
                                                 "rules": [
                                                     {
                                                         "t": "set",
                                                         "p": "topic",
                                                         "pt": "msg",
                                                         "to": "topic ? topic : $type(payload)\t",
                                                         "tot": "jsonata"
                                                     }
                                                 ],
                                                 "action": "",
                                                 "property": "",
                                                 "from": "",
                                                 "to": "",
                                                 "reg": false,
                                                 "x": 950,
                                                 "y": 200,
                                                 "wires": [
                                                     [
                                                         "a096a93bb82b7a93"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "fc7913a8524badb7",
                                                 "type": "json",
                                                 "z": "6e802f1553b18149",
                                                 "name": "",
                                                 "property": "payload",
                                                 "action": "obj",
                                                 "pretty": false,
                                                 "x": 750,
                                                 "y": 100,
                                                 "wires": [
                                                     [
                                                         "d9e7bdd4c48a8aa1"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "d9e7bdd4c48a8aa1",
                                                 "type": "switch",
                                                 "z": "6e802f1553b18149",
                                                 "name": "is type?",
                                                 "property": "payload",
                                                 "propertyType": "msg",
                                                 "rules": [
                                                     {
                                                         "t": "istype",
                                                         "v": "array",
                                                         "vt": "array"
                                                     },
                                                     {
                                                         "t": "istype",
                                                         "v": "object",
                                                         "vt": "object"
                                                     },
                                                     {
                                                         "t": "else"
                                                     }
                                                 ],
                                                 "checkall": "true",
                                                 "repair": false,
                                                 "outputs": 3,
                                                 "x": 900,
                                                 "y": 100,
                                                 "wires": [
                                                     [
                                                         "1520be42bcc2145e"
                                                     ],
                                                     [
                                                         "1520be42bcc2145e"
                                                     ],
                                                     [
                                                         "9ac3cc3681e8b6c6"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "a096a93bb82b7a93",
                                                 "type": "junction",
                                                 "z": "6e802f1553b18149",
                                                 "x": 1380,
                                                 "y": 280,
                                                 "wires": [
                                                     [
                                                         "1a8c03d866b85b12"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "1520be42bcc2145e",
                                                 "type": "junction",
                                                 "z": "6e802f1553b18149",
                                                 "x": 480,
                                                 "y": 20,
                                                 "wires": [
                                                     [
                                                         "3649300b4c233b10"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "ef7643b826aed308",
                                                 "type": "subflow:6e802f1553b18149",
                                                 "z": "1983aa28392732ca",
                                                 "name": "",
                                                 "env": [
                                                     {
                                                         "name": "top",
                                                         "value": "Sensor_903788",
                                                         "type": "str"
                                                     }
                                                 ],
                                                 "x": 550,
                                                 "y": 2960,
                                                 "wires": [
                                                     [
                                                         "2b9df08b75d20726"
                                                     ]
                                                 ]
                                             },
                                             {
                                                 "id": "2b9df08b75d20726",
                                                 "type": "ioBroker out",
                                                 "z": "1983aa28392732ca",
                                                 "name": "",
                                                 "topic": "",
                                                 "ack": "true",
                                                 "autoCreate": "true",
                                                 "stateName": "",
                                                 "role": "",
                                                 "payloadType": "",
                                                 "readonly": "true",
                                                 "stateUnit": "",
                                                 "stateMin": "",
                                                 "stateMax": "",
                                                 "x": 780,
                                                 "y": 2960,
                                                 "wires": []
                                             }
                                          ]
                                          

                                          In der NodeRed Adapter konfig schauen, dass Fremdobjekte erstellt werden dürfen und die Konvertierung ausgeschaltet ist.

                                          cc96d5ff-99c1-49ae-b813-a0401695f6d1-image.png

                                          1 Offline
                                          1 Offline
                                          1984chris
                                          schrieb am zuletzt editiert von
                                          #37

                                          @mickym

                                          Bin blutiger Anfänger in NodeRed und habe keine Programierkenntnisse,hab mir gedacht das geht so einfach.

                                          mickymM 1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          857

                                          Online

                                          32.6k

                                          Benutzer

                                          81.9k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe