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. Auslesen Daten Stromzähler

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Auslesen Daten Stromzähler

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      marco121990 @marco121990 last edited by

      @marco121990 Das wird von Tasmota übergeben:

      22:40:54.825 MQT: tele/tasmota_Stromzaehler/STATE = {"Time":"2023-04-24T22:40:54","Uptime":"1T00:11:50","UptimeSec":87110,"Heap":19,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":29,"MqttCount":1,"Wifi":{"AP":1,"SSId":"TP-Link","BSSId":"54:AF:97:D9:63:50","Channel":11,"Mode":"11n","RSSI":50,"Signal":-75,"LinkCount":1,"Downtime":"0T00:00:03"}}

      22:40:54.834 MQT: tele/tasmota_Stromzaehler/SENSOR = {"Time":"2023-04-24T22:40:54","":{"Total_in":21816.99,"Total_out":7.12,"Power_curr":506}}

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

        Wenn Du den Flow exportierst musst Du ihn unbedingt in Code-Tags einschliessen.

        Code-Tags.gif

        Sonst ist der nicht importierbar.

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

          @marco121990 sagte in Auslesen Daten Stromzähler:

          {"Time":"2023-04-24T22:40:54","Uptime":"1T00:11:50","UptimeSec":87110,"Heap":19,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":29,"MqttCount":1,"Wifi":{"AP":1,"SSId":"TP-Link","BSSId":"54:AF:97:D9:63:50","Channel":11,"Mode":"11n","RSSI":50,"Signal":-75,"LinkCount":1,"Downtime":"0T00:00:03"}}

          Ja das ist normalerweise eine payload.
          c5d7da74-5f7a-47bf-b63a-4c4265e9fb1d-image.png

          Wenn Du das über eine iobroker-IN Node einfügst musst Du das erst in in ein Objekt wandeln - oder kommt es aus einer Mqtt- IN Node?

          Wenn ich Dein Objekt nehme und in eine Inject Node nehme - ordne ich es einer payload zu - deswegen wollte ich den ganzen Flow haben, aber in code-Tags bitte.

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

            @mickym Habe ich oben im ersten Post angepasst.

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

              @mickym
              Kommt aus einer Mqtt-in node

              0c1ae55c-4e3f-47b9-88b3-e8e6169888b8-image.png

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

                @marco121990 Ja verstehe ich - Du kannst es auf Autoerkennung (1. Option lassen), dass ist die vielseitigste - das wird der payload zugewiesen.

                Mach mal die Debug Node so, dass Du die Ausgabe nicht in das Systemlog schreibst, sondern ins debug Fenster.

                und kein JSONATA als Ausgabe:
                20ca02b5-a8f7-4151-b793-901a08825822-image.png

                Sondern das msg. Objekt.

                e48f32fc-cc5b-4208-bf6d-4ab5c5ff90fc-image.png

                Das war bei Dir verkehrt. Dann sollte es mit dem Pfad kopieren funktionieren aus dem Debug Tab.

                Wenn Du das richtig gestellt hast bekommst Du das in Deinem Debug Fenster:

                85df35ce-8bdd-4d43-be48-25a474759b54-image.png

                Dann ist das Objekt auch Teil der payload Eigenschaft des Nachrichtenobjektes.

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

                  Wie gesagt der JSON stimmt nicht.

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

                    @mickym

                    Das war schon einmal der erste Fehler.
                    Nun kann ich die Pfade als payload kopieren.

                    Allerdings gibt er mir trotz Change alle 3 Werte aus.

                    69b49944-3e00-4789-9825-0a72dbcaccf5-image.png

                    3db6882d-7bcf-42f7-b04f-4a5780707491-image.png

                    So war die vorgehendweise in einem der Youtube Videos.

                    [
                        {
                            "id": "56f626e4b62c825a",
                            "type": "mqtt in",
                            "z": "f6f2187d.f17ca8",
                            "name": "Strom",
                            "topic": "tele/tasmota_Stromzaehler/SENSOR",
                            "qos": "0",
                            "datatype": "auto-detect",
                            "broker": "6b0c5137b3a546c3",
                            "nl": false,
                            "rap": true,
                            "rh": 0,
                            "inputs": 0,
                            "x": 90,
                            "y": 100,
                            "wires": [
                                [
                                    "707e6a5fd1adb822",
                                    "1de823b8ddeb6c63",
                                    "9ebb34cc2a3228e8"
                                ]
                            ]
                        },
                        {
                            "id": "b26daa48e8b63891",
                            "type": "debug",
                            "z": "f6f2187d.f17ca8",
                            "name": "debug 1",
                            "active": true,
                            "tosidebar": true,
                            "console": true,
                            "tostatus": false,
                            "complete": "payload",
                            "targetType": "msg",
                            "statusVal": "",
                            "statusType": "auto",
                            "x": 670,
                            "y": 140,
                            "wires": []
                        },
                        {
                            "id": "707e6a5fd1adb822",
                            "type": "change",
                            "z": "f6f2187d.f17ca8",
                            "name": "",
                            "rules": [
                                {
                                    "t": "move",
                                    "p": "payload[\"\"].Total_in",
                                    "pt": "msg",
                                    "to": "payload",
                                    "tot": "msg"
                                }
                            ],
                            "action": "",
                            "property": "",
                            "from": "",
                            "to": "",
                            "reg": false,
                            "x": 350,
                            "y": 200,
                            "wires": [
                                [
                                    "b26daa48e8b63891"
                                ]
                            ]
                        },
                        {
                            "id": "1de823b8ddeb6c63",
                            "type": "change",
                            "z": "f6f2187d.f17ca8",
                            "name": "",
                            "rules": [
                                {
                                    "t": "move",
                                    "p": "payload[\"\"].Total_out",
                                    "pt": "msg",
                                    "to": "payload",
                                    "tot": "msg"
                                }
                            ],
                            "action": "",
                            "property": "",
                            "from": "",
                            "to": "",
                            "reg": false,
                            "x": 360,
                            "y": 240,
                            "wires": [
                                [
                                    "58e492acb7933ee1"
                                ]
                            ]
                        },
                        {
                            "id": "9ebb34cc2a3228e8",
                            "type": "change",
                            "z": "f6f2187d.f17ca8",
                            "name": "",
                            "rules": [
                                {
                                    "t": "move",
                                    "p": "payload[\"\"].Power_curr",
                                    "pt": "msg",
                                    "to": "payload",
                                    "tot": "msg"
                                }
                            ],
                            "action": "",
                            "property": "",
                            "from": "",
                            "to": "",
                            "reg": false,
                            "x": 370,
                            "y": 280,
                            "wires": [
                                [
                                    "0be43a1afe4539c9"
                                ]
                            ]
                        },
                        {
                            "id": "58e492acb7933ee1",
                            "type": "debug",
                            "z": "f6f2187d.f17ca8",
                            "name": "debug 2",
                            "active": true,
                            "tosidebar": true,
                            "console": false,
                            "tostatus": false,
                            "complete": "false",
                            "statusVal": "",
                            "statusType": "auto",
                            "x": 680,
                            "y": 200,
                            "wires": []
                        },
                        {
                            "id": "0be43a1afe4539c9",
                            "type": "debug",
                            "z": "f6f2187d.f17ca8",
                            "name": "debug 3",
                            "active": true,
                            "tosidebar": true,
                            "console": false,
                            "tostatus": false,
                            "complete": "false",
                            "statusVal": "",
                            "statusType": "auto",
                            "x": 680,
                            "y": 260,
                            "wires": []
                        },
                        {
                            "id": "6b0c5137b3a546c3",
                            "type": "mqtt-broker",
                            "name": "Stromzaehler",
                            "broker": "192.168.178.100",
                            "port": "1883",
                            "clientid": "",
                            "autoConnect": true,
                            "usetls": false,
                            "protocolVersion": "4",
                            "keepalive": "60",
                            "cleansession": true,
                            "birthTopic": "",
                            "birthQos": "0",
                            "birthPayload": "",
                            "birthMsg": {},
                            "closeTopic": "",
                            "closeQos": "0",
                            "closePayload": "",
                            "closeMsg": {},
                            "willTopic": "",
                            "willQos": "0",
                            "willPayload": "",
                            "willMsg": {},
                            "userProps": "",
                            "sessionExpiry": ""
                        }
                    ]
                    
                    mickym 1 Reply Last reply Reply Quote 0
                    • mickym
                      mickym Most Active @marco121990 last edited by mickym

                      Ja das Problem ist, dass da kein richtiger JSON rauskommt. Mach bitte nochmal direkt eine debug Node an die mqtt-In NOde dran.

                      Und kopieren den kompletten Wert hier in CodeTags - der Eigenschaftsname fehlt nämlich komplett.

                      ead54c5c-bbc6-45cb-919e-ceb9c53ebc6c-image.png

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

                        @mickym

                        {"Time":"2023-04-24T23:10:24","":{"Total_in":21817.28,"Total_out":7.12,"Power_curr":554}}
                        
                        mickym 1 Reply Last reply Reply Quote 0
                        • mickym
                          mickym Most Active @marco121990 last edited by mickym

                          @marco121990 sagte in Auslesen Daten Stromzähler:

                          Ja genau, dass ist das Problem - dass der Eigenschaftsname leer ist

                          f191dc6c-757d-49fb-9b37-49bffe903c9a-image.png

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

                            @mickym

                            @mickym sagte in Auslesen Daten Stromzähler:

                            @marco121990 sagte in Auslesen Daten Stromzähler:

                            Ja genau, dass ist das Problem - dass der Eigenschaftsname leer ist

                            f191dc6c-757d-49fb-9b37-49bffe903c9a-image.png

                            Ok - ich glaube ich habe eine Umgehungslösung. 😉

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

                              @mickym

                              Das wird von tasmota anscheinend schon nicht übergeben oder?

                              23:15:54.844 MQT: tele/tasmota_Stromzaehler/STATE = {"Time":"2023-04-24T23:15:54","Uptime":"1T00:46:50","UptimeSec":89210,"Heap":18,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"TP-Link","BSSId":"54:AF:97:D9:63:50","Channel":11,"Mode":"11n","RSSI":54,"Signal":-73,"LinkCount":1,"Downtime":"0T00:00:03"}}
                              23:15:54.852 MQT: tele/tasmota_Stromzaehler/SENSOR = {"Time":"2023-04-24T23:15:54","":{"Total_in":21817.33,"Total_out":7.12,"Power_curr":514}}
                              
                              mickym 1 Reply Last reply Reply Quote 0
                              • mickym
                                mickym Most Active @marco121990 last edited by mickym

                                @marco121990 Genau, das ist das Problem. 😉 Du siehst beim State schaut es OK aus, aber ich habe eine Umgehungslösung.

                                Ich glaube dass Du im Tasmota noch irgendwas einstellen musst, aber zumindest kann man das Objekt teilen

                                Nimm den oberen Flow - der ist einfacher.

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

                                  @mickym

                                  Vielen Dank für deine Hilfe. Werde ich morgen nach der Arbeit mal testen.

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

                                    @marco121990 Wie gesagt bei steht bei den Sensor States als Eigenschaft ANALOG - das ist jedenfalls nicht normal.

                                    Mit JSONATA gehts auch. - Aber normal ist das halt nicht:

                                    55c8a9b2-a10d-4a43-9235-46e0c800633f-image.png

                                    [
                                       {
                                           "id": "b4f8b97ff6ce20fd",
                                           "type": "inject",
                                           "z": "7e6af0015415146d",
                                           "name": "",
                                           "props": [
                                               {
                                                   "p": "payload"
                                               }
                                           ],
                                           "repeat": "",
                                           "crontab": "",
                                           "once": false,
                                           "onceDelay": 0.1,
                                           "topic": "",
                                           "payload": "{\"Time\":\"2023-04-24T22:40:54\",\"\":{\"Total_in\":21816.99,\"Total_out\":7.12,\"Power_curr\":506}}",
                                           "payloadType": "json",
                                           "x": 170,
                                           "y": 2520,
                                           "wires": [
                                               [
                                                   "727362f830c74cec",
                                                   "c44c1270e188d977",
                                                   "e75f702c254d372e"
                                               ]
                                           ]
                                       },
                                       {
                                           "id": "65baf6533fb7d8a5",
                                           "type": "debug",
                                           "z": "7e6af0015415146d",
                                           "name": "Einzelwerte",
                                           "active": true,
                                           "tosidebar": true,
                                           "console": false,
                                           "tostatus": false,
                                           "complete": "payload",
                                           "targetType": "msg",
                                           "statusVal": "",
                                           "statusType": "auto",
                                           "x": 630,
                                           "y": 2520,
                                           "wires": []
                                       },
                                       {
                                           "id": "727362f830c74cec",
                                           "type": "change",
                                           "z": "7e6af0015415146d",
                                           "name": "",
                                           "rules": [
                                               {
                                                   "t": "set",
                                                   "p": "payload",
                                                   "pt": "msg",
                                                   "to": "payload.\"\".Total_in",
                                                   "tot": "jsonata"
                                               }
                                           ],
                                           "action": "",
                                           "property": "",
                                           "from": "",
                                           "to": "",
                                           "reg": false,
                                           "x": 410,
                                           "y": 2480,
                                           "wires": [
                                               [
                                                   "65baf6533fb7d8a5"
                                               ]
                                           ]
                                       },
                                       {
                                           "id": "c44c1270e188d977",
                                           "type": "change",
                                           "z": "7e6af0015415146d",
                                           "name": "",
                                           "rules": [
                                               {
                                                   "t": "set",
                                                   "p": "payload",
                                                   "pt": "msg",
                                                   "to": "payload.\"\".Total_out",
                                                   "tot": "jsonata"
                                               }
                                           ],
                                           "action": "",
                                           "property": "",
                                           "from": "",
                                           "to": "",
                                           "reg": false,
                                           "x": 410,
                                           "y": 2520,
                                           "wires": [
                                               [
                                                   "65baf6533fb7d8a5"
                                               ]
                                           ]
                                       },
                                       {
                                           "id": "e75f702c254d372e",
                                           "type": "change",
                                           "z": "7e6af0015415146d",
                                           "name": "",
                                           "rules": [
                                               {
                                                   "t": "set",
                                                   "p": "payload",
                                                   "pt": "msg",
                                                   "to": "payload.\"\".Power_curr",
                                                   "tot": "jsonata"
                                               }
                                           ],
                                           "action": "",
                                           "property": "",
                                           "from": "",
                                           "to": "",
                                           "reg": false,
                                           "x": 410,
                                           "y": 2560,
                                           "wires": [
                                               [
                                                   "65baf6533fb7d8a5"
                                               ]
                                           ]
                                       }
                                    ]
                                    

                                    Vielleicht musst Du dem Stromzähler ein topic oder Namen geben - keine Ahnung - jedenfalls ist das in Tasmota schon schief.

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

                                    Support us

                                    ioBroker
                                    Community Adapters
                                    Donate

                                    1.1k
                                    Online

                                    31.7k
                                    Users

                                    79.7k
                                    Topics

                                    1.3m
                                    Posts

                                    3
                                    24
                                    1332
                                    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