Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Gelöst: Wert in dynamische Struktur im ioBroker ablegen

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Gelöst: Wert in dynamische Struktur im ioBroker ablegen

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

      @martybr Also am elegantesten ist das Originaltopic zu nehmen - so würde ich das machen.

      1311054c-d897-4e52-b793-7dca79a2dfcf-image.png

      Variabel:

      1. Name des Datenpunkts nimmt das Originaltopic (schau, dass es nur ein Wort ist und ggf. entsprechend setzen)
        Wie gezeigt

      2. Basispfad variabel im Subflow definiert
        Den Basispfad nehme ich aus der Subflow Node - den kann man vorbelegen oder leer lassen - das ist dann der 2. Teil.

      b4e6080b-0ffa-4bcc-9326-fdd7ee74f46d-image.png

      Somit ergibt sich das topic aus
      4 Komponenten:
      996e17e5-b6ca-48be-ba41-14ebedfbdeb2-image.png

      1. Konstanter String: "0_userdata.0." (pink)
      2. Basispfad aus Subflow Node (gelb)
      3. Datum (hellblau)
      4. Originaltopic (grün)

      Hier zum Import:

      [
         {
             "id": "ae673cf6cd8433a0",
             "type": "subflow",
             "name": "Datum in Topic",
             "info": "",
             "category": "",
             "in": [
                 {
                     "x": 60,
                     "y": 80,
                     "wires": [
                         {
                             "id": "2e1ea06b2e94bf1a"
                         }
                     ]
                 }
             ],
             "out": [
                 {
                     "x": 820,
                     "y": 80,
                     "wires": [
                         {
                             "id": "fc37f5f9d2b0297b",
                             "port": 0
                         }
                     ]
                 }
             ],
             "env": [
                 {
                     "name": "basePath",
                     "type": "str",
                     "value": "Test1.Test2"
                 }
             ],
             "meta": {},
             "color": "#DDAA99"
         },
         {
             "id": "2e1ea06b2e94bf1a",
             "type": "change",
             "z": "ae673cf6cd8433a0",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "datum",
                     "pt": "msg",
                     "to": "$moment().locale('de').format('YYYY.MMMM')",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 230,
             "y": 80,
             "wires": [
                 [
                     "0e8de9437c3c420a"
                 ]
             ]
         },
         {
             "id": "0e8de9437c3c420a",
             "type": "change",
             "z": "ae673cf6cd8433a0",
             "name": "März zu Maerz",
             "rules": [
                 {
                     "t": "change",
                     "p": "datum",
                     "pt": "msg",
                     "from": "März",
                     "fromt": "str",
                     "to": "Maerz",
                     "tot": "str"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 440,
             "y": 80,
             "wires": [
                 [
                     "fc37f5f9d2b0297b"
                 ]
             ]
         },
         {
             "id": "fc37f5f9d2b0297b",
             "type": "change",
             "z": "ae673cf6cd8433a0",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "topic",
                     "pt": "msg",
                     "to": "\"0_userdata.0.\"  & $env(\"basePath\") & \".\" & datum & \".\" & topic",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 660,
             "y": 80,
             "wires": [
                 []
             ]
         },
         {
             "id": "e4826cebe9af4d64",
             "type": "debug",
             "z": "7e6af0015415146d",
             "name": "payload und topic",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 730,
             "y": 7000,
             "wires": []
         },
         {
             "id": "b34e855ab239acc1",
             "type": "ioBroker out",
             "z": "7e6af0015415146d",
             "d": true,
             "name": "",
             "topic": "",
             "ack": "true",
             "autoCreate": "true",
             "stateName": "zuluft-neu",
             "role": "state",
             "payloadType": "",
             "readonly": "",
             "stateUnit": "°C",
             "stateMin": "",
             "stateMax": "",
             "x": 760,
             "y": 7060,
             "wires": []
         },
         {
             "id": "1bf960b96de7a57f",
             "type": "mqtt in",
             "z": "7e6af0015415146d",
             "d": true,
             "name": "Vitovent ZuluftTemp",
             "topic": "vitocal/ZuluftTemp",
             "qos": "0",
             "datatype": "auto-detect",
             "broker": "bcf16446273a18e6",
             "nl": false,
             "rap": true,
             "rh": 0,
             "inputs": 0,
             "x": 170,
             "y": 7000,
             "wires": [
                 [
                     "5267d5edc8abe331"
                 ]
             ]
         },
         {
             "id": "8822fc4aa38c0a6f",
             "type": "inject",
             "z": "7e6af0015415146d",
             "name": "",
             "props": [
                 {
                     "p": "payload"
                 },
                 {
                     "p": "topic",
                     "vt": "str"
                 }
             ],
             "repeat": "",
             "crontab": "",
             "once": false,
             "onceDelay": 0.1,
             "topic": "ZuluftTemp",
             "payload": "20",
             "payloadType": "num",
             "x": 210,
             "y": 6960,
             "wires": [
                 [
                     "5267d5edc8abe331"
                 ]
             ]
         },
         {
             "id": "5267d5edc8abe331",
             "type": "subflow:ae673cf6cd8433a0",
             "z": "7e6af0015415146d",
             "name": "Datum in Topic",
             "x": 480,
             "y": 7000,
             "wires": [
                 [
                     "b34e855ab239acc1",
                     "e4826cebe9af4d64"
                 ]
             ]
         },
         {
             "id": "bcf16446273a18e6",
             "type": "mqtt-broker",
             "name": "Mosquito",
             "broker": "192.168.178.10",
             "port": 1883,
             "clientid": "",
             "autoConnect": true,
             "usetls": false,
             "protocolVersion": 4,
             "keepalive": 60,
             "cleansession": true,
             "autoUnsubscribe": true,
             "birthTopic": "",
             "birthQos": "0",
             "birthRetain": "false",
             "birthPayload": "",
             "birthMsg": {},
             "closeTopic": "",
             "closeQos": "0",
             "closeRetain": "false",
             "closePayload": "",
             "closeMsg": {},
             "willTopic": "",
             "willQos": "0",
             "willRetain": "false",
             "willPayload": "",
             "willMsg": {},
             "userProps": "",
             "sessionExpiry": ""
         }
      ]
      

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

        @mickym
        Ich habe es mal so gemacht:
        Bildschirmfoto 2025-02-06 um 16.31.02.png

        [
            {
                "id": "7e0364b0b8f9043e",
                "type": "mqtt in",
                "z": "71de45f27137890c",
                "name": "Vitovent ZuluftTemp",
                "topic": "vitocal/ZuluftTemp",
                "qos": "0",
                "datatype": "auto-detect",
                "broker": "bf311140.13d2b8",
                "nl": false,
                "rap": true,
                "rh": 0,
                "inputs": 0,
                "x": 110,
                "y": 80,
                "wires": [
                    [
                        "f9c4e37a0e08b272"
                    ]
                ]
            },
            {
                "id": "f9c4e37a0e08b272",
                "type": "change",
                "z": "71de45f27137890c",
                "name": "",
                "rules": [
                    {
                        "t": "set",
                        "p": "datum",
                        "pt": "msg",
                        "to": "$moment().locale('de').format('YYYY.MMMM')",
                        "tot": "jsonata"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 330,
                "y": 80,
                "wires": [
                    [
                        "4b7e157254dd9a42"
                    ]
                ]
            },
            {
                "id": "4b7e157254dd9a42",
                "type": "change",
                "z": "71de45f27137890c",
                "name": "März zu Maerz",
                "rules": [
                    {
                        "t": "change",
                        "p": "datum",
                        "pt": "msg",
                        "from": "März",
                        "fromt": "str",
                        "to": "Maerz",
                        "tot": "str"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 540,
                "y": 80,
                "wires": [
                    [
                        "db5352ef5569bd02"
                    ]
                ]
            },
            {
                "id": "db5352ef5569bd02",
                "type": "change",
                "z": "71de45f27137890c",
                "name": "",
                "rules": [
                    {
                        "t": "set",
                        "p": "topic",
                        "pt": "msg",
                        "to": "\"0_userdata.0.Test1.Test2.\" & datum & \".\"",
                        "tot": "jsonata"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 740,
                "y": 80,
                "wires": [
                    [
                        "5f919db0295bc25c",
                        "9795ea0c497cd9c7"
                    ]
                ]
            },
            {
                "id": "5f919db0295bc25c",
                "type": "debug",
                "z": "71de45f27137890c",
                "name": "topic",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "payload",
                "targetType": "msg",
                "statusVal": "",
                "statusType": "auto",
                "x": 730,
                "y": 20,
                "wires": []
            },
            {
                "id": "9795ea0c497cd9c7",
                "type": "change",
                "z": "71de45f27137890c",
                "name": "Variable",
                "rules": [
                    {
                        "t": "set",
                        "p": "topic",
                        "pt": "msg",
                        "to": "topic & \"zuluft-ganzneu\"",
                        "tot": "jsonata"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 920,
                "y": 80,
                "wires": [
                    [
                        "f0dd9b6950d71727",
                        "5ce63ee6255c1fd2"
                    ]
                ]
            },
            {
                "id": "5ce63ee6255c1fd2",
                "type": "debug",
                "z": "71de45f27137890c",
                "name": "topic2",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "payload",
                "targetType": "msg",
                "statusVal": "",
                "statusType": "auto",
                "x": 1110,
                "y": 20,
                "wires": []
            },
            {
                "id": "f0dd9b6950d71727",
                "type": "ioBroker out",
                "z": "71de45f27137890c",
                "name": "",
                "topic": "",
                "ack": "true",
                "autoCreate": "true",
                "stateName": "zuluft-neu",
                "role": "state",
                "payloadType": "",
                "readonly": "",
                "stateUnit": "°C",
                "stateMin": "",
                "stateMax": "",
                "x": 1140,
                "y": 80,
                "wires": []
            },
            {
                "id": "bf311140.13d2b8",
                "type": "mqtt-broker",
                "name": "Mosquito-Server",
                "broker": "192.168.178.10",
                "port": "1883",
                "clientid": "",
                "autoConnect": true,
                "usetls": false,
                "compatmode": false,
                "protocolVersion": "4",
                "keepalive": "60",
                "cleansession": true,
                "autoUnsubscribe": true,
                "birthTopic": "",
                "birthQos": "0",
                "birthPayload": "",
                "birthMsg": {},
                "closeTopic": "",
                "closeQos": "0",
                "closePayload": "",
                "closeMsg": {},
                "willTopic": "",
                "willQos": "0",
                "willPayload": "",
                "willMsg": {},
                "userProps": "",
                "sessionExpiry": ""
            }
        ]
        

        Die würde dann die ersten drei Chane Nodes in den Subflow speichern.
        Besteht eine Möglichkeit, den Change Node Variable irgendwo nachvollziehbar abzulegen?

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

          @martybr Ich habe Dir doch gerade einen neuen Subflow geschickt - schau Dir den lieber mal an - das was Du gemacht hast, das funktioniert nicht. - Wie gesagt ich habe jetzt das Originaltopic genommen und einen variablen Basispfad über eine Variable, um es Dir zu zeigen. Du kannst natürlich auch noch weitere Variablen im Subflow nutzen - aber wie gesagt, das Originaltopic ist besser - weil Du dann auch mit EINER Subflow-Node viele Datenpunkte schreiben kannst.

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

            @mickym
            Habe ich zu spät gesehen. Dein Flow funktioniert perfekt, ich habe nur einen Change nach dem MQTT gesetzt, da dieser einen hierarchischen DP erzeugt (..virocal/zuluft)

            Nun funktioniert es perfekt. Vielen Dank. Jetzt habe ich das System der Variablen verstanden. Ich muss mir trotzdem das Konzept hinter env(basePath) anschauen.

            Hier mein/unser Ergebnis:
            Bildschirmfoto 2025-02-06 um 16.46.31.png

            [
                {
                    "id": "ae673cf6cd8433a0",
                    "type": "subflow",
                    "name": "Datum in Topic",
                    "info": "",
                    "category": "",
                    "in": [
                        {
                            "x": 60,
                            "y": 80,
                            "wires": [
                                {
                                    "id": "2e1ea06b2e94bf1a"
                                }
                            ]
                        }
                    ],
                    "out": [
                        {
                            "x": 820,
                            "y": 80,
                            "wires": [
                                {
                                    "id": "fc37f5f9d2b0297b",
                                    "port": 0
                                }
                            ]
                        }
                    ],
                    "env": [
                        {
                            "name": "basePath",
                            "type": "str",
                            "value": "Test1.Test2"
                        }
                    ],
                    "meta": {},
                    "color": "#DDAA99"
                },
                {
                    "id": "2e1ea06b2e94bf1a",
                    "type": "change",
                    "z": "ae673cf6cd8433a0",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "datum",
                            "pt": "msg",
                            "to": "$moment().locale('de').format('YYYY.MMMM')",
                            "tot": "jsonata"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 230,
                    "y": 80,
                    "wires": [
                        [
                            "0e8de9437c3c420a"
                        ]
                    ]
                },
                {
                    "id": "0e8de9437c3c420a",
                    "type": "change",
                    "z": "ae673cf6cd8433a0",
                    "name": "März zu Maerz",
                    "rules": [
                        {
                            "t": "change",
                            "p": "datum",
                            "pt": "msg",
                            "from": "März",
                            "fromt": "str",
                            "to": "Maerz",
                            "tot": "str"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 440,
                    "y": 80,
                    "wires": [
                        [
                            "fc37f5f9d2b0297b"
                        ]
                    ]
                },
                {
                    "id": "fc37f5f9d2b0297b",
                    "type": "change",
                    "z": "ae673cf6cd8433a0",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "topic",
                            "pt": "msg",
                            "to": "\"0_userdata.0.\"  & $env(\"basePath\") & \".\" & datum & \".\" & topic",
                            "tot": "jsonata"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 660,
                    "y": 80,
                    "wires": [
                        []
                    ]
                },
                {
                    "id": "71de45f27137890c",
                    "type": "tab",
                    "label": "Datum",
                    "disabled": false,
                    "info": "",
                    "env": []
                },
                {
                    "id": "f0dd9b6950d71727",
                    "type": "ioBroker out",
                    "z": "71de45f27137890c",
                    "name": "",
                    "topic": "",
                    "ack": "true",
                    "autoCreate": "true",
                    "stateName": "zuluft-neu",
                    "role": "state",
                    "payloadType": "",
                    "readonly": "",
                    "stateUnit": "°C",
                    "stateMin": "",
                    "stateMax": "",
                    "x": 720,
                    "y": 80,
                    "wires": []
                },
                {
                    "id": "7e0364b0b8f9043e",
                    "type": "mqtt in",
                    "z": "71de45f27137890c",
                    "name": "Vitovent ZuluftTemp",
                    "topic": "vitocal/ZuluftTemp",
                    "qos": "0",
                    "datatype": "auto-detect",
                    "broker": "bf311140.13d2b8",
                    "nl": false,
                    "rap": true,
                    "rh": 0,
                    "inputs": 0,
                    "x": 110,
                    "y": 80,
                    "wires": [
                        [
                            "90912a5dffeb17cc"
                        ]
                    ]
                },
                {
                    "id": "e4826cebe9af4d64",
                    "type": "debug",
                    "z": "71de45f27137890c",
                    "name": "payload und topic",
                    "active": true,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": false,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "",
                    "statusType": "auto",
                    "x": 510,
                    "y": 20,
                    "wires": []
                },
                {
                    "id": "5267d5edc8abe331",
                    "type": "subflow:ae673cf6cd8433a0",
                    "z": "71de45f27137890c",
                    "name": "Datum in Topic",
                    "env": [
                        {
                            "name": "basePath",
                            "value": "Test1.Test5",
                            "type": "str"
                        }
                    ],
                    "x": 520,
                    "y": 80,
                    "wires": [
                        [
                            "e4826cebe9af4d64",
                            "f0dd9b6950d71727"
                        ]
                    ]
                },
                {
                    "id": "90912a5dffeb17cc",
                    "type": "change",
                    "z": "71de45f27137890c",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "topic",
                            "pt": "msg",
                            "to": "Zuluft-Temp",
                            "tot": "str"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 320,
                    "y": 80,
                    "wires": [
                        [
                            "5267d5edc8abe331",
                            "527e1cef1285c117"
                        ]
                    ]
                },
                {
                    "id": "527e1cef1285c117",
                    "type": "debug",
                    "z": "71de45f27137890c",
                    "name": "payload und topic",
                    "active": true,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": false,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "",
                    "statusType": "auto",
                    "x": 270,
                    "y": 20,
                    "wires": []
                },
                {
                    "id": "bf311140.13d2b8",
                    "type": "mqtt-broker",
                    "name": "Mosquito-Server",
                    "broker": "192.168.178.10",
                    "port": "1883",
                    "clientid": "",
                    "autoConnect": true,
                    "usetls": false,
                    "compatmode": false,
                    "protocolVersion": "4",
                    "keepalive": "60",
                    "cleansession": true,
                    "autoUnsubscribe": true,
                    "birthTopic": "",
                    "birthQos": "0",
                    "birthPayload": "",
                    "birthMsg": {},
                    "closeTopic": "",
                    "closeQos": "0",
                    "closePayload": "",
                    "closeMsg": {},
                    "willTopic": "",
                    "willQos": "0",
                    "willPayload": "",
                    "willMsg": {},
                    "userProps": "",
                    "sessionExpiry": ""
                }
            ]
            
            mickym 1 Reply Last reply Reply Quote 1
            • mickym
              mickym Most Active @MartyBr last edited by

              @martybr sagte in Wert in dynamische Struktur im ioBroker ablegen:

              Jetzt habe ich das System der Variablen verstanden. Ich muss mir trotzdem das Konzept hinter env(basePath) anschauen.

              Wie gesagt - hast Du ja super gemacht - kannst Du nun mit dem topic mehrere datenpunkte und oder sogar Hierarchien erzeugen.

              So habe ich ja auch meinen Subflow erzeugt mit dem Du ganze JSONS oder Bäume in iobroker Einzelwerte zerlegen kannst.

              Die Variablen in einer Subflow - gelten nur für diese Instanz - so kannst Du also eine ganze Menge in einer Instanz eines Subflows parametrisieren.

              Schau Dir mal meinen Subflow an, der JSONS oder ganze Bäume in Einzelwerte zerlegt:

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

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

                @mickym
                Jetzt bin auf den Geschmack gekommen. Ich habe jetzt versucht, einen JSON-Datenpunkt anzulegen. Das sieht auf dem ersten Blick auch gut aus. In kann aber im Objektbaum ioBroker die Daten nicht öffnen bzw. bearbeiten.

                Hier mal die Infos:
                Bildschirmfoto 2025-02-06 um 17.19.28.png

                Datensatz:
                Bildschirmfoto 2025-02-06 um 17.18.52.png

                Flow:

                [
                    {
                        "id": "ae673cf6cd8433a0",
                        "type": "subflow",
                        "name": "Datum in Topic",
                        "info": "",
                        "category": "",
                        "in": [
                            {
                                "x": 60,
                                "y": 80,
                                "wires": [
                                    {
                                        "id": "2e1ea06b2e94bf1a"
                                    }
                                ]
                            }
                        ],
                        "out": [
                            {
                                "x": 820,
                                "y": 80,
                                "wires": [
                                    {
                                        "id": "fc37f5f9d2b0297b",
                                        "port": 0
                                    }
                                ]
                            }
                        ],
                        "env": [
                            {
                                "name": "basePath",
                                "type": "str",
                                "value": "Test1.Test2"
                            }
                        ],
                        "meta": {},
                        "color": "#DDAA99"
                    },
                    {
                        "id": "2e1ea06b2e94bf1a",
                        "type": "change",
                        "z": "ae673cf6cd8433a0",
                        "name": "",
                        "rules": [
                            {
                                "t": "set",
                                "p": "datum",
                                "pt": "msg",
                                "to": "$moment().locale('de').format('YYYY.MMMM')",
                                "tot": "jsonata"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 230,
                        "y": 80,
                        "wires": [
                            [
                                "0e8de9437c3c420a"
                            ]
                        ]
                    },
                    {
                        "id": "0e8de9437c3c420a",
                        "type": "change",
                        "z": "ae673cf6cd8433a0",
                        "name": "März zu Maerz",
                        "rules": [
                            {
                                "t": "change",
                                "p": "datum",
                                "pt": "msg",
                                "from": "März",
                                "fromt": "str",
                                "to": "Maerz",
                                "tot": "str"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 440,
                        "y": 80,
                        "wires": [
                            [
                                "fc37f5f9d2b0297b"
                            ]
                        ]
                    },
                    {
                        "id": "fc37f5f9d2b0297b",
                        "type": "change",
                        "z": "ae673cf6cd8433a0",
                        "name": "",
                        "rules": [
                            {
                                "t": "set",
                                "p": "topic",
                                "pt": "msg",
                                "to": "\"0_userdata.0.\"  & $env(\"basePath\") & \".\" & datum & \".\" & topic",
                                "tot": "jsonata"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 660,
                        "y": 80,
                        "wires": [
                            []
                        ]
                    },
                    {
                        "id": "fad92726ff7c3254",
                        "type": "tab",
                        "label": "JSON",
                        "disabled": false,
                        "info": "",
                        "env": []
                    },
                    {
                        "id": "29a754f2b7a96a31",
                        "type": "mqtt in",
                        "z": "fad92726ff7c3254",
                        "name": "ZuluftTemp",
                        "topic": "vitocal/ZuluftTemp",
                        "qos": "0",
                        "datatype": "auto-detect",
                        "broker": "bf311140.13d2b8",
                        "nl": false,
                        "rap": true,
                        "rh": 0,
                        "inputs": 0,
                        "x": 100,
                        "y": 120,
                        "wires": [
                            [
                                "5026b4d763ed7dcc"
                            ]
                        ]
                    },
                    {
                        "id": "535565225c8e6f99",
                        "type": "subflow:ae673cf6cd8433a0",
                        "z": "fad92726ff7c3254",
                        "name": "Datum in Topic",
                        "env": [
                            {
                                "name": "basePath",
                                "value": "Test1.Test7",
                                "type": "str"
                            }
                        ],
                        "x": 780,
                        "y": 180,
                        "wires": [
                            [
                                "05ad3c7ae6fe582b",
                                "9c9e217c842acefc"
                            ]
                        ]
                    },
                    {
                        "id": "05ad3c7ae6fe582b",
                        "type": "ioBroker out",
                        "z": "fad92726ff7c3254",
                        "name": "",
                        "topic": "",
                        "ack": "true",
                        "autoCreate": "true",
                        "stateName": "zuluft-neu",
                        "role": "state",
                        "payloadType": "object",
                        "readonly": "",
                        "stateUnit": "°C",
                        "stateMin": "",
                        "stateMax": "",
                        "x": 980,
                        "y": 180,
                        "wires": []
                    },
                    {
                        "id": "5026b4d763ed7dcc",
                        "type": "change",
                        "z": "fad92726ff7c3254",
                        "name": "Zuluft",
                        "rules": [
                            {
                                "t": "set",
                                "p": "topic",
                                "pt": "msg",
                                "to": "Zuluft-Temp",
                                "tot": "str"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 310,
                        "y": 120,
                        "wires": [
                            [
                                "766be49e74305196"
                            ]
                        ]
                    },
                    {
                        "id": "a3c1535e1da94552",
                        "type": "mqtt in",
                        "z": "fad92726ff7c3254",
                        "name": "AbluftTemp",
                        "topic": "vitocal/AbluftTemp",
                        "qos": "0",
                        "datatype": "auto-detect",
                        "broker": "bf311140.13d2b8",
                        "nl": false,
                        "rap": true,
                        "rh": 0,
                        "inputs": 0,
                        "x": 110,
                        "y": 240,
                        "wires": [
                            [
                                "225419c87f910c3e"
                            ]
                        ]
                    },
                    {
                        "id": "225419c87f910c3e",
                        "type": "change",
                        "z": "fad92726ff7c3254",
                        "name": "Abluft",
                        "rules": [
                            {
                                "t": "set",
                                "p": "topic",
                                "pt": "msg",
                                "to": "Abluft-Temp",
                                "tot": "str"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 310,
                        "y": 240,
                        "wires": [
                            [
                                "766be49e74305196"
                            ]
                        ]
                    },
                    {
                        "id": "766be49e74305196",
                        "type": "join",
                        "z": "fad92726ff7c3254",
                        "name": "",
                        "mode": "custom",
                        "build": "object",
                        "property": "payload",
                        "propertyType": "msg",
                        "key": "topic",
                        "joiner": "\\n",
                        "joinerType": "str",
                        "accumulate": true,
                        "timeout": "60",
                        "count": "2",
                        "reduceRight": false,
                        "reduceExp": "",
                        "reduceInit": "",
                        "reduceInitType": "",
                        "reduceFixup": "",
                        "x": 430,
                        "y": 180,
                        "wires": [
                            [
                                "dd61fc92c8961b14",
                                "457c8ae43cf33de1"
                            ]
                        ]
                    },
                    {
                        "id": "224380ff0709c559",
                        "type": "json",
                        "z": "fad92726ff7c3254",
                        "name": "",
                        "property": "payload",
                        "action": "",
                        "pretty": true,
                        "x": 610,
                        "y": 180,
                        "wires": [
                            [
                                "c828c8f4b32a9c0c",
                                "535565225c8e6f99"
                            ]
                        ]
                    },
                    {
                        "id": "dd61fc92c8961b14",
                        "type": "debug",
                        "z": "fad92726ff7c3254",
                        "name": "debug 174",
                        "active": true,
                        "tosidebar": true,
                        "console": false,
                        "tostatus": false,
                        "complete": "false",
                        "statusVal": "",
                        "statusType": "auto",
                        "x": 510,
                        "y": 80,
                        "wires": []
                    },
                    {
                        "id": "c828c8f4b32a9c0c",
                        "type": "debug",
                        "z": "fad92726ff7c3254",
                        "name": "debug 175",
                        "active": true,
                        "tosidebar": true,
                        "console": false,
                        "tostatus": false,
                        "complete": "false",
                        "statusVal": "",
                        "statusType": "auto",
                        "x": 710,
                        "y": 100,
                        "wires": []
                    },
                    {
                        "id": "9c9e217c842acefc",
                        "type": "debug",
                        "z": "fad92726ff7c3254",
                        "name": "debug 176",
                        "active": true,
                        "tosidebar": true,
                        "console": false,
                        "tostatus": false,
                        "complete": "false",
                        "statusVal": "",
                        "statusType": "auto",
                        "x": 950,
                        "y": 100,
                        "wires": []
                    },
                    {
                        "id": "457c8ae43cf33de1",
                        "type": "change",
                        "z": "fad92726ff7c3254",
                        "name": "",
                        "rules": [
                            {
                                "t": "set",
                                "p": "topic",
                                "pt": "msg",
                                "to": "vitovent300",
                                "tot": "str"
                            }
                        ],
                        "action": "",
                        "property": "",
                        "from": "",
                        "to": "",
                        "reg": false,
                        "x": 540,
                        "y": 300,
                        "wires": [
                            [
                                "224380ff0709c559",
                                "f92533e2c4de9cf4"
                            ]
                        ]
                    },
                    {
                        "id": "f92533e2c4de9cf4",
                        "type": "debug",
                        "z": "fad92726ff7c3254",
                        "name": "debug 177",
                        "active": true,
                        "tosidebar": true,
                        "console": false,
                        "tostatus": false,
                        "complete": "false",
                        "statusVal": "",
                        "statusType": "auto",
                        "x": 730,
                        "y": 360,
                        "wires": []
                    },
                    {
                        "id": "bf311140.13d2b8",
                        "type": "mqtt-broker",
                        "name": "Mosquito-Server",
                        "broker": "192.168.178.10",
                        "port": "1883",
                        "clientid": "",
                        "autoConnect": true,
                        "usetls": false,
                        "compatmode": false,
                        "protocolVersion": "4",
                        "keepalive": "60",
                        "cleansession": true,
                        "autoUnsubscribe": true,
                        "birthTopic": "",
                        "birthQos": "0",
                        "birthPayload": "",
                        "birthMsg": {},
                        "closeTopic": "",
                        "closeQos": "0",
                        "closePayload": "",
                        "closeMsg": {},
                        "willTopic": "",
                        "willQos": "0",
                        "willPayload": "",
                        "willMsg": {},
                        "userProps": "",
                        "sessionExpiry": ""
                    }
                ]
                

                Müssen evtl eckige Klammern um den Jason gesetzt werden (also [json]?

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

                  @martybr Na den Datenpunkt hast Du wahrscheinlich schreibgeschützt angelegt - siehst Du doch an dem Schloss. Musst Du wahrscheinlich beschreibbar machen, in der iobroker-Out Node. Oder im Nachhinein in den Objekteigenschaften des Datenpunktes.

                  965e3392-0f00-447f-a1e0-d807ba8dfa3f-image.png

                  Ausserdem empfehle ich Dir - keinen Datentyp festzulegen - das macht die NOde selbst und wie gesagt musst Du es beschreibbar anlegen.

                  b2ed9541-fad8-4875-b40a-7cfb190aa439-image.png

                  Ja und wie gesagt - Objekte muss man als Strings - also JSON Strings schreiben und auch wieder in Objekte wandeln.
                  iobroker kann nur Strings in den States verarbeiten.

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

                    @martybr Es geht auch als Objekt zu öffnen - aber muss halt beschreibbar sein.

                    d2c9f560-51b8-4568-9b0e-935c61219b96-image.png

                    Und wenn Du es nicht als Objekt, sondern richtig als String festlegst (wie gesagt normalerweise legt man nichts fest, dann wird automatisch der richtige Typ festgelegt), dann macht er auch einen JSON daraus:

                    a9609a2a-49d9-42e3-9efe-ba1ce6b0400b-image.png

                    Grundsätzlich würde ich mir übrigens angewöhnen, die JSON Node immer direkt vor die Ausgabe in die iobroker-out -Node zu machen, damit man solange wie möglich mit Objekten arbeiten kann.

                    M 2 Replies Last reply Reply Quote 0
                    • M
                      MartyBr @mickym last edited by

                      @mickym
                      Okay, setze ich um.

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

                        @mickym
                        Funktioniert jetzt.
                        Hast du noch eine Idee wie ich die eckigen Klammern um den Datensatz setzen kann? Mit einem Change-Node?

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

                          @martybr Eckige Klammern sind ein Array oder in Blockly Chargon eine Liste - Ja Du kannst einfach ein Array mit eckigen Klammern daraus machen - macht aber nur Sinn, wenn Du dann mehrere Objekte im Array hast.

                          Selbstverstöndlich kannst Du ein Objekt in ein Array stellen. Wenn Du aber mehrere Objekte in ein Array machen mächtest, dann nutze die $append Funktion.

                          9cabe9d2-053d-41f0-8c6a-340d46af5b84-image.png

                          Du solltest Dir angewöhnen - nie KLammern zu bezeichen, sondern was für Objekte Du erstellen möchtest.

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

                            @mickym
                            Okay. das ist mein Ziel. Ich möchte Tageswerte in ein Monatsarray speichern. Das mit den Klammern hat funktioniert.
                            Über Arrays muss ich mich erst kundig machen.

                            Ziel ist, um 00:00 Uhr generierte Werte in ein Monatsarray zu speichern.

                            Ich bereite mal einen Versuch vor.

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

                              @martybr Dann nimm die $append Funktion

                              06bdd31e-3a0b-46aa-a49c-71bc0ec14d06-image.png

                              Hier zum Ausprobieren:

                              [
                                 {
                                     "id": "1db807e2530b5198",
                                     "type": "change",
                                     "z": "7e6af0015415146d",
                                     "name": "Vorhandenes Array",
                                     "rules": [
                                         {
                                             "t": "set",
                                             "p": "array",
                                             "pt": "msg",
                                             "to": "[{\"Zuluft-Temp\":20.1,\"Abluft-Temp\":20.9},{\"Zuluft-Temp\":21.1,\"Abluft-Temp\":22.9}]",
                                             "tot": "json"
                                         }
                                     ],
                                     "action": "",
                                     "property": "",
                                     "from": "",
                                     "to": "",
                                     "reg": false,
                                     "x": 410,
                                     "y": 6500,
                                     "wires": [
                                         [
                                             "16c668ac241e55c4"
                                         ]
                                     ]
                                 },
                                 {
                                     "id": "86b4268438857773",
                                     "type": "inject",
                                     "z": "7e6af0015415146d",
                                     "name": "Einzelnes Objekt",
                                     "props": [
                                         {
                                             "p": "payload"
                                         }
                                     ],
                                     "repeat": "",
                                     "crontab": "",
                                     "once": false,
                                     "onceDelay": 0.1,
                                     "topic": "",
                                     "payload": "{     \"Zuluft-Temp\": 20.1,     \"Abluft-Temp\": 20.9 }",
                                     "payloadType": "json",
                                     "x": 180,
                                     "y": 6500,
                                     "wires": [
                                         [
                                             "1db807e2530b5198"
                                         ]
                                     ]
                                 },
                                 {
                                     "id": "16c668ac241e55c4",
                                     "type": "change",
                                     "z": "7e6af0015415146d",
                                     "name": "",
                                     "rules": [
                                         {
                                             "t": "set",
                                             "p": "payload",
                                             "pt": "msg",
                                             "to": "$append(array, payload)",
                                             "tot": "jsonata"
                                         }
                                     ],
                                     "action": "",
                                     "property": "",
                                     "from": "",
                                     "to": "",
                                     "reg": false,
                                     "x": 630,
                                     "y": 6500,
                                     "wires": [
                                         [
                                             "c9cfdb97d8474804"
                                         ]
                                     ]
                                 },
                                 {
                                     "id": "c9cfdb97d8474804",
                                     "type": "debug",
                                     "z": "7e6af0015415146d",
                                     "name": "Neues Array",
                                     "active": true,
                                     "tosidebar": true,
                                     "console": false,
                                     "tostatus": false,
                                     "complete": "payload",
                                     "targetType": "msg",
                                     "statusVal": "",
                                     "statusType": "auto",
                                     "x": 850,
                                     "y": 6500,
                                     "wires": []
                                 }
                              ]
                              

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

                                @mickym
                                das Array wird nach meinem Test nicht aufgefüllt, es bleibt immer nur ein Wert im Array.
                                Die $append scheint nicht zu wirken.

                                Bildschirmfoto 2025-02-06 um 21.08.05.png

                                [
                                    {
                                        "id": "a0d8740faea1647b",
                                        "type": "mqtt in",
                                        "z": "5c488c180ba51f18",
                                        "name": "ZuluftTemp",
                                        "topic": "vitocal/ZuluftTemp",
                                        "qos": "0",
                                        "datatype": "auto-detect",
                                        "broker": "bf311140.13d2b8",
                                        "nl": false,
                                        "rap": true,
                                        "rh": 0,
                                        "inputs": 0,
                                        "x": 140,
                                        "y": 260,
                                        "wires": [
                                            [
                                                "afdcb37ccbacb06f"
                                            ]
                                        ]
                                    },
                                    {
                                        "id": "afdcb37ccbacb06f",
                                        "type": "change",
                                        "z": "5c488c180ba51f18",
                                        "name": "Zuluft",
                                        "rules": [
                                            {
                                                "t": "set",
                                                "p": "topic",
                                                "pt": "msg",
                                                "to": "zuluft",
                                                "tot": "str"
                                            }
                                        ],
                                        "action": "",
                                        "property": "",
                                        "from": "",
                                        "to": "",
                                        "reg": false,
                                        "x": 290,
                                        "y": 320,
                                        "wires": [
                                            [
                                                "1643873aeecd8613"
                                            ]
                                        ]
                                    },
                                    {
                                        "id": "1643873aeecd8613",
                                        "type": "change",
                                        "z": "5c488c180ba51f18",
                                        "name": "Vorhandenes Array",
                                        "rules": [
                                            {
                                                "t": "set",
                                                "p": "array",
                                                "pt": "msg",
                                                "to": "[]",
                                                "tot": "json"
                                            }
                                        ],
                                        "action": "",
                                        "property": "",
                                        "from": "",
                                        "to": "",
                                        "reg": false,
                                        "x": 490,
                                        "y": 280,
                                        "wires": [
                                            [
                                                "c9d97aec2949301c",
                                                "34c8064e4b5c52fa"
                                            ]
                                        ]
                                    },
                                    {
                                        "id": "34c8064e4b5c52fa",
                                        "type": "change",
                                        "z": "5c488c180ba51f18",
                                        "name": "",
                                        "rules": [
                                            {
                                                "t": "set",
                                                "p": "payload",
                                                "pt": "msg",
                                                "to": "$append(array, payload)",
                                                "tot": "jsonata"
                                            }
                                        ],
                                        "action": "",
                                        "property": "",
                                        "from": "",
                                        "to": "",
                                        "reg": false,
                                        "x": 610,
                                        "y": 340,
                                        "wires": [
                                            [
                                                "5b551b24fc1bb26e"
                                            ]
                                        ]
                                    },
                                    {
                                        "id": "5b551b24fc1bb26e",
                                        "type": "debug",
                                        "z": "5c488c180ba51f18",
                                        "name": "debug 179",
                                        "active": true,
                                        "tosidebar": true,
                                        "console": false,
                                        "tostatus": false,
                                        "complete": "false",
                                        "statusVal": "",
                                        "statusType": "auto",
                                        "x": 750,
                                        "y": 280,
                                        "wires": []
                                    },
                                    {
                                        "id": "c9d97aec2949301c",
                                        "type": "debug",
                                        "z": "5c488c180ba51f18",
                                        "name": "debug 178",
                                        "active": true,
                                        "tosidebar": true,
                                        "console": false,
                                        "tostatus": false,
                                        "complete": "false",
                                        "statusVal": "",
                                        "statusType": "auto",
                                        "x": 710,
                                        "y": 160,
                                        "wires": []
                                    },
                                    {
                                        "id": "bf311140.13d2b8",
                                        "type": "mqtt-broker",
                                        "name": "Mosquito-Server",
                                        "broker": "192.168.178.10",
                                        "port": "1883",
                                        "clientid": "",
                                        "autoConnect": true,
                                        "usetls": false,
                                        "compatmode": false,
                                        "protocolVersion": "4",
                                        "keepalive": "60",
                                        "cleansession": true,
                                        "autoUnsubscribe": true,
                                        "birthTopic": "",
                                        "birthQos": "0",
                                        "birthPayload": "",
                                        "birthMsg": {},
                                        "closeTopic": "",
                                        "closeQos": "0",
                                        "closePayload": "",
                                        "closeMsg": {},
                                        "willTopic": "",
                                        "willQos": "0",
                                        "willPayload": "",
                                        "willMsg": {},
                                        "userProps": "",
                                        "sessionExpiry": ""
                                    }
                                ]
                                

                                Was mache ich falsch?

                                Edit:
                                Als Ziel benötige ich für die 4 Werte jeweils ein Array mit

                                [
                                Wert1,
                                Wert2,
                                Wert3,

                                ...

                                Wert28
                                ]

                                Anzahl der Werte entspricht der Zahl der Tage im laufenden Monat.

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

                                  @martybr Na Du mergst ein leeres Array mit einem skalaren Wert. Dann ist es doch richtig, dass nur ein Wert in dem Array ist. Du musst das Array ja speichern und dann den nächsten Wert anhängen.

                                  0f36d792-5db8-4846-9914-81224feb7e6f-image.png

                                  So hängst Du doch immer wieder nur EIN Wert an ein leeres Array. Du musst doch das Array irgendwo abspeichern und dann das neu erstellte Array mit einem neuen Wert ergänzen.

                                  Also überleg Dir wohin Du Dein Array Ergebnis des Anhänges abspeichern willst. In einer Variable oder in einem Datenpunkt.

                                  Oder mit anderen Worten: Ein Wert an ein leeres Array angehängt, gibt immer nur ein Array mit einem Wert.

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

                                    @mickym
                                    Okay, das ist ein Ansatzpunkt. Ich mache mir mal Gedanken.
                                    Danke für deine Unterstützung.

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

                                      @martybr sagte in Wert in dynamische Struktur im ioBroker ablegen:

                                      @mickym
                                      Okay, das ist ein Ansatzpunkt. Ich mache mir mal Gedanken.
                                      Danke für deine Unterstützung.

                                      Ich habs Dir mal mit eine Flowvariable gemacht. Das heißt das Ergebnis wird in eine Variable gespeichert und dann wieder eingelesen und der neue Wert angehängt.

                                      80b18580-7c9d-4b54-9dd0-4cef812c1065-image.png

                                      [
                                         {
                                             "id": "a0d8740faea1647b",
                                             "type": "mqtt in",
                                             "z": "7e6af0015415146d",
                                             "d": true,
                                             "name": "ZuluftTemp",
                                             "topic": "vitocal/ZuluftTemp",
                                             "qos": "0",
                                             "datatype": "auto-detect",
                                             "broker": "bf311140.13d2b8",
                                             "nl": false,
                                             "rap": true,
                                             "rh": 0,
                                             "inputs": 0,
                                             "x": 260,
                                             "y": 6740,
                                             "wires": [
                                                 [
                                                     "afdcb37ccbacb06f"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "afdcb37ccbacb06f",
                                             "type": "change",
                                             "z": "7e6af0015415146d",
                                             "name": "Zuluft",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "topic",
                                                     "pt": "msg",
                                                     "to": "zuluft",
                                                     "tot": "str"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 410,
                                             "y": 6800,
                                             "wires": [
                                                 [
                                                     "1643873aeecd8613"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "1643873aeecd8613",
                                             "type": "change",
                                             "z": "7e6af0015415146d",
                                             "name": "Vorhandenes Array",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "array",
                                                     "pt": "msg",
                                                     "to": "array",
                                                     "tot": "flow"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "array",
                                                     "pt": "msg",
                                                     "to": "array ? array : []",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 610,
                                             "y": 6760,
                                             "wires": [
                                                 [
                                                     "c9d97aec2949301c",
                                                     "34c8064e4b5c52fa"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "34c8064e4b5c52fa",
                                             "type": "change",
                                             "z": "7e6af0015415146d",
                                             "name": "",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "$append(array, payload)",
                                                     "tot": "jsonata"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "array",
                                                     "pt": "flow",
                                                     "to": "payload",
                                                     "tot": "msg"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 850,
                                             "y": 6760,
                                             "wires": [
                                                 [
                                                     "5b551b24fc1bb26e"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "5b551b24fc1bb26e",
                                             "type": "debug",
                                             "z": "7e6af0015415146d",
                                             "name": "debug 179",
                                             "active": true,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "false",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1070,
                                             "y": 6740,
                                             "wires": []
                                         },
                                         {
                                             "id": "c9d97aec2949301c",
                                             "type": "debug",
                                             "z": "7e6af0015415146d",
                                             "name": "debug 178",
                                             "active": true,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "false",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 830,
                                             "y": 6640,
                                             "wires": []
                                         },
                                         {
                                             "id": "7961970716d0df25",
                                             "type": "inject",
                                             "z": "7e6af0015415146d",
                                             "name": "",
                                             "props": [
                                                 {
                                                     "p": "payload"
                                                 }
                                             ],
                                             "repeat": "",
                                             "crontab": "",
                                             "once": false,
                                             "onceDelay": 0.1,
                                             "topic": "",
                                             "payload": "20.2",
                                             "payloadType": "num",
                                             "x": 230,
                                             "y": 6800,
                                             "wires": [
                                                 [
                                                     "afdcb37ccbacb06f"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "bf311140.13d2b8",
                                             "type": "mqtt-broker",
                                             "name": "Mosquito-Server",
                                             "broker": "192.168.178.10",
                                             "port": "1883",
                                             "clientid": "",
                                             "autoConnect": true,
                                             "usetls": false,
                                             "compatmode": false,
                                             "protocolVersion": "4",
                                             "keepalive": "60",
                                             "cleansession": true,
                                             "autoUnsubscribe": true,
                                             "birthTopic": "",
                                             "birthQos": "0",
                                             "birthPayload": "",
                                             "birthMsg": {},
                                             "closeTopic": "",
                                             "closeQos": "0",
                                             "closePayload": "",
                                             "closeMsg": {},
                                             "willTopic": "",
                                             "willQos": "0",
                                             "willPayload": "",
                                             "willMsg": {},
                                             "userProps": "",
                                             "sessionExpiry": ""
                                         }
                                      ]
                                      

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

                                        @mickym
                                        Der Flow funktioniert.
                                        Ich habe eine Objektveriable in ioBroker.

                                        [
                                           {
                                               "id": "a0d8740faea1647b",
                                               "type": "mqtt in",
                                               "z": "7e6af0015415146d",
                                               "d": true,
                                               "name": "ZuluftTemp",
                                               "topic": "vitocal/ZuluftTemp",
                                               "qos": "0",
                                               "datatype": "auto-detect",
                                               "broker": "bf311140.13d2b8",
                                               "nl": false,
                                               "rap": true,
                                               "rh": 0,
                                               "inputs": 0,
                                               "x": 260,
                                               "y": 6740,
                                               "wires": [
                                                   [
                                                       "afdcb37ccbacb06f"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "afdcb37ccbacb06f",
                                               "type": "change",
                                               "z": "7e6af0015415146d",
                                               "name": "Zuluft",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "topic",
                                                       "pt": "msg",
                                                       "to": "zuluft",
                                                       "tot": "str"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 410,
                                               "y": 6800,
                                               "wires": [
                                                   [
                                                       "1643873aeecd8613"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "1643873aeecd8613",
                                               "type": "change",
                                               "z": "7e6af0015415146d",
                                               "name": "Vorhandenes Array",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "array",
                                                       "pt": "msg",
                                                       "to": "array",
                                                       "tot": "flow"
                                                   },
                                                   {
                                                       "t": "set",
                                                       "p": "array",
                                                       "pt": "msg",
                                                       "to": "array ? array : []",
                                                       "tot": "jsonata"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 610,
                                               "y": 6760,
                                               "wires": [
                                                   [
                                                       "c9d97aec2949301c",
                                                       "34c8064e4b5c52fa"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "34c8064e4b5c52fa",
                                               "type": "change",
                                               "z": "7e6af0015415146d",
                                               "name": "",
                                               "rules": [
                                                   {
                                                       "t": "set",
                                                       "p": "payload",
                                                       "pt": "msg",
                                                       "to": "$append(array, payload)",
                                                       "tot": "jsonata"
                                                   },
                                                   {
                                                       "t": "set",
                                                       "p": "array",
                                                       "pt": "flow",
                                                       "to": "payload",
                                                       "tot": "msg"
                                                   }
                                               ],
                                               "action": "",
                                               "property": "",
                                               "from": "",
                                               "to": "",
                                               "reg": false,
                                               "x": 850,
                                               "y": 6760,
                                               "wires": [
                                                   [
                                                       "5b551b24fc1bb26e"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "5b551b24fc1bb26e",
                                               "type": "debug",
                                               "z": "7e6af0015415146d",
                                               "name": "debug 179",
                                               "active": true,
                                               "tosidebar": true,
                                               "console": false,
                                               "tostatus": false,
                                               "complete": "false",
                                               "statusVal": "",
                                               "statusType": "auto",
                                               "x": 1070,
                                               "y": 6740,
                                               "wires": []
                                           },
                                           {
                                               "id": "c9d97aec2949301c",
                                               "type": "debug",
                                               "z": "7e6af0015415146d",
                                               "name": "debug 178",
                                               "active": true,
                                               "tosidebar": true,
                                               "console": false,
                                               "tostatus": false,
                                               "complete": "false",
                                               "statusVal": "",
                                               "statusType": "auto",
                                               "x": 830,
                                               "y": 6640,
                                               "wires": []
                                           },
                                           {
                                               "id": "7961970716d0df25",
                                               "type": "inject",
                                               "z": "7e6af0015415146d",
                                               "name": "",
                                               "props": [
                                                   {
                                                       "p": "payload"
                                                   }
                                               ],
                                               "repeat": "",
                                               "crontab": "",
                                               "once": false,
                                               "onceDelay": 0.1,
                                               "topic": "",
                                               "payload": "20.2",
                                               "payloadType": "num",
                                               "x": 230,
                                               "y": 6800,
                                               "wires": [
                                                   [
                                                       "afdcb37ccbacb06f"
                                                   ]
                                               ]
                                           },
                                           {
                                               "id": "bf311140.13d2b8",
                                               "type": "mqtt-broker",
                                               "name": "Mosquito-Server",
                                               "broker": "192.168.178.10",
                                               "port": "1883",
                                               "clientid": "",
                                               "autoConnect": true,
                                               "usetls": false,
                                               "compatmode": false,
                                               "protocolVersion": "4",
                                               "keepalive": "60",
                                               "cleansession": true,
                                               "autoUnsubscribe": true,
                                               "birthTopic": "",
                                               "birthQos": "0",
                                               "birthPayload": "",
                                               "birthMsg": {},
                                               "closeTopic": "",
                                               "closeQos": "0",
                                               "closePayload": "",
                                               "closeMsg": {},
                                               "willTopic": "",
                                               "willQos": "0",
                                               "willPayload": "",
                                               "willMsg": {},
                                               "userProps": "",
                                               "sessionExpiry": ""
                                           }
                                        ]
                                        
                                        

                                        Wie kann ich das Array persistent ablegen?

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

                                          @martybr

                                          Wie kann ich das Array persistent ablegen?

                                          Datenpunkt im iobroker oder im mqtt - wo immer Du willst.

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

                                            @mickym
                                            Ich habe das mal so gemacht:
                                            Bildschirmfoto 2025-02-06 um 22.06.32.png

                                            [
                                                {
                                                    "id": "99d066d4bbe5dca9",
                                                    "type": "inject",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "",
                                                    "props": [
                                                        {
                                                            "p": "payload"
                                                        }
                                                    ],
                                                    "repeat": "",
                                                    "crontab": "",
                                                    "once": false,
                                                    "onceDelay": 0.1,
                                                    "topic": "",
                                                    "payload": "20.2",
                                                    "payloadType": "num",
                                                    "x": 350,
                                                    "y": 700,
                                                    "wires": [
                                                        [
                                                            "994a1a0b6d25cef4"
                                                        ]
                                                    ]
                                                },
                                                {
                                                    "id": "82d5f1b2aa875c35",
                                                    "type": "mqtt in",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "ZuluftTemp",
                                                    "topic": "vitocal/ZuluftTemp",
                                                    "qos": "0",
                                                    "datatype": "auto-detect",
                                                    "broker": "bf311140.13d2b8",
                                                    "nl": false,
                                                    "rap": true,
                                                    "rh": 0,
                                                    "inputs": 0,
                                                    "x": 420,
                                                    "y": 620,
                                                    "wires": [
                                                        [
                                                            "994a1a0b6d25cef4"
                                                        ]
                                                    ]
                                                },
                                                {
                                                    "id": "994a1a0b6d25cef4",
                                                    "type": "change",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "Zuluft",
                                                    "rules": [
                                                        {
                                                            "t": "set",
                                                            "p": "topic",
                                                            "pt": "msg",
                                                            "to": "zuluft",
                                                            "tot": "str"
                                                        }
                                                    ],
                                                    "action": "",
                                                    "property": "",
                                                    "from": "",
                                                    "to": "",
                                                    "reg": false,
                                                    "x": 530,
                                                    "y": 700,
                                                    "wires": [
                                                        [
                                                            "4a49f7b7cb1d35d2"
                                                        ]
                                                    ]
                                                },
                                                {
                                                    "id": "de7a183e542f367e",
                                                    "type": "ioBroker get object",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "Test.Test-JSON",
                                                    "topic": "0_userdata.0.Test.Test-JSON",
                                                    "attrname": "array",
                                                    "x": 620,
                                                    "y": 580,
                                                    "wires": [
                                                        []
                                                    ]
                                                },
                                                {
                                                    "id": "4a49f7b7cb1d35d2",
                                                    "type": "change",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "Vorhandenes Array",
                                                    "rules": [
                                                        {
                                                            "t": "set",
                                                            "p": "array",
                                                            "pt": "msg",
                                                            "to": "array",
                                                            "tot": "flow"
                                                        },
                                                        {
                                                            "t": "set",
                                                            "p": "array",
                                                            "pt": "msg",
                                                            "to": "array ? array : []",
                                                            "tot": "jsonata"
                                                        }
                                                    ],
                                                    "action": "",
                                                    "property": "",
                                                    "from": "",
                                                    "to": "",
                                                    "reg": false,
                                                    "x": 730,
                                                    "y": 660,
                                                    "wires": [
                                                        [
                                                            "1bf56806da8b2399",
                                                            "40df7a89751f5b92"
                                                        ]
                                                    ]
                                                },
                                                {
                                                    "id": "40df7a89751f5b92",
                                                    "type": "change",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "",
                                                    "rules": [
                                                        {
                                                            "t": "set",
                                                            "p": "payload",
                                                            "pt": "msg",
                                                            "to": "$append(array, payload)",
                                                            "tot": "jsonata"
                                                        },
                                                        {
                                                            "t": "set",
                                                            "p": "array",
                                                            "pt": "flow",
                                                            "to": "payload",
                                                            "tot": "msg"
                                                        }
                                                    ],
                                                    "action": "",
                                                    "property": "",
                                                    "from": "",
                                                    "to": "",
                                                    "reg": false,
                                                    "x": 830,
                                                    "y": 740,
                                                    "wires": [
                                                        [
                                                            "cb026a3b7a51d987",
                                                            "8d9b65f4efb22698"
                                                        ]
                                                    ]
                                                },
                                                {
                                                    "id": "cb026a3b7a51d987",
                                                    "type": "debug",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "debug 179",
                                                    "active": true,
                                                    "tosidebar": true,
                                                    "console": false,
                                                    "tostatus": false,
                                                    "complete": "false",
                                                    "statusVal": "",
                                                    "statusType": "auto",
                                                    "x": 890,
                                                    "y": 800,
                                                    "wires": []
                                                },
                                                {
                                                    "id": "8d9b65f4efb22698",
                                                    "type": "ioBroker out",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "Test.Test-JSON",
                                                    "topic": "0_userdata.0.Test.Test-JSON",
                                                    "ack": "true",
                                                    "autoCreate": "false",
                                                    "stateName": "",
                                                    "role": "",
                                                    "payloadType": "",
                                                    "readonly": "",
                                                    "stateUnit": "",
                                                    "stateMin": "",
                                                    "stateMax": "",
                                                    "x": 1000,
                                                    "y": 660,
                                                    "wires": []
                                                },
                                                {
                                                    "id": "1bf56806da8b2399",
                                                    "type": "debug",
                                                    "z": "5c488c180ba51f18",
                                                    "name": "debug 178",
                                                    "active": true,
                                                    "tosidebar": true,
                                                    "console": false,
                                                    "tostatus": false,
                                                    "complete": "false",
                                                    "statusVal": "",
                                                    "statusType": "auto",
                                                    "x": 950,
                                                    "y": 540,
                                                    "wires": []
                                                },
                                                {
                                                    "id": "bf311140.13d2b8",
                                                    "type": "mqtt-broker",
                                                    "name": "Mosquito-Server",
                                                    "broker": "192.168.178.10",
                                                    "port": "1883",
                                                    "clientid": "",
                                                    "autoConnect": true,
                                                    "usetls": false,
                                                    "compatmode": false,
                                                    "protocolVersion": "4",
                                                    "keepalive": "60",
                                                    "cleansession": true,
                                                    "autoUnsubscribe": true,
                                                    "birthTopic": "",
                                                    "birthQos": "0",
                                                    "birthPayload": "",
                                                    "birthMsg": {},
                                                    "closeTopic": "",
                                                    "closeQos": "0",
                                                    "closePayload": "",
                                                    "closeMsg": {},
                                                    "willTopic": "",
                                                    "willQos": "0",
                                                    "willPayload": "",
                                                    "willMsg": {},
                                                    "userProps": "",
                                                    "sessionExpiry": ""
                                                }
                                            ]
                                            

                                            Die Werte kommen auch richtig im Datenpunkt an.

                                            Jetzt noch eine letzte Frage für Heute 😇

                                            Der Flow soll einen Monat laufen. Wenn nun ein Neustart vom ioBroker erfolgt, muss der Flow am letzten Datensatz wieder aufsetzen. Muss der daher nicht den letzten Stand aus dem Speicherdatenpunkt wieder einlesen?

                                            Edit:
                                            Ich habe im Flow eine ioBroker-getObject. Die ist wahrscheinlich falsch. Richtig?

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            797
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

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