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. Huawei Wechselrichter und Wallbox abfrage über Modus?

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Huawei Wechselrichter und Wallbox abfrage über Modus?

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

      @homewolf Deswegen habe ich Dir den Thread gepostet. Die Nodes machen alles für Dich - da musst Du nichts codieren.

      https://forum.iobroker.net/post/991216

      [
        {
            "id": "b2a1f09de6d12e90",
            "type": "inject",
            "z": "385f4b8d434f6005",
            "name": "",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "100.00",
            "payloadType": "num",
            "x": 170,
            "y": 2620,
            "wires": [
                [
                    "1c12b45aa6c4adca"
                ]
            ]
        },
        {
            "id": "9bc9a74d1f455065",
            "type": "buffer-maker",
            "z": "385f4b8d434f6005",
            "name": "",
            "specification": "spec",
            "specificationType": "ui",
            "items": [
                {
                    "name": "item1",
                    "type": "floatbe",
                    "length": 1,
                    "dataType": "msg",
                    "data": "payload"
                }
            ],
            "swap1": "",
            "swap2": "",
            "swap3": "",
            "swap1Type": "swap",
            "swap2Type": "swap",
            "swap3Type": "swap",
            "msgProperty": "payload",
            "msgPropertyType": "str",
            "x": 390,
            "y": 2600,
            "wires": [
                [
                    "faea83afe6fa1bba",
                    "c39e4fa3f88efaed"
                ]
            ]
        },
        {
            "id": "c5411af36dbc6206",
            "type": "debug",
            "z": "385f4b8d434f6005",
            "name": "Neues Array",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 770,
            "y": 2600,
            "wires": []
        },
        {
            "id": "7d49268d76c118b3",
            "type": "inject",
            "z": "385f4b8d434f6005",
            "name": "",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "-100.00",
            "payloadType": "num",
            "x": 170,
            "y": 2580,
            "wires": [
                [
                    "1c12b45aa6c4adca"
                ]
            ]
        },
        {
            "id": "faea83afe6fa1bba",
            "type": "buffer-parser",
            "z": "385f4b8d434f6005",
            "name": "",
            "data": "payload",
            "dataType": "msg",
            "specification": "spec",
            "specificationType": "ui",
            "items": [
                {
                    "type": "uint16be",
                    "name": "item1",
                    "offset": 0,
                    "length": 1,
                    "offsetbit": 0,
                    "scale": "1",
                    "mask": ""
                },
                {
                    "type": "uint16be",
                    "name": "item2",
                    "offset": 2,
                    "length": 1,
                    "offsetbit": 0,
                    "scale": "1",
                    "mask": ""
                }
            ],
            "swap1": "",
            "swap2": "",
            "swap3": "",
            "swap1Type": "swap",
            "swap2Type": "swap",
            "swap3Type": "swap",
            "msgProperty": "payload",
            "msgPropertyType": "str",
            "resultType": "value",
            "resultTypeType": "return",
            "multipleResult": false,
            "fanOutMultipleResult": false,
            "setTopic": true,
            "outputs": 1,
            "x": 570,
            "y": 2600,
            "wires": [
                [
                    "c5411af36dbc6206",
                    "28e7d3b028dcf2ba"
                ]
            ]
        },
        {
            "id": "c310b522d6b2bc18",
            "type": "inject",
            "z": "385f4b8d434f6005",
            "name": "",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "-1234.00",
            "payloadType": "num",
            "x": 160,
            "y": 2700,
            "wires": [
                [
                    "1c12b45aa6c4adca"
                ]
            ]
        },
        {
            "id": "c39e4fa3f88efaed",
            "type": "debug",
            "z": "385f4b8d434f6005",
            "name": "buffer",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "",
            "statusType": "auto",
            "x": 550,
            "y": 2540,
            "wires": []
        },
        {
            "id": "31e68b28d89b17db",
            "type": "inject",
            "z": "385f4b8d434f6005",
            "name": "",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "68001",
            "payloadType": "num",
            "x": 170,
            "y": 2660,
            "wires": [
                [
                    "1c12b45aa6c4adca"
                ]
            ]
        },
        {
            "id": "28e7d3b028dcf2ba",
            "type": "buffer-maker",
            "z": "385f4b8d434f6005",
            "name": "",
            "specification": "spec",
            "specificationType": "ui",
            "items": [
                {
                    "name": "item1",
                    "type": "uint16be",
                    "length": 2,
                    "dataType": "msg",
                    "data": "payload"
                }
            ],
            "swap1": "",
            "swap2": "",
            "swap3": "",
            "swap1Type": "swap",
            "swap2Type": "swap",
            "swap3Type": "swap",
            "msgProperty": "payload",
            "msgPropertyType": "str",
            "x": 770,
            "y": 2680,
            "wires": [
                [
                    "423d2ba998b44648"
                ]
            ]
        },
        {
            "id": "d23882e23c0fe50c",
            "type": "debug",
            "z": "385f4b8d434f6005",
            "name": "Rückkonvertierung",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "",
            "statusType": "auto",
            "x": 1150,
            "y": 2680,
            "wires": []
        },
        {
            "id": "423d2ba998b44648",
            "type": "buffer-parser",
            "z": "385f4b8d434f6005",
            "name": "",
            "data": "payload",
            "dataType": "msg",
            "specification": "spec",
            "specificationType": "ui",
            "items": [
                {
                    "type": "floatbe",
                    "name": "item1",
                    "offset": 0,
                    "length": 1,
                    "offsetbit": 0,
                    "scale": "1",
                    "mask": ""
                }
            ],
            "swap1": "",
            "swap2": "",
            "swap3": "",
            "swap1Type": "swap",
            "swap2Type": "swap",
            "swap3Type": "swap",
            "msgProperty": "payload",
            "msgPropertyType": "str",
            "resultType": "value",
            "resultTypeType": "return",
            "multipleResult": true,
            "fanOutMultipleResult": false,
            "setTopic": false,
            "outputs": 1,
            "x": 950,
            "y": 2680,
            "wires": [
                [
                    "d23882e23c0fe50c"
                ]
            ]
        },
        {
            "id": "9c99b46399646127",
            "type": "debug",
            "z": "385f4b8d434f6005",
            "name": "Float- Eingabe",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "",
            "statusType": "auto",
            "x": 400,
            "y": 2660,
            "wires": []
        },
        {
            "id": "1c12b45aa6c4adca",
            "type": "junction",
            "z": "385f4b8d434f6005",
            "x": 280,
            "y": 2620,
            "wires": [
                [
                    "9bc9a74d1f455065",
                    "9c99b46399646127"
                ]
            ]
        }
      ]
      
      

      Du rechnest also mit einer ChangeNode einfach die Watt in kW um und machst dann einen Buffer daraus, der dann in 2 unsigned Integer aufgelöst wird.

      Also wenn Du aus der L2_Leistung -48,21 Watt rausbekommst, dann teile es durch 1000 und dann mach einen Buffer drauf und anschließend das Array aus den beiden unsigned Integer - die Du dann in die Modbus Node schickst.

      6985657f-ad07-4dfd-b25d-b35541bd4d64-image.png

      Die deaktivierten Nodes dienen nur der Kontrolle - es gibt einen kleinen Rundungsfehler.

      Einfach diese 3 Nodes dazwischenklemmen, dann sollte es funktionieren. Hier zum Import:

      [
         {
             "id": "48e7ed7b6861dcd8",
             "type": "change",
             "z": "0662713ffc076361",
             "name": "Watt => Kilowatt",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "payload / 1000",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 480,
             "y": 2180,
             "wires": [
                 [
                     "cb471d291687f412",
                     "ef90c94a09aa51df"
                 ]
             ]
         },
         {
             "id": "ef90c94a09aa51df",
             "type": "buffer-maker",
             "z": "0662713ffc076361",
             "name": "",
             "specification": "spec",
             "specificationType": "ui",
             "items": [
                 {
                     "name": "item1",
                     "type": "floatbe",
                     "length": 1,
                     "dataType": "msg",
                     "data": "payload"
                 }
             ],
             "swap1": "",
             "swap2": "",
             "swap3": "",
             "swap1Type": "swap",
             "swap2Type": "swap",
             "swap3Type": "swap",
             "msgProperty": "payload",
             "msgPropertyType": "str",
             "x": 670,
             "y": 2180,
             "wires": [
                 [
                     "6ed476ca922ac210",
                     "64099d52a0a6f579"
                 ]
             ]
         },
         {
             "id": "64099d52a0a6f579",
             "type": "buffer-parser",
             "z": "0662713ffc076361",
             "name": "",
             "data": "payload",
             "dataType": "msg",
             "specification": "spec",
             "specificationType": "ui",
             "items": [
                 {
                     "type": "uint16be",
                     "name": "item1",
                     "offset": 0,
                     "length": 1,
                     "offsetbit": 0,
                     "scale": "1",
                     "mask": ""
                 },
                 {
                     "type": "uint16be",
                     "name": "item2",
                     "offset": 2,
                     "length": 1,
                     "offsetbit": 0,
                     "scale": "1",
                     "mask": ""
                 }
             ],
             "swap1": "",
             "swap2": "",
             "swap3": "",
             "swap1Type": "swap",
             "swap2Type": "swap",
             "swap3Type": "swap",
             "msgProperty": "payload",
             "msgPropertyType": "str",
             "resultType": "value",
             "resultTypeType": "return",
             "multipleResult": false,
             "fanOutMultipleResult": false,
             "setTopic": true,
             "outputs": 1,
             "x": 870,
             "y": 2180,
             "wires": [
                 [
                     "e1f61afa44453204",
                     "f228761e9c6c3f7c"
                 ]
             ]
         }
      ]
      

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

        @mickym vielen dank dir schon mal, vor allem für die Geduld 😄

        So hast du das gemeint?

        Bildschirm­foto 2023-08-13 um 22.09.50.png

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

          @homewolf genau Wobei Du je den gleichen Wert in 2 Register schreibst - also brauchst Du ihn ja nur einmal berechnen.

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

            @mickym

            Jetzt kommt warum auch immer wieder diese Meldung.

            3 Aug 22:12:31 - [warn] [modbus-getter:37113] Getter -> Inject while node is not ready for input.
            
            1 Reply Last reply Reply Quote 0
            • HomeWolf
              HomeWolf last edited by

              @mickym

              Jetzt kommt warum auch immer wieder diese Meldung.

              3 Aug 22:12:31 - [warn] [modbus-getter:37113] Getter -> Inject while node is not ready for input.
              
              mickym 2 Replies Last reply Reply Quote 0
              • mickym
                mickym Most Active @HomeWolf last edited by

                @homewolf

                984eb0aa-904d-4ccf-954d-fef71d9f83ea-image.png

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

                  @homewolf Eventuell ist da zu schnell für das Schreiben. Schau mal ob der Fehler kommt wenn Du nur in EINE Modbus-Node schreibst. Wenn kein Fehler kommt, dann verzögere das Schreiben mit einer delay Node.

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

                    @mickym habe gesehen, dass die Fehlermeldung von dem andern Ablauf kommt..

                    das umwandeln auf kW hat leider nicht geklappt.. der Zähler gibt jetzt N/A an.
                    Bildschirm­foto 2023-08-13 um 22.19.18.png

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

                      @homewolf Nun wenn das mit Watt vorher geklappt hat - dann liegt es aber an den Werten die Konvertierung müsste aber stimmten. Sprich wenn Du die Change Node weglässt, schau mal ob Du das gleiche Ergebnis bekommst, dass Du vorher mit der function Node bekommen hast.

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

                        @mickym Das sind die Fehlermeldungen, die kommen...
                        Bildschirm­foto 2023-08-13 um 22.23.22.png

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

                          @homewolf Ja aber diese Fehlermeldung kommt doch von einer function Node - nicht von dem Flow den wir gerade gemacht haben. Irgendwo gibts eine function Node mit dem Namen Sum

                          Am Besten Du deaktivierst diese function Node erst mal.

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

                            @mickym Ja habe ich korrekt. es war die, die die Werte addiert hat um die Gesamtleistung zu errechnen. Da die variable W1 es nicht mehr gab, kam der Fehler. Auch wenn ich Change Node weg lasse, kommt N/A

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

                              @homewolf Dann mach es doch nochmal so, wie es vorher funktioniert hat und poste mal die debug Node - damit ich sehe was Du vorher mit der Function Nodes in die Modbus Nodes geschrieben hast. Und wir sind uns doch einig - dass Umrechnung von Watt in kW - Watt/1000 ist.

                              Dann kannst Du auch einfach mal die ChangeNode vor Deine function Node setzen - wobei ich momentan echt schwer tu, den Code in Deiner function Node nachzuvollziehen. Das muss auch ohne function Nodes gehen - aber wie gesagt - man muss halt Schritt für Schritt probieren.

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

                                @mickym hier die beiden

                                var twatts=new Int32Array(2);
                                var valor = (parseInt(msg.payload / 100)).toString(2).padStart(32, '0');
                                
                                var twatts = new Int32Array(2);
                                twatts[0] = parseInt(valor.substring(16, 32), 2);
                                twatts[1] = parseInt(valor.substring(0, 16), 2);
                                
                                msg = { payload: twatts};
                                return msg;
                                
                                flow.set('watts1',msg.payload);
                                
                                var watts=new Int32Array(2);
                                watts[0]=msg.payload.toFixed(0) * 10;
                                if (watts[0] < 0 ) {
                                    watts[0] = 65535 + watts[0];
                                    watts[1] = 65535;
                                }
                                msg={};
                                msg.payload=watts;
                                return msg;
                                
                                mickym 1 Reply Last reply Reply Quote 0
                                • mickym
                                  mickym Most Active @HomeWolf last edited by

                                  @homewolf Ja nochmal machs einfach wie vorher und hänge nur die Change Node davor.

                                  das hat doch vorher funktioniert:

                                  a5e33594-8471-4f85-934f-9c94b1df8cd5-image.png

                                  Und nun rechnest Du halt den Wert aus der iobroker-IN Node mit der Change Node in kW um.

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

                                    @mickym Ja habe ich gemacht, prinzipiell klappte es auch, er macht aus 2000 W -->2kw. Problem ist jetzt, aus 500 W macht er nicht 0,5 kW sondern 1 Kw. und aus 400 W macht er 0,0 kW .. er Rundet also...

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

                                      @homewolf Das macht aber Deine function Node - aber zeig halt mal wenn Du eine Debug Node dahinter hängst was da rauskommt?

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

                                        @mickym 10.0 kommt raus

                                        Bildschirm­foto 2023-08-13 um 23.15.42.png

                                        HomeWolf 1 Reply Last reply Reply Quote 0
                                        • HomeWolf
                                          HomeWolf @HomeWolf last edited by

                                          Das kommt bei deiner Version untern drunter raus
                                          13.8.2023, 23:16:49node: debug 1
                                          hm-rega.0.28633 : msg.payload : array[2]
                                          [ 16319, 57147 ]

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

                                            @homewolf Ja das ist eigenartig - da das was aus der function Node rauskommt eigentlich ein String ist.

                                            Also bei 1499 als Input kommt 10,0 als String raus?

                                            Kannst Du mal einen Screenshot von Deiner Modbus Node machen - ich kenne die ja nicht, aber vielleicht sehe ich da Einstellmöglichkeiten - wie gesagt ich selbst habe keinen Modbus.

                                            HomeWolf mickym 2 Replies 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
                                            65
                                            3639
                                            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