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. Tageszähler Stromverbrauch

    NEWS

    • [erledigt] 15. 05. Wartungsarbeiten am ioBroker Forum

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Tageszähler Stromverbrauch

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

      Es ist übrigens auch ganz einfach neue Schedule-Events nachzutragen:

      1743499f-1eea-4bfc-913e-32f684d1c018-image.png

      Die Datenpunkte werden dann automatisch erzeugt:

      2cd8f1aa-30ff-4d00-a270-faf7dbaca539-image.png

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

        @mickym
        Bin beeindruckt 👍 👍 👍

        Vielen Dank schonmal.
        Werde diese Woche mal einen Testlauf machen 🤘

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

          @frankthegreat Ja dann schau mal - wenn Du nicht initialisierst, dann musst Du halt 2 Perioden abwarten - damit eine vollständige Periode berechnet wird. Sprich wenn Du nicht alles triggerst, werden die Zählerstände erst mit dem ersten Eintreten des Ereignisses erfasst.

          11cad739-9ccc-49ab-8588-207341fd779d-image.png

          Na mal schauen, ob es das so tut. Das Stundenergebnis umgerechnet - schaut aber gut aus und entspricht den Wh, die für die Geräte berichtet werden.

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

            Ggf. ist es sinnvoller - die Trigger alle gegen 0:00:00 starten zu lassen. Dann muss man die Scheduler halt entsprechend ändern:

            b4ece280-c0d9-4e82-b0c1-8dfaad691ca2-image.png

            M 1 Reply Last reply Reply Quote 0
            • C
              CäptnBlaubär @frankthegreat last edited by

              @frankthegreat
              Sourceanalytix (V0.4.14) hat auch mich, einen nicht unerheblichen Teil, meiner Zeit gekostet 😕
              Sourceanalytix (in meinem Fall Ermittlung der Solarproduktion, Eigenverbrauch, etc) )scheint die Differenz zum vorherigen Wert scheinbar erst zu ermitteln, wenn sich der zu triggernde Wert ändert, d.h. der zuletzt gelesene Wert wird beibehalten, und zwar unabhängig davon ob ein Tageswechsel stattgefunden hat. (Es soll ja eine neue Version in Arbeit sein)
              Somit steht im currentday-Datenpunkt nach 00:00 Uhr immer noch der Tageswert des vorangegangenen Tages, bis eben der Datenpunkt bei aufgehender Sonne wieder weitergezählt wird.
              Meine Lösung:
              ->Blockly mit Addition von 1 Watt auf den betreffenden Datenpunkt um 00:01 Uhr.
              Wenn's supergenau sein soll kann das 1 Watt ja nach Sonnenaufgang wieder abgezogen werden.
              Damit werden auch alle untergeordneten Datenpunkte für Monat, Jahr, Quartal, etc tagesgenau aktualisiert.

              frankthegreat 1 Reply Last reply Reply Quote 0
              • frankthegreat
                frankthegreat @CäptnBlaubär last edited by

                @cäptnblaubär
                Jepp, hab mit Sourceanalytics auch einiges an Zeit investiert. Ergebnis war aber ernüchternd 😠
                Von der Sache her ein guter Adapter mit jeder Menge DP's.
                Mir kommt es ja auch nicht auf Milli-Watt-Genauigkeit an 😬

                Aber der Tageszähler sollte schon täglich um 0:00 oder 'ne Sekunde vorher wieder auf 0 springen. Die anderen Zähler hab ich zwar nicht probiert, vermutlich machen die das aber auch nicht.
                Von daher ist der SA Adapter leider nicht zu gebrauchen. Schade um die viele Zeit, die der Entwickler da investiert hat 😒

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @frankthegreat last edited by

                  mir hat das enorm geholfen. danke

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

                    @mickym
                    Hallo @mickym ,
                    kurz zu mir: Ich habe keinerlei Erfahrung mit Node-red und bin gerade über diesen Thread gestolpert und versuche die Programmierung nachzuvollziehen.
                    Ich habe deinen Flow installiert. Die Datenpunkte sind auch angelegt worden.
                    Ich stolpere aber an (mindesten) zwei Stellen:
                    Wie kann ich die Schedules erweitern? Ich hätte gerne zusätzlich stündlich und jährlich.
                    Weiter benötige ich eine Kostenauswertung getrennt nach Gerät.

                    Mein Stand ist der Import des letzten Flows.

                    Viele Grüße
                    Martin

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

                      @martybr
                      Das habe ich nun angepasst. Ist das so in Ordnung?

                      [
                          {
                              "id": "dea0daa6098ba7f9",
                              "type": "subflow",
                              "name": "Verbrauchszähler",
                              "info": "## Parameter:\r\n\r\n\r\n`counterSource` : Hier gibt man den Datenpunkt des Zählers an, der überwacht werden soll. <br>\r\n`baseTopic` : Hier gibt man den Basispfad ein, unter dem die Datenpunkte für Zählerstände und Verbrauchswerte abgespeichert werden sollen. <br>\r\n`changeFactor` : Hier kann man einen Wert eingeben mit dem die ermittelten Differenzen der Zählerstände multipliziert werden sollen. <br>\r\n`counterOffset` : Hier gibt einen Wert eingeben, der auf den aktuellen Zählerstand addiert wird, um ggf. einen Reset des Zählers zu kompensieren. <br>",
                              "category": "",
                              "in": [
                                  {
                                      "x": 60,
                                      "y": 140,
                                      "wires": [
                                          {
                                              "id": "e5bc5007405e7a46"
                                          }
                                      ]
                                  }
                              ],
                              "out": [
                                  {
                                      "x": 1600,
                                      "y": 220,
                                      "wires": [
                                          {
                                              "id": "f009873d7eb21eef",
                                              "port": 0
                                          }
                                      ]
                                  }
                              ],
                              "env": [
                                  {
                                      "name": "counterSource",
                                      "type": "str",
                                      "value": ""
                                  },
                                  {
                                      "name": "baseTopic",
                                      "type": "str",
                                      "value": "0_userdata.0.Test.Gerät1"
                                  },
                                  {
                                      "name": "changeFactor",
                                      "type": "num",
                                      "value": "1"
                                  },
                                  {
                                      "name": "counterOffset",
                                      "type": "num",
                                      "value": "0"
                                  }
                              ],
                              "meta": {},
                              "color": "#DDAA99"
                          },
                          {
                              "id": "4d38b16657026f40",
                              "type": "ioBroker get",
                              "z": "dea0daa6098ba7f9",
                              "name": "Aktueller Zähler",
                              "topic": "",
                              "attrname": "current",
                              "payloadType": "value",
                              "errOnInvalidState": "nothing",
                              "x": 400,
                              "y": 140,
                              "wires": [
                                  [
                                      "a2654ab97236c877"
                                  ]
                              ]
                          },
                          {
                              "id": "90df61e86d3b840c",
                              "type": "change",
                              "z": "dea0daa6098ba7f9",
                              "name": "ermittle Verbrauch",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "payload",
                                      "pt": "msg",
                                      "to": "current - payload",
                                      "tot": "jsonata"
                                  },
                                  {
                                      "t": "set",
                                      "p": "factor",
                                      "pt": "msg",
                                      "to": "changeFactor",
                                      "tot": "env"
                                  },
                                  {
                                      "t": "set",
                                      "p": "payload",
                                      "pt": "msg",
                                      "to": "payload * factor",
                                      "tot": "jsonata"
                                  },
                                  {
                                      "t": "set",
                                      "p": "topic",
                                      "pt": "msg",
                                      "to": "consumption",
                                      "tot": "msg"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 1210,
                              "y": 140,
                              "wires": [
                                  [
                                      "a00ead7de4cf452b",
                                      "f009873d7eb21eef"
                                  ]
                              ]
                          },
                          {
                              "id": "a00ead7de4cf452b",
                              "type": "ioBroker out",
                              "z": "dea0daa6098ba7f9",
                              "name": "Verbrauch",
                              "topic": "",
                              "ack": "true",
                              "autoCreate": "true",
                              "stateName": "",
                              "role": "",
                              "payloadType": "number",
                              "readonly": "false",
                              "stateUnit": "",
                              "stateMin": "",
                              "stateMax": "",
                              "x": 1450,
                              "y": 140,
                              "wires": []
                          },
                          {
                              "id": "cba5d50c245cea3d",
                              "type": "change",
                              "z": "dea0daa6098ba7f9",
                              "name": "Basistopics",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "base",
                                      "pt": "msg",
                                      "to": "baseTopic",
                                      "tot": "env"
                                  },
                                  {
                                      "t": "set",
                                      "p": "topic",
                                      "pt": "msg",
                                      "to": "base & \".Zähler.\" & payload.config.topic",
                                      "tot": "jsonata"
                                  },
                                  {
                                      "t": "set",
                                      "p": "consumption",
                                      "pt": "msg",
                                      "to": "base & \".Verbrauch.\" & payload.config.topic",
                                      "tot": "jsonata"
                                  },
                                  {
                                      "t": "set",
                                      "p": "schedulerTopic",
                                      "pt": "flow",
                                      "to": "payload.config.topic",
                                      "tot": "msg"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 810,
                              "y": 140,
                              "wires": [
                                  [
                                      "a07be4046c224cbf"
                                  ]
                              ]
                          },
                          {
                              "id": "a07be4046c224cbf",
                              "type": "ioBroker get",
                              "z": "dea0daa6098ba7f9",
                              "name": "Lese Zähler",
                              "topic": "",
                              "attrname": "payload",
                              "payloadType": "value",
                              "errOnInvalidState": "false",
                              "x": 990,
                              "y": 140,
                              "wires": [
                                  [
                                      "90df61e86d3b840c",
                                      "b6eb7ae3096fbfdf"
                                  ]
                              ]
                          },
                          {
                              "id": "1c947b18a0aa183f",
                              "type": "ioBroker out",
                              "z": "dea0daa6098ba7f9",
                              "name": "Schreibe Zähler",
                              "topic": "",
                              "ack": "true",
                              "autoCreate": "true",
                              "stateName": "",
                              "role": "",
                              "payloadType": "number",
                              "readonly": "false",
                              "stateUnit": "",
                              "stateMin": "",
                              "stateMax": "",
                              "x": 1460,
                              "y": 80,
                              "wires": []
                          },
                          {
                              "id": "b6eb7ae3096fbfdf",
                              "type": "change",
                              "z": "dea0daa6098ba7f9",
                              "name": "Update Zähler",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "payload",
                                      "pt": "msg",
                                      "to": "current",
                                      "tot": "msg"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 1220,
                              "y": 80,
                              "wires": [
                                  [
                                      "1c947b18a0aa183f"
                                  ]
                              ]
                          },
                          {
                              "id": "e5bc5007405e7a46",
                              "type": "change",
                              "z": "dea0daa6098ba7f9",
                              "name": "",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "topic",
                                      "pt": "msg",
                                      "to": "counterSource",
                                      "tot": "env"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 200,
                              "y": 140,
                              "wires": [
                                  [
                                      "4d38b16657026f40"
                                  ]
                              ]
                          },
                          {
                              "id": "f009873d7eb21eef",
                              "type": "change",
                              "z": "dea0daa6098ba7f9",
                              "name": "",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "topic",
                                      "pt": "msg",
                                      "to": "schedulerTopic",
                                      "tot": "flow"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 1460,
                              "y": 220,
                              "wires": [
                                  []
                              ]
                          },
                          {
                              "id": "a2654ab97236c877",
                              "type": "change",
                              "z": "dea0daa6098ba7f9",
                              "name": "Counter Offset",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "offset",
                                      "pt": "msg",
                                      "to": "counterOffset",
                                      "tot": "env"
                                  },
                                  {
                                      "t": "set",
                                      "p": "current",
                                      "pt": "msg",
                                      "to": "current + offset",
                                      "tot": "jsonata"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 600,
                              "y": 140,
                              "wires": [
                                  [
                                      "cba5d50c245cea3d"
                                  ]
                              ]
                          },
                          {
                              "id": "b6a02d4027b9655a",
                              "type": "tab",
                              "label": "Energiezähler",
                              "disabled": false,
                              "info": "",
                              "env": []
                          },
                          {
                              "id": "bb070f61d47fcdfd",
                              "type": "cronplus",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "outputField": "payload",
                              "timeZone": "",
                              "storeName": "",
                              "commandResponseMsgOutput": "output1",
                              "defaultLocation": "",
                              "defaultLocationType": "default",
                              "outputs": 1,
                              "options": [
                                  {
                                      "name": "daily",
                                      "topic": "täglich",
                                      "payloadType": "default",
                                      "payload": "",
                                      "expressionType": "cron",
                                      "expression": "59 59 23 * * * *",
                                      "location": "",
                                      "offset": "0",
                                      "solarType": "all",
                                      "solarEvents": "sunrise,sunset"
                                  },
                                  {
                                      "name": "weekly",
                                      "topic": "wöchentlich",
                                      "payloadType": "default",
                                      "payload": "",
                                      "expressionType": "cron",
                                      "expression": "59 59 23 * * 6 *",
                                      "location": "",
                                      "offset": "0",
                                      "solarType": "all",
                                      "solarEvents": "sunrise,sunset"
                                  },
                                  {
                                      "name": "monthly",
                                      "topic": "monatlich",
                                      "payloadType": "default",
                                      "payload": "",
                                      "expressionType": "cron",
                                      "expression": "59 59 23 L * *",
                                      "location": "",
                                      "offset": "0",
                                      "solarType": "all",
                                      "solarEvents": "sunrise,sunset"
                                  },
                                  {
                                      "name": "yearly",
                                      "topic": "jährlich",
                                      "payloadType": "default",
                                      "payload": "",
                                      "expressionType": "cron",
                                      "expression": "59 59 23 31 12 * *",
                                      "location": "",
                                      "offset": "0",
                                      "solarType": "all",
                                      "solarEvents": "sunrise,sunset"
                                  }
                              ],
                              "x": 340,
                              "y": 120,
                              "wires": [
                                  [
                                      "897ac0a3992b06da",
                                      "cf229178dca653c1"
                                  ]
                              ]
                          },
                          {
                              "id": "f1b0b23ecc796e87",
                              "type": "inject",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "props": [
                                  {
                                      "p": "topic",
                                      "vt": "str"
                                  }
                              ],
                              "repeat": "",
                              "crontab": "",
                              "once": false,
                              "onceDelay": 0.1,
                              "topic": "trigger-all",
                              "x": 100,
                              "y": 60,
                              "wires": [
                                  [
                                      "bb070f61d47fcdfd"
                                  ]
                              ]
                          },
                          {
                              "id": "54b71782eaa202fa",
                              "type": "inject",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "props": [
                                  {
                                      "p": "payload"
                                  },
                                  {
                                      "p": "topic",
                                      "vt": "str"
                                  }
                              ],
                              "repeat": "",
                              "crontab": "",
                              "once": false,
                              "onceDelay": 0.1,
                              "topic": "trigger",
                              "payload": "daily",
                              "payloadType": "str",
                              "x": 110,
                              "y": 180,
                              "wires": [
                                  [
                                      "bb070f61d47fcdfd"
                                  ]
                              ]
                          },
                          {
                              "id": "d8046ce919ab4e18",
                              "type": "inject",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "props": [
                                  {
                                      "p": "payload"
                                  },
                                  {
                                      "p": "topic",
                                      "vt": "str"
                                  }
                              ],
                              "repeat": "",
                              "crontab": "",
                              "once": false,
                              "onceDelay": 0.1,
                              "topic": "trigger",
                              "payload": "weekly",
                              "payloadType": "str",
                              "x": 110,
                              "y": 240,
                              "wires": [
                                  [
                                      "bb070f61d47fcdfd"
                                  ]
                              ]
                          },
                          {
                              "id": "897ac0a3992b06da",
                              "type": "subflow:dea0daa6098ba7f9",
                              "z": "b6a02d4027b9655a",
                              "name": "Strombezug",
                              "env": [
                                  {
                                      "name": "counterSource",
                                      "value": "alias.0.Verbrauch.Strom.HWR.Strom_Bezug",
                                      "type": "str"
                                  },
                                  {
                                      "name": "baseTopic",
                                      "value": "0_userdata.0.Test.Strombezug",
                                      "type": "str"
                                  }
                              ],
                              "x": 570,
                              "y": 80,
                              "wires": [
                                  []
                              ]
                          },
                          {
                              "id": "cf229178dca653c1",
                              "type": "subflow:dea0daa6098ba7f9",
                              "z": "b6a02d4027b9655a",
                              "name": "Einspeisung",
                              "env": [
                                  {
                                      "name": "counterSource",
                                      "value": "alias.0.Verbrauch.Strom.HWR.Strom_Einspeisung",
                                      "type": "str"
                                  },
                                  {
                                      "name": "baseTopic",
                                      "value": "0_userdata.0.Test.Stromeinspeisung",
                                      "type": "str"
                                  }
                              ],
                              "x": 570,
                              "y": 160,
                              "wires": [
                                  []
                              ]
                          },
                          {
                              "id": "3bdc50cc2fcf8f69",
                              "type": "inject",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "props": [
                                  {
                                      "p": "payload"
                                  },
                                  {
                                      "p": "topic",
                                      "vt": "str"
                                  }
                              ],
                              "repeat": "",
                              "crontab": "",
                              "once": false,
                              "onceDelay": 0.1,
                              "topic": "trigger",
                              "payload": "hour",
                              "payloadType": "str",
                              "x": 110,
                              "y": 120,
                              "wires": [
                                  [
                                      "bb070f61d47fcdfd"
                                  ]
                              ]
                          },
                          {
                              "id": "361255190e614223",
                              "type": "inject",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "props": [
                                  {
                                      "p": "payload"
                                  },
                                  {
                                      "p": "topic",
                                      "vt": "str"
                                  }
                              ],
                              "repeat": "",
                              "crontab": "",
                              "once": false,
                              "onceDelay": 0.1,
                              "topic": "trigger",
                              "payload": "month",
                              "payloadType": "str",
                              "x": 110,
                              "y": 300,
                              "wires": [
                                  [
                                      "bb070f61d47fcdfd"
                                  ]
                              ]
                          },
                          {
                              "id": "e9bd0262aa73e1c0",
                              "type": "inject",
                              "z": "b6a02d4027b9655a",
                              "name": "",
                              "props": [
                                  {
                                      "p": "payload"
                                  },
                                  {
                                      "p": "topic",
                                      "vt": "str"
                                  }
                              ],
                              "repeat": "",
                              "crontab": "",
                              "once": false,
                              "onceDelay": 0.1,
                              "topic": "trigger",
                              "payload": "year",
                              "payloadType": "str",
                              "x": 110,
                              "y": 360,
                              "wires": [
                                  [
                                      "bb070f61d47fcdfd"
                                  ]
                              ]
                          }
                      ]
                      

                      Bildschirmfoto 2024-04-10 um 12.46.24.png

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

                        Nein - die Inject Nodes mit dem manuellen Trigger brauchst Du eigentlich nicht, wenn Du erst alles mit allen Triggern initialisiert hast. ]

                        Wie Du die cron-Plus Node um Stunden erweiterst habe ich doch hier gezeigt:
                        https://forum.iobroker.net/post/1148049
                        bzw. mit 0:00 als Startzeit was ich persönlich schöner finde hier:
                        https://forum.iobroker.net/post/1148199

                        Aber für Dich gerne nochmal die Node mit einem Stundentrigger:

                        [{"id":"bb070f61d47fcdfd","type":"cronplus","z":"289f539dcc33814e","name":"","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output1","defaultLocation":"","defaultLocationType":"default","outputs":1,"options":[{"name":"daily","topic":"täglich","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"weekly","topic":"wöchentlich","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 * * 1 *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"monthly","topic":"monatlich","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 1 * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"yearly","topic":"jährlich","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 1 1 * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"hourly","topic":"stündlich","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":300,"y":5480,"wires":[["fd9141731c825484","bf383941346e9ae4"]]}]
                        

                        Wenn Du manuell einen bestimmten Trigger auslösen möchtest, dann musst Du den Namen des Schedulers in die payload schreiben:

                        9c3edf08-6847-4160-8965-9ead52f67af6-image.png

                        Ich hab Dir das korrespondierende reingeschrieben.

                        Die Subflows Nodes sind soweit in Ordnung. Jährlich war schon in der urspünglichen Node enthalten - das siehst Du an den Schedulern - NICHT an den Inject Nodes - die sind NUR zum TESTEN des jeweiligen Schedulers.!!!!

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

                          @martybr sagte in Tageszähler Stromverbrauch:

                          Weiter benötige ich eine Kostenauswertung getrennt nach Gerät.

                          Ich will den Flow selbst nicht weiter aufblähen, aber Du kannst den Flow natürlich beliebige erweitern. Du kannst ja über die iobroker-In Nodes einen weiteren Flow anstoßen, wenn der Datenpunkt getriggert oder geschrieben wurde bzw. deswegen habe ich es ja gemacht wird ja jeder Verbrauch auch ausgegeben.

                          In diesem Post siehst Du doch, dass jeder Verbrauch auch nochmal ausgegeben wird:
                          https://forum.iobroker.net/post/1148046

                          6d3f7ccf-0394-45fd-9da0-296243df6a34-image.png

                          Da ich das ja die bisherige Einheit Wattstunden war Wh - musst ggf. halt umrechnen auf kWh ( und durch 1000 dividieren) und dann halt mit dem cent Preis multiplizieren.

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

                            @mickym
                            Ich habe nun deine Änderungen eingetragen:

                            [
                                {
                                    "id": "bb070f61d47fcdfd",
                                    "type": "cronplus",
                                    "z": "b6a02d4027b9655a",
                                    "name": "",
                                    "outputField": "payload",
                                    "timeZone": "",
                                    "storeName": "",
                                    "commandResponseMsgOutput": "output1",
                                    "defaultLocation": "",
                                    "defaultLocationType": "default",
                                    "outputs": 1,
                                    "options": [
                                        {
                                            "name": "daily",
                                            "topic": "täglich",
                                            "payloadType": "default",
                                            "payload": "",
                                            "expressionType": "cron",
                                            "expression": "0 0 0 * * * *",
                                            "location": "",
                                            "offset": "0",
                                            "solarType": "all",
                                            "solarEvents": "sunrise,sunset"
                                        },
                                        {
                                            "name": "weekly",
                                            "topic": "wöchentlich",
                                            "payloadType": "default",
                                            "payload": "",
                                            "expressionType": "cron",
                                            "expression": "0 0 0 * * 1 *",
                                            "location": "",
                                            "offset": "0",
                                            "solarType": "all",
                                            "solarEvents": "sunrise,sunset"
                                        },
                                        {
                                            "name": "monthly",
                                            "topic": "monatlich",
                                            "payloadType": "default",
                                            "payload": "",
                                            "expressionType": "cron",
                                            "expression": "0 0 0 1 * *",
                                            "location": "",
                                            "offset": "0",
                                            "solarType": "all",
                                            "solarEvents": "sunrise,sunset"
                                        },
                                        {
                                            "name": "yearly",
                                            "topic": "jährlich",
                                            "payloadType": "default",
                                            "payload": "",
                                            "expressionType": "cron",
                                            "expression": "0 0 0 1 1 * *",
                                            "location": "",
                                            "offset": "0",
                                            "solarType": "all",
                                            "solarEvents": "sunrise,sunset"
                                        },
                                        {
                                            "name": "hourly",
                                            "topic": "stündlich",
                                            "payloadType": "default",
                                            "payload": "",
                                            "expressionType": "cron",
                                            "expression": "0 0 * * * * *",
                                            "location": "",
                                            "offset": "0",
                                            "solarType": "all",
                                            "solarEvents": "sunrise,sunset"
                                        }
                                    ],
                                    "x": 340,
                                    "y": 120,
                                    "wires": [
                                        [
                                            "897ac0a3992b06da",
                                            "cf229178dca653c1"
                                        ]
                                    ]
                                }
                            ]
                            

                            Ist das so in Ordnung? Benötige ich die beiden Trigger "Daily und Weekly" nicht, also nur den Trigger "Trigger-all"?

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

                              @martybr sagte in Tageszähler Stromverbrauch:

                              Ist das so in Ordnung? Benötige ich die beiden Trigger "Daily und Weekly" nicht, also nur den Trigger "Trigger-all"?

                              Du siehst doch alle Scheduler. Mit den Inject-Nodes triggerst DU manuell - das ist einmal mit Trigger-all zum Initialisieren OK - aber ansonsten brauchst Du die Inject Nodes nicht. Du kannst die auch komplett löschen, dann werden die Datenpunkte halt erst angelegt, wenn der Zeitpunkt gekommen ist und dann erst beim übernächsten Mal gezählt, weil ja dann erst die jeweiligen Zählerstände erfasst werden.

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

                                @mickym Bisher habe ich solche Berechnungen nur in Blockly gemacht. Kannst du mir einen Denkanstoß in Richtung Node-red geben? Wie gesagt, ich habe Node-red erst heute installiert und möchte mich anhand eines Beispiels in die Materie einarbeiten.

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

                                  @mickym
                                  Das ist ja wirklich extrem übersichtlich! Vielen Dank dafür.

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

                                    @martybr Wie Du an der Debugausgabe siehst enthält das ausgegebene Nachrichtenobjekt eine payload:

                                    51378a27-9093-464a-b1d1-8c41b687e92b-image.png

                                    und der topic war täglich - also ist das der tägliche Verbrauch der hier in der Debug node ausgegeben wird.

                                    adc7c6b8-3394-42be-b028-ae31270ba281-image.png

                                    Nun simuliere ich mal mit einer Inject-Node einen täglichen Verbrauch von 150,25 Wh.

                                    2bc851c7-5e57-43e8-b640-5a52de23e00e-image.png

                                    Nun nimmst Du einfach eine ChangeNode und modifizierst Deine payload - indem Du durch 1000 teilst und mit dem kWh Preis multiplizierst. Das Ergebnis wird nun in der Debug Node Kosten ausgegeben. Wenn der kWh Preis 0,325 € ist.

                                    Das Ergebnis kannst Du dann natürlich irgendwo im iobroker speichern.

                                    Wenn Du Dich aber nicht weiter mit NodeRed beschäftigen willst und doch lieber puzzelst, kannst Du ja mit Blockly die Datenpunkte weiter verarbeiten.

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

                                      @mickym
                                      Nein, mit Blockly läuft das ja. Ich will es ja gerade aufgrund der Übersichtlichkeit in Node-red machen!
                                      Hänge ich den Change-node nun nach dem Subflow? Wie kann ich die Datenstruktur anlegen?

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

                                        @martybr Nun ja Du kannst die Change Node wie gesagt an den Subflow hängen und dann ggf. das topic so verändern, dass die Datenpunkte automatisch geschrieben werden.

                                        Ich habe Dir ja gerade gezeigt wie Du die payload veränderst, Du kannst das natürlich auch das topic entsprechend verändern.

                                        Wenn Du Dir in der DebugNode das komplette Nachrichtenobjekt ausgeben lässt, dann siehst Du ja folgendes:

                                        f5e7ff56-2fad-4501-9a25-bd88cf4f394f-image.png

                                        So neben der payload - kannst Du auch das topic modifizieren. Wenn Du bis jetzt bei Deinem Strombezug
                                        0_userdata.0.Test.Strombezug als Basis angegeben hast, dann solltest Du ja darunter nun 2 Ordner mit den Zähler und Verbrauch haben.
                                        Nun kannst Du ja für die Kosten noch einen Ordner Kosten nehmen und das topic entsprechend dran hängen.

                                        c672bcda-e7c5-45ce-9dda-dae342ae6428-image.png

                                        Wie Du in der letzten Debugausgabe nun siehst wurde das topic täglich nun mit dem vollständigen Pfad ergänzt.
                                        Also: 0_userdata.0.Test.Strombezug.Kosten.täglich

                                        In einer iobroker-Out Node kannst Du nun die payload in den Datenpunkt schreiben - und da kein topic angegeben wurde, wird automatisch das topic des Nachrichtenobjektes genommen.

                                        Hier mal die Konfiguration der iobroker-Out Node:

                                        2999a1d0-efa9-4d79-9759-fbf2e46c27f3-image.png

                                        Type ist hier "value" - das entspricht im Blocky was bestätigt schreiben (oder aktualisiere). Wenn Du type command nutzt wird unbestätigt als ohne ACK Flag geschrieben (also steuere). Dann kannst Du auch gleich die Einheit und den Datentyp mitgeben.

                                        Wie Du siehst wurde mit dieser Konfiguration die payload in einen Datenpunkt geschrieben:

                                        93a9d5c4-079a-4997-bdfa-bb56b990af57-image.png

                                        und zwar unter : 0_userdata.0.Test.Strombezug.Kosten.täglich

                                        Hier wieder zum Import zum Spielen:

                                        [{"id":"e03388c41fb02646","type":"inject","z":"143ca7a65ecb3e5b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"täglich","payload":"150.25","payloadType":"num","x":550,"y":260,"wires":[["1504ed0e4a1e90ef","bdc3de400373783c"]]},{"id":"1504ed0e4a1e90ef","type":"debug","z":"143ca7a65ecb3e5b","name":"täglicher Verbrauch in Wh","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":260,"wires":[]},{"id":"bdc3de400373783c","type":"change","z":"143ca7a65ecb3e5b","name":"berechne Preis von kWh","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload/1000 * 0.325","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"\"0_userdata.0.Test.Strombezug.Kosten.\" & topic","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":320,"wires":[["f287b278474feccf","24bf979302b25be9"]]},{"id":"f287b278474feccf","type":"debug","z":"143ca7a65ecb3e5b","name":"Kosten","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1000,"y":380,"wires":[]},{"id":"24bf979302b25be9","type":"ioBroker out","z":"143ca7a65ecb3e5b","name":"","topic":"","ack":"true","autoCreate":"true","stateName":"","role":"","payloadType":"number","readonly":"false","stateUnit":"€","stateMin":"","stateMax":"","x":1020,"y":320,"wires":[]}]
                                        

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

                                          @mickym
                                          Das sieht schon sehr gut aus.

                                          Ich habe auch die Einspeisung eingetragen, da gerade kein Strombezug erfolgt.

                                          Hier der komplette Flow:

                                          [
                                              {
                                                  "id": "dea0daa6098ba7f9",
                                                  "type": "subflow",
                                                  "name": "Verbrauchszähler",
                                                  "info": "## Parameter:\r\n\r\n\r\n`counterSource` : Hier gibt man den Datenpunkt des Zählers an, der überwacht werden soll. <br>\r\n`baseTopic` : Hier gibt man den Basispfad ein, unter dem die Datenpunkte für Zählerstände und Verbrauchswerte abgespeichert werden sollen. <br>\r\n`changeFactor` : Hier kann man einen Wert eingeben mit dem die ermittelten Differenzen der Zählerstände multipliziert werden sollen. <br>\r\n`counterOffset` : Hier gibt einen Wert eingeben, der auf den aktuellen Zählerstand addiert wird, um ggf. einen Reset des Zählers zu kompensieren. <br>",
                                                  "category": "",
                                                  "in": [
                                                      {
                                                          "x": 60,
                                                          "y": 140,
                                                          "wires": [
                                                              {
                                                                  "id": "e5bc5007405e7a46"
                                                              }
                                                          ]
                                                      }
                                                  ],
                                                  "out": [
                                                      {
                                                          "x": 1600,
                                                          "y": 220,
                                                          "wires": [
                                                              {
                                                                  "id": "f009873d7eb21eef",
                                                                  "port": 0
                                                              }
                                                          ]
                                                      }
                                                  ],
                                                  "env": [
                                                      {
                                                          "name": "counterSource",
                                                          "type": "str",
                                                          "value": ""
                                                      },
                                                      {
                                                          "name": "baseTopic",
                                                          "type": "str",
                                                          "value": "0_userdata.0.Test.Gerät1"
                                                      },
                                                      {
                                                          "name": "changeFactor",
                                                          "type": "num",
                                                          "value": "1"
                                                      },
                                                      {
                                                          "name": "counterOffset",
                                                          "type": "num",
                                                          "value": "0"
                                                      }
                                                  ],
                                                  "meta": {},
                                                  "color": "#DDAA99"
                                              },
                                              {
                                                  "id": "4d38b16657026f40",
                                                  "type": "ioBroker get",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Aktueller Zähler",
                                                  "topic": "",
                                                  "attrname": "current",
                                                  "payloadType": "value",
                                                  "errOnInvalidState": "nothing",
                                                  "x": 400,
                                                  "y": 140,
                                                  "wires": [
                                                      [
                                                          "a2654ab97236c877"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "90df61e86d3b840c",
                                                  "type": "change",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "ermittle Verbrauch",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "payload",
                                                          "pt": "msg",
                                                          "to": "current - payload",
                                                          "tot": "jsonata"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "factor",
                                                          "pt": "msg",
                                                          "to": "changeFactor",
                                                          "tot": "env"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "payload",
                                                          "pt": "msg",
                                                          "to": "payload * factor",
                                                          "tot": "jsonata"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "topic",
                                                          "pt": "msg",
                                                          "to": "consumption",
                                                          "tot": "msg"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 1210,
                                                  "y": 140,
                                                  "wires": [
                                                      [
                                                          "a00ead7de4cf452b",
                                                          "f009873d7eb21eef"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "a00ead7de4cf452b",
                                                  "type": "ioBroker out",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Verbrauch",
                                                  "topic": "",
                                                  "ack": "true",
                                                  "autoCreate": "true",
                                                  "stateName": "",
                                                  "role": "",
                                                  "payloadType": "number",
                                                  "readonly": "false",
                                                  "stateUnit": "",
                                                  "stateMin": "",
                                                  "stateMax": "",
                                                  "x": 1450,
                                                  "y": 140,
                                                  "wires": []
                                              },
                                              {
                                                  "id": "cba5d50c245cea3d",
                                                  "type": "change",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Basistopics",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "base",
                                                          "pt": "msg",
                                                          "to": "baseTopic",
                                                          "tot": "env"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "topic",
                                                          "pt": "msg",
                                                          "to": "base & \".Zähler.\" & payload.config.topic",
                                                          "tot": "jsonata"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "consumption",
                                                          "pt": "msg",
                                                          "to": "base & \".Verbrauch.\" & payload.config.topic",
                                                          "tot": "jsonata"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "schedulerTopic",
                                                          "pt": "flow",
                                                          "to": "payload.config.topic",
                                                          "tot": "msg"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 810,
                                                  "y": 140,
                                                  "wires": [
                                                      [
                                                          "a07be4046c224cbf"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "a07be4046c224cbf",
                                                  "type": "ioBroker get",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Lese Zähler",
                                                  "topic": "",
                                                  "attrname": "payload",
                                                  "payloadType": "value",
                                                  "errOnInvalidState": "false",
                                                  "x": 990,
                                                  "y": 140,
                                                  "wires": [
                                                      [
                                                          "90df61e86d3b840c",
                                                          "b6eb7ae3096fbfdf"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "1c947b18a0aa183f",
                                                  "type": "ioBroker out",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Schreibe Zähler",
                                                  "topic": "",
                                                  "ack": "true",
                                                  "autoCreate": "true",
                                                  "stateName": "",
                                                  "role": "",
                                                  "payloadType": "number",
                                                  "readonly": "false",
                                                  "stateUnit": "",
                                                  "stateMin": "",
                                                  "stateMax": "",
                                                  "x": 1460,
                                                  "y": 80,
                                                  "wires": []
                                              },
                                              {
                                                  "id": "b6eb7ae3096fbfdf",
                                                  "type": "change",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Update Zähler",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "payload",
                                                          "pt": "msg",
                                                          "to": "current",
                                                          "tot": "msg"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 1220,
                                                  "y": 80,
                                                  "wires": [
                                                      [
                                                          "1c947b18a0aa183f"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "e5bc5007405e7a46",
                                                  "type": "change",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "topic",
                                                          "pt": "msg",
                                                          "to": "counterSource",
                                                          "tot": "env"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 200,
                                                  "y": 140,
                                                  "wires": [
                                                      [
                                                          "4d38b16657026f40"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "f009873d7eb21eef",
                                                  "type": "change",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "topic",
                                                          "pt": "msg",
                                                          "to": "schedulerTopic",
                                                          "tot": "flow"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 1460,
                                                  "y": 220,
                                                  "wires": [
                                                      []
                                                  ]
                                              },
                                              {
                                                  "id": "a2654ab97236c877",
                                                  "type": "change",
                                                  "z": "dea0daa6098ba7f9",
                                                  "name": "Counter Offset",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "offset",
                                                          "pt": "msg",
                                                          "to": "counterOffset",
                                                          "tot": "env"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "current",
                                                          "pt": "msg",
                                                          "to": "current + offset",
                                                          "tot": "jsonata"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 600,
                                                  "y": 140,
                                                  "wires": [
                                                      [
                                                          "cba5d50c245cea3d"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "b6a02d4027b9655a",
                                                  "type": "tab",
                                                  "label": "Energiezähler",
                                                  "disabled": false,
                                                  "info": "",
                                                  "env": []
                                              },
                                              {
                                                  "id": "bb070f61d47fcdfd",
                                                  "type": "cronplus",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "",
                                                  "outputField": "payload",
                                                  "timeZone": "",
                                                  "storeName": "",
                                                  "commandResponseMsgOutput": "output1",
                                                  "defaultLocation": "",
                                                  "defaultLocationType": "default",
                                                  "outputs": 1,
                                                  "options": [
                                                      {
                                                          "name": "daily",
                                                          "topic": "täglich",
                                                          "payloadType": "default",
                                                          "payload": "",
                                                          "expressionType": "cron",
                                                          "expression": "0 0 0 * * * *",
                                                          "location": "",
                                                          "offset": "0",
                                                          "solarType": "all",
                                                          "solarEvents": "sunrise,sunset"
                                                      },
                                                      {
                                                          "name": "weekly",
                                                          "topic": "wöchentlich",
                                                          "payloadType": "default",
                                                          "payload": "",
                                                          "expressionType": "cron",
                                                          "expression": "0 0 0 * * 1 *",
                                                          "location": "",
                                                          "offset": "0",
                                                          "solarType": "all",
                                                          "solarEvents": "sunrise,sunset"
                                                      },
                                                      {
                                                          "name": "monthly",
                                                          "topic": "monatlich",
                                                          "payloadType": "default",
                                                          "payload": "",
                                                          "expressionType": "cron",
                                                          "expression": "0 0 0 1 * *",
                                                          "location": "",
                                                          "offset": "0",
                                                          "solarType": "all",
                                                          "solarEvents": "sunrise,sunset"
                                                      },
                                                      {
                                                          "name": "yearly",
                                                          "topic": "jährlich",
                                                          "payloadType": "default",
                                                          "payload": "",
                                                          "expressionType": "cron",
                                                          "expression": "0 0 0 1 1 * *",
                                                          "location": "",
                                                          "offset": "0",
                                                          "solarType": "all",
                                                          "solarEvents": "sunrise,sunset"
                                                      },
                                                      {
                                                          "name": "hourly",
                                                          "topic": "stündlich",
                                                          "payloadType": "default",
                                                          "payload": "",
                                                          "expressionType": "cron",
                                                          "expression": "0 0 * * * * *",
                                                          "location": "",
                                                          "offset": "0",
                                                          "solarType": "all",
                                                          "solarEvents": "sunrise,sunset"
                                                      }
                                                  ],
                                                  "x": 260,
                                                  "y": 120,
                                                  "wires": [
                                                      [
                                                          "897ac0a3992b06da",
                                                          "cf229178dca653c1"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "f1b0b23ecc796e87",
                                                  "type": "inject",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "",
                                                  "props": [
                                                      {
                                                          "p": "topic",
                                                          "vt": "str"
                                                      }
                                                  ],
                                                  "repeat": "",
                                                  "crontab": "",
                                                  "once": false,
                                                  "onceDelay": 0.1,
                                                  "topic": "trigger-all",
                                                  "x": 100,
                                                  "y": 120,
                                                  "wires": [
                                                      [
                                                          "bb070f61d47fcdfd"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "897ac0a3992b06da",
                                                  "type": "subflow:dea0daa6098ba7f9",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "Strombezug",
                                                  "env": [
                                                      {
                                                          "name": "counterSource",
                                                          "value": "alias.0.Verbrauch.Strom.HWR.Strom_Bezug",
                                                          "type": "str"
                                                      },
                                                      {
                                                          "name": "baseTopic",
                                                          "value": "0_userdata.0.Test.Strombezug",
                                                          "type": "str"
                                                      }
                                                  ],
                                                  "x": 450,
                                                  "y": 80,
                                                  "wires": [
                                                      [
                                                          "42acf696bed0fcbd"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "cf229178dca653c1",
                                                  "type": "subflow:dea0daa6098ba7f9",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "Einspeisung",
                                                  "env": [
                                                      {
                                                          "name": "counterSource",
                                                          "value": "alias.0.Verbrauch.Strom.HWR.Strom_Einspeisung",
                                                          "type": "str"
                                                      },
                                                      {
                                                          "name": "baseTopic",
                                                          "value": "0_userdata.0.Test.Stromeinspeisung",
                                                          "type": "str"
                                                      }
                                                  ],
                                                  "x": 450,
                                                  "y": 160,
                                                  "wires": [
                                                      [
                                                          "f3f26be174740b51"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "41276c4bdde5667d",
                                                  "type": "ioBroker out",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "",
                                                  "topic": "",
                                                  "ack": "true",
                                                  "autoCreate": "true",
                                                  "stateName": "",
                                                  "role": "",
                                                  "payloadType": "number",
                                                  "readonly": "false",
                                                  "stateUnit": "€",
                                                  "stateMin": "",
                                                  "stateMax": "",
                                                  "x": 960,
                                                  "y": 80,
                                                  "wires": []
                                              },
                                              {
                                                  "id": "42acf696bed0fcbd",
                                                  "type": "change",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "berechne Preis von kWh",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "payload",
                                                          "pt": "msg",
                                                          "to": "payload * 0.425",
                                                          "tot": "jsonata"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "topic",
                                                          "pt": "msg",
                                                          "to": "\"0_userdata.0.Test.Strombezug.Kosten.\" & topic",
                                                          "tot": "jsonata"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 670,
                                                  "y": 80,
                                                  "wires": [
                                                      [
                                                          "4445a621b7b8914a",
                                                          "41276c4bdde5667d"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "4445a621b7b8914a",
                                                  "type": "debug",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "Kosten",
                                                  "active": false,
                                                  "tosidebar": true,
                                                  "console": false,
                                                  "tostatus": false,
                                                  "complete": "true",
                                                  "targetType": "full",
                                                  "statusVal": "",
                                                  "statusType": "auto",
                                                  "x": 900,
                                                  "y": 180,
                                                  "wires": []
                                              },
                                              {
                                                  "id": "f3f26be174740b51",
                                                  "type": "change",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "berechne Preis von kWh",
                                                  "rules": [
                                                      {
                                                          "t": "set",
                                                          "p": "payload",
                                                          "pt": "msg",
                                                          "to": "payload * 0.08",
                                                          "tot": "jsonata"
                                                      },
                                                      {
                                                          "t": "set",
                                                          "p": "topic",
                                                          "pt": "msg",
                                                          "to": "\"0_userdata.0.Test.Stromeinspeisung.Kosten.\" & topic",
                                                          "tot": "jsonata"
                                                      }
                                                  ],
                                                  "action": "",
                                                  "property": "",
                                                  "from": "",
                                                  "to": "",
                                                  "reg": false,
                                                  "x": 630,
                                                  "y": 260,
                                                  "wires": [
                                                      [
                                                          "945bd735a62776f4",
                                                          "308d7f57c2f460d4"
                                                      ]
                                                  ]
                                              },
                                              {
                                                  "id": "945bd735a62776f4",
                                                  "type": "ioBroker out",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "",
                                                  "topic": "",
                                                  "ack": "true",
                                                  "autoCreate": "true",
                                                  "stateName": "",
                                                  "role": "",
                                                  "payloadType": "number",
                                                  "readonly": "false",
                                                  "stateUnit": "€",
                                                  "stateMin": "",
                                                  "stateMax": "",
                                                  "x": 900,
                                                  "y": 260,
                                                  "wires": []
                                              },
                                              {
                                                  "id": "308d7f57c2f460d4",
                                                  "type": "debug",
                                                  "z": "b6a02d4027b9655a",
                                                  "name": "Kosten",
                                                  "active": false,
                                                  "tosidebar": true,
                                                  "console": false,
                                                  "tostatus": false,
                                                  "complete": "true",
                                                  "targetType": "full",
                                                  "statusVal": "",
                                                  "statusType": "auto",
                                                  "x": 900,
                                                  "y": 340,
                                                  "wires": []
                                              }
                                          ]
                                          

                                          Die anderen Datenpunkte kommen wahrscheinlich später dazu, wenn der Cron plus entsprechende Trigger bekommt?

                                          Vielen Dank erst mal für deine Mühe. Ich schaue mir das mal genau an.
                                          Ich hatte bei meinen Experimenten immer das Problem, dass der Change keine "Number" aus dem Payload erzeugen konnte. Aber jetzt habe ich ja einen Hinweis, wie es richtig gemacht wird.

                                          Danke noch mal für deine Hilfe!

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

                                            Na schaut doch gut und übersichtlich aus. Um 15 Uhr sollte dann ja der erste Datenpunkt auftauchen, wenn Du alles einmal getriggert hattest.

                                            An der Optik Deiner Flows kann man noch bissi arbeiten. 😉

                                            f877a28c-17d4-4fd1-9062-d95382ca67c8-image.png

                                            In der Hilfe zur cronplus Node - kannst Du Dich ja in die Details einlesen. Und Du musst halt überprüfen welche Einheit bei der Kostenberechnung ausgespuckt werden, ob kWh oder Wh. Aber das findest Du alles selbst raus.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            593
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            6
                                            57
                                            2949
                                            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