Stromzählerstand visualisieren

Hallo zusammen,

ich bin noch ganz neu in der homee Welt - habe aber schon viel gelernt und habe auch schon einen virtuellen (hih) homee über Nodered am laufen.

Über Nodered bekomme ich den aktuellen Zählerstand meines Stromzählers (leider wirklich nur den aktuellen Zählerstand).

Habt Ihr eine Idee, wie ich damit ggf. den Verbrauch eines Tages oder zumindest die Entwicklung des Zählerstands sinnvoll abbilden kann? Welchen Gerätetyp würdet Ihr hier als virtuelles Device wählen?

Energiemanager / Gesamtbezug Netz ist noch nicht so das gelbe vom Ei - da habe ich dann eine relativ waagrechte Linie im Device-Graph der bei 30.550 - 30.555 (Werte von gestern) nicht so richtig aussagekräftig ist.

Freue mich auf ein paar Vorschläge :wink:

Habe mal die Kategorie angepasst, da es sich hierbei nicht um ein Support Thema handelt.

Wie oft bekommst du denn deinen Zählerstand übermittelt oder rufst du diesen aktiv ab?

Bei meinem vhih sieht das so aus.

Kann ich dir heute Abend einstellen.

1 „Gefällt mir“

Hi,

vielen Dank für die schnell Antwort.

Ich kann frei wählen, wie oft per mqtt der Zählerstand gemeldet wird.

Dein Screenshot sieht klasse aus - was hast du denn da dahinter stehen (welches virtuelle Device, etc)
?

Das muss ich schauen, ist schon sehr lange her als ich das angelegt habe.
:man_shrugging::thinking:

Das wäre klasse, wenn Du da heute Abend mal schauen könntest.

Hi @Micha,

Hattest Du schon eine Chance mal in dein System / Dein NodeRed zu blicken?

Viele Grüße

[
    {
        "id": "1bb7eda7.8604f2",
        "type": "homeeDevice",
        "z": "1870b770.2d5789",
        "virtual-homee": "",
        "name": "B-Control",
        "nodeId": "90",
        "showNodeId": false,
        "profile": "32",
        "icon": "default",
        "attributes": [
            {
                "instance": 3,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 225.763,
                "last_value": 225.748,
                "unit": "kWh%20Ges.",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1027",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 80000,
                "current_value": 0,
                "target_value": 458.812,
                "last_value": 403.519,
                "unit": "W",
                "step_value": 1,
                "editable": 0,
                "type": 239,
                "state": 1,
                "last_changed": 1572548071,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1033",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 420,
                "current_value": 0,
                "target_value": 232.134,
                "last_value": 231.805,
                "unit": "V",
                "step_value": 1,
                "editable": 0,
                "type": 51,
                "state": 1,
                "last_changed": 1572548036,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1034",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 200,
                "current_value": 0,
                "target_value": 2.581,
                "last_value": 2.575,
                "unit": "A",
                "step_value": 1,
                "editable": 0,
                "type": 272,
                "state": 1,
                "last_changed": 1572548036,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1035",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Tag",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1045",
                "node_id": "90"
            },
            {
                "instance": 2,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Monat",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1046",
                "node_id": "90"
            },
            {
                "instance": 1,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Woche",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1047",
                "node_id": "90"
            }
        ],
        "statusTemplate": "",
        "x": 940,
        "y": 500,
        "wires": [
            []
        ]
    },
    {
        "id": "589d7669.8dd5c8",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1034 Gesamtspannung",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1034,\"value\":{{payload}}}}",
        "output": "json",
        "x": 610,
        "y": 500,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "4efb201c.54398",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1035 Gesamtstromstärke",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1035,\"value\":{{payload}}}}",
        "output": "json",
        "x": 610,
        "y": 540,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "cc7d296a.c04898",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1033 Gesamtverbrauch",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1033,\"value\":{{payload}}}}",
        "output": "json",
        "x": 610,
        "y": 460,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "7ebc70db.a608c",
        "type": "ioBroker in",
        "z": "1870b770.2d5789",
        "name": "Teridian_Total",
        "topic": "b-control-em.0.Teridian_Total",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "x": 210,
        "y": 460,
        "wires": [
            [
                "cc7d296a.c04898",
                "35c1b0eb.e08ee",
                "2ce265b2.819352",
                "c157154.7de59e8"
            ]
        ]
    },
    {
        "id": "b842f9e4.b9df08",
        "type": "ioBroker in",
        "z": "1870b770.2d5789",
        "name": "Spannung_(L1)",
        "topic": "b-control-em.0.Teridian_Total_Kanal.Spannung_(L1)",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "x": 220,
        "y": 520,
        "wires": [
            [
                "589d7669.8dd5c8"
            ]
        ]
    },
    {
        "id": "35c1b0eb.e08ee",
        "type": "function",
        "z": "1870b770.2d5789",
        "name": "",
        "func": "\nreturn {payload:msg.payload/232}",
        "outputs": 1,
        "noerr": 0,
        "x": 390,
        "y": 480,
        "wires": [
            [
                "4efb201c.54398"
            ]
        ]
    },
    {
        "id": "5cd52905.d9d098",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1027 Gesamtverbrauch ",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1027,\"value\":{{payload}}}}",
        "output": "json",
        "x": 610,
        "y": 420,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "7fe36e2e.6fa34",
        "type": "ioBroker in",
        "z": "1870b770.2d5789",
        "name": "",
        "topic": "b-control-em.0.Teridian_Total_Kanal.Wirkenergie_Bezug",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "x": 310,
        "y": 60,
        "wires": [
            [
                "c8bbc1d7.52733",
                "c3b469e2.3c26e8"
            ]
        ]
    },
    {
        "id": "c8bbc1d7.52733",
        "type": "function",
        "z": "1870b770.2d5789",
        "name": "",
        "func": "return {payload: ((parseFloat(msg.payload)-11815340.7)/1000)+71337.81}",
        "outputs": 1,
        "noerr": 0,
        "x": 610,
        "y": 60,
        "wires": [
            [
                "5cd52905.d9d098",
                "1eaa8154.c63fdf",
                "ddd99554.ebacf8",
                "61ea140e.184aec",
                "6bd72b68.471754"
            ]
        ]
    },
    {
        "id": "1eaa8154.c63fdf",
        "type": "change",
        "z": "1870b770.2d5789",
        "name": "",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 820,
        "y": 60,
        "wires": [
            []
        ]
    },
    {
        "id": "58f1bb1e.682f64",
        "type": "inject",
        "z": "1870b770.2d5789",
        "name": "",
        "repeat": "",
        "crontab": "01 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 120,
        "wires": [
            [
                "2f4cd6d3.00526a"
            ]
        ]
    },
    {
        "id": "2f4cd6d3.00526a",
        "type": "change",
        "z": "1870b770.2d5789",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauch2",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 360,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "ddd99554.ebacf8",
        "type": "function",
        "z": "1870b770.2d5789",
        "name": "",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauch2\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "x": 390,
        "y": 380,
        "wires": [
            [
                "cf0dfa7b.627308"
            ]
        ]
    },
    {
        "id": "cf0dfa7b.627308",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1045 Gesamtverbrauch Tag",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1045,\"value\":{{payload}}}}",
        "output": "json",
        "x": 620,
        "y": 380,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "a85ac775.74e738",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1046 Gesamtverbrauch Monat",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1046,\"value\":{{payload}}}}",
        "output": "json",
        "x": 610,
        "y": 340,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "61ea140e.184aec",
        "type": "function",
        "z": "1870b770.2d5789",
        "name": "",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauchMonat\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "x": 390,
        "y": 340,
        "wires": [
            [
                "a85ac775.74e738"
            ]
        ]
    },
    {
        "id": "9d68e0aa.13454",
        "type": "inject",
        "z": "1870b770.2d5789",
        "name": "",
        "repeat": "",
        "crontab": "02 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 160,
        "wires": [
            [
                "419dbdb2.0c5724"
            ]
        ]
    },
    {
        "id": "453ebf2.9e6e74",
        "type": "change",
        "z": "1870b770.2d5789",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauchMonat",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 480,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "419dbdb2.0c5724",
        "type": "function",
        "z": "1870b770.2d5789",
        "name": "",
        "func": "var d = new Date();\nvar date2 = d.getDate() + \"-\" + (d.getMonth() + 1) + \"-\" + d.getFullYear()+\"_\"+d.getHours()+\":\"+d.getMinutes();\nif (d.getDate() === 1){return {payload:true}}\nelse\nreturn",
        "outputs": 1,
        "noerr": 0,
        "x": 270,
        "y": 160,
        "wires": [
            [
                "453ebf2.9e6e74"
            ]
        ]
    },
    {
        "id": "900c35ab.f475f8",
        "type": "inject",
        "z": "1870b770.2d5789",
        "name": "",
        "repeat": "",
        "crontab": "02 00 * * 1",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 200,
        "wires": [
            [
                "839ba0a4.90e5"
            ]
        ]
    },
    {
        "id": "839ba0a4.90e5",
        "type": "change",
        "z": "1870b770.2d5789",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauchWoche",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 500,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "5b959090.a8835",
        "type": "template",
        "z": "1870b770.2d5789",
        "name": "1047 Gesamtverbrauch Woche",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1047,\"value\":{{payload}}}}",
        "output": "json",
        "x": 610,
        "y": 300,
        "wires": [
            [
                "1bb7eda7.8604f2"
            ]
        ]
    },
    {
        "id": "6bd72b68.471754",
        "type": "function",
        "z": "1870b770.2d5789",
        "name": "",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauchWoche\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "x": 390,
        "y": 300,
        "wires": [
            [
                "5b959090.a8835"
            ]
        ]
    },
    {
        "id": "79014e93.0ed96",
        "type": "catch",
        "z": "1870b770.2d5789",
        "name": "",
        "scope": null,
        "uncaught": false,
        "x": 800,
        "y": 260,
        "wires": [
            []
        ]
    },
    {
        "id": "c3b469e2.3c26e8",
        "type": "debug",
        "z": "1870b770.2d5789",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 1160,
        "y": 60,
        "wires": []
    },
    {
        "id": "2ce265b2.819352",
        "type": "debug",
        "z": "1870b770.2d5789",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 440,
        "y": 640,
        "wires": []
    },
    {
        "id": "c157154.7de59e8",
        "type": "ui_text",
        "z": "1870b770.2d5789",
        "group": "f45e3049.4a384",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Verbrauch ",
        "format": "{{msg.payload}}",
        "layout": "col-center",
        "x": 530,
        "y": 580,
        "wires": []
    },
    {
        "id": "f45e3049.4a384",
        "type": "ui_group",
        "name": "homee ",
        "tab": "af140ace.894d58",
        "order": 3,
        "disp": true,
        "width": "27",
        "collapse": false
    },
    {
        "id": "af140ace.894d58",
        "type": "ui_tab",
        "name": "Home2",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Ist der komplette Flow für das Gerät, schau ob es dir hilft.
Wenn du noch Fragen hast dann nur zu.

1 „Gefällt mir“

Hallo @Domino1707,

je nach dem, wie genau (mit wievielen Nachkommastellen) dein Zählerstand übermittelt wird, kannst Du z. Bsp. auch einen „aktuellen Verbrauch“, also den Schnitt über die Zeit zwischen 2 Auslesungen ermitteln.

@Micha woher nimmst Du den „aktuellen Verbrauch“, übermittelt dein Zähler den Wert im Moment des Auslesens?

@Micha
Danke- das probiere ich heute abend mal aus!!!

@anon39850074
Wo kann ich denn den Schnitt bzw. die Berechnung dazu durchführen?

Das kannst du alles in Node Red machen.
Das errechnen der Tages ,Wochen und Monats Verbrauch wird auch dort gemacht.

@anon39850074 das ist ein Energiemanager von dem ich die Daten bekomme.

Vielen Dank!

Eine Frage habe ich tatsächlich:

Was steckt denn hinter den „ioBroker in“ Nodes - was genau wird da geliefert?

Der Zählerstand

Hi,

ich habe versucht, den Flow mit einem Test-JSON anzupassen.

Funktioniert aber leider nicht ;-(

Kannst Du Dir das mal anschauen?

[
    {
        "id": "a09ad26b.315ae",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": ""
    },
    {
        "id": "ccfc9203.121528",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"Time\":\"2022-12-08T12:49:38\",\"STROM\":{\"total\":30500.9}}",
        "payloadType": "str",
        "x": 120,
        "y": 1000,
        "wires": [
            [
                "f85fe9be.7bb55"
            ]
        ]
    },
    {
        "id": "f85fe9be.7bb55",
        "type": "json",
        "z": "a09ad26b.315ae",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 270,
        "y": 1240,
        "wires": [
            [
                "2b887bdc.4e30f4",
                "6b8f82d5.6c97b4"
            ]
        ]
    },
    {
        "id": "2b887bdc.4e30f4",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.STROM.total",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 680,
        "y": 1260,
        "wires": [
            [
                "3c8e0948.90c8ce",
                "3058b7fe.9ff1",
                "1e79f3ed.4379e4",
                "8f9d4b73.b59078"
            ]
        ]
    },
    {
        "id": "a2f13296.c8d18",
        "type": "homeeDevice",
        "z": "a09ad26b.315ae",
        "virtual-homee": "",
        "name": "B-Control",
        "nodeId": "90",
        "showNodeId": false,
        "profile": "32",
        "icon": "default",
        "attributes": [
            {
                "instance": 3,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 225.763,
                "last_value": 225.748,
                "unit": "kWh%20Ges.",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1027",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 80000,
                "current_value": 0,
                "target_value": 458.812,
                "last_value": 403.519,
                "unit": "W",
                "step_value": 1,
                "editable": 0,
                "type": 239,
                "state": 1,
                "last_changed": 1572548071,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1033",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 420,
                "current_value": 0,
                "target_value": 232.134,
                "last_value": 231.805,
                "unit": "V",
                "step_value": 1,
                "editable": 0,
                "type": 51,
                "state": 1,
                "last_changed": 1572548036,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1034",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 200,
                "current_value": 0,
                "target_value": 2.581,
                "last_value": 2.575,
                "unit": "A",
                "step_value": 1,
                "editable": 0,
                "type": 272,
                "state": 1,
                "last_changed": 1572548036,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1035",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Tag",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1045",
                "node_id": "90"
            },
            {
                "instance": 2,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Monat",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1046",
                "node_id": "90"
            },
            {
                "instance": 1,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Woche",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1047",
                "node_id": "90"
            }
        ],
        "statusTemplate": "",
        "x": 1910,
        "y": 1200,
        "wires": [
            []
        ]
    },
    {
        "id": "9487378d.310d68",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1034 Gesamtspannung",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1034,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1510,
        "y": 1300,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "88cc4b95.7c9c18",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1035 Gesamtstromstärke",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1035,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1510,
        "y": 1340,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "1e79f3ed.4379e4",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1033 Gesamtverbrauch",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1033,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1510,
        "y": 1260,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "8f9d4b73.b59078",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "\nreturn {payload:msg.payload/232}",
        "outputs": 1,
        "noerr": 0,
        "x": 1100,
        "y": 1420,
        "wires": [
            [
                "88cc4b95.7c9c18"
            ]
        ]
    },
    {
        "id": "5c296a1b.2b8e54",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1027 Gesamtverbrauch ",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1027,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1510,
        "y": 1220,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "3058b7fe.9ff1",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "return {payload: ((parseFloat(msg.payload)-11815340.7)/1000)+71337.81}",
        "outputs": 1,
        "noerr": 0,
        "x": 960,
        "y": 1200,
        "wires": [
            [
                "5c296a1b.2b8e54",
                "9c79692e.e8519",
                "d91d5658.914e88",
                "ea3c4acb.c5f628",
                "c60ff652.df98"
            ]
        ]
    },
    {
        "id": "9c79692e.e8519",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1200,
        "y": 1180,
        "wires": [
            []
        ]
    },
    {
        "id": "2ecb1a8d.13d016",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "props": [
            {
                "p": "payload",
                "v": "",
                "vt": "date"
            },
            {
                "p": "topic",
                "v": "",
                "vt": "string"
            }
        ],
        "repeat": "",
        "crontab": "01 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1650,
        "y": 660,
        "wires": [
            [
                "b7c26a64.946be"
            ]
        ]
    },
    {
        "id": "b7c26a64.946be",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauch2",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1890,
        "y": 660,
        "wires": [
            []
        ]
    },
    {
        "id": "d91d5658.914e88",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauch2\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "x": 1100,
        "y": 1320,
        "wires": [
            [
                "4e4fa459.b72984"
            ]
        ]
    },
    {
        "id": "4e4fa459.b72984",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1045 Gesamtverbrauch Tag",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1045,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1520,
        "y": 1180,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "d67b82d0.deaa58",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1046 Gesamtverbrauch Monat",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1046,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1510,
        "y": 1140,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "ea3c4acb.c5f628",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauchMonat\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "x": 980,
        "y": 1120,
        "wires": [
            [
                "d67b82d0.deaa58"
            ]
        ]
    },
    {
        "id": "3402438e.390e3c",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "repeat": "",
        "crontab": "02 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1490,
        "y": 700,
        "wires": [
            [
                "b8ac95eb.9d8a4"
            ]
        ]
    },
    {
        "id": "e5e820d4.f99cc",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauchMonat",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1910,
        "y": 700,
        "wires": [
            []
        ]
    },
    {
        "id": "b8ac95eb.9d8a4",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "var d = new Date();\nvar date2 = d.getDate() + \"-\" + (d.getMonth() + 1) + \"-\" + d.getFullYear()+\"_\"+d.getHours()+\":\"+d.getMinutes();\nif (d.getDate() === 1){return {payload:true}}\nelse\nreturn",
        "outputs": 1,
        "noerr": 0,
        "x": 1640,
        "y": 700,
        "wires": [
            [
                "e5e820d4.f99cc"
            ]
        ]
    },
    {
        "id": "58cee201.fba70c",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "repeat": "",
        "crontab": "02 00 * * 1",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1650,
        "y": 740,
        "wires": [
            [
                "b63f4eac.b6f488"
            ]
        ]
    },
    {
        "id": "b63f4eac.b6f488",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauchWoche",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1910,
        "y": 740,
        "wires": [
            []
        ]
    },
    {
        "id": "ab63b4bf.78c718",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1047 Gesamtverbrauch Woche",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1047,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1510,
        "y": 1100,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "c60ff652.df98",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauchWoche\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "x": 1220,
        "y": 1060,
        "wires": [
            [
                "ab63b4bf.78c718"
            ]
        ]
    },
    {
        "id": "79700011.a96418",
        "type": "catch",
        "z": "a09ad26b.315ae",
        "name": "",
        "scope": null,
        "uncaught": false,
        "x": 1620,
        "y": 1000,
        "wires": [
            []
        ]
    },
    {
        "id": "3c8e0948.90c8ce",
        "type": "debug",
        "z": "a09ad26b.315ae",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 920,
        "y": 960,
        "wires": []
    },
    {
        "id": "6b8f82d5.6c97b4",
        "type": "debug",
        "z": "a09ad26b.315ae",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 400,
        "y": 1020,
        "wires": []
    }
]

Mach ich gerne aber erst morgen :see_no_evil:

Das ist nett von Dir, danke! Die beiden DEBUG-Nodes sind noch deaktiviert - habe ich gerade gesehen.

Was mir noch nicht ganz klar ist, ist einerseits wie du die Berechnungen für Tag, Woche Monat durchführst - ich habe zwar die jeweilige Funktion gesehen, aber irgendwo müssen doch auch Vergleichswerte gespeichert werden, oder?

Und andererseits die Berechnungen an sich, hier dividierst und subtrahierst Du ja fleißig - mir ist aber noch nicht ganz klar, was da dahinter steckt.

Beispiel: Der Node der den Gesamtverbrauch des Tages berechnet:

return {payload: ((parseFloat(msg.payload)-11815340.7)/1000)+71337.81}

Was steckt denn hinter den Zahlen?

Habe es dir nochmal zusammengestellt so wie du es brauchst.

[
    {
        "id": "ccfc9203.121528",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"Time\":\"2022-12-08T12:49:38\",\"STROM\":{\"total\":30570.9}}",
        "payloadType": "str",
        "x": 350,
        "y": 1300,
        "wires": [
            [
                "f85fe9be.7bb55"
            ]
        ]
    },
    {
        "id": "f85fe9be.7bb55",
        "type": "json",
        "z": "a09ad26b.315ae",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 490,
        "y": 1300,
        "wires": [
            [
                "2b887bdc.4e30f4"
            ]
        ]
    },
    {
        "id": "2b887bdc.4e30f4",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.STROM.total",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 690,
        "y": 1300,
        "wires": [
            [
                "5c296a1b.2b8e54",
                "9c79692e.e8519",
                "d91d5658.914e88",
                "ea3c4acb.c5f628",
                "c60ff652.df98"
            ]
        ]
    },
    {
        "id": "a2f13296.c8d18",
        "type": "homeeDevice",
        "z": "a09ad26b.315ae",
        "virtual-homee": "",
        "name": "B-Control",
        "nodeId": "90",
        "showNodeId": false,
        "profile": "32",
        "icon": "default",
        "attributes": [
            {
                "instance": 3,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 225.763,
                "last_value": 225.748,
                "unit": "kWh%20Ges.",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1027",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 80000,
                "current_value": 0,
                "target_value": 458.812,
                "last_value": 403.519,
                "unit": "W",
                "step_value": 1,
                "editable": 0,
                "type": 239,
                "state": 1,
                "last_changed": 1572548071,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1033",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 420,
                "current_value": 0,
                "target_value": 232.134,
                "last_value": 231.805,
                "unit": "V",
                "step_value": 1,
                "editable": 0,
                "type": 51,
                "state": 1,
                "last_changed": 1572548036,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1034",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 200,
                "current_value": 0,
                "target_value": 2.581,
                "last_value": 2.575,
                "unit": "A",
                "step_value": 1,
                "editable": 0,
                "type": 272,
                "state": 1,
                "last_changed": 1572548036,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1035",
                "node_id": "90"
            },
            {
                "instance": 0,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Tag",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1045",
                "node_id": "90"
            },
            {
                "instance": 2,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Monat",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1046",
                "node_id": "90"
            },
            {
                "instance": 1,
                "minimum": 0,
                "maximum": 600000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "unit": "kWh%20Woche",
                "step_value": 1,
                "editable": 0,
                "type": 240,
                "state": 1,
                "last_changed": 1572548037,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "data": "",
                "node": "[Circular ~.node]",
                "id": "1047",
                "node_id": "90"
            }
        ],
        "statusTemplate": "",
        "x": 1600,
        "y": 1300,
        "wires": [
            []
        ]
    },
    {
        "id": "9487378d.310d68",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1034 Gesamtspannung",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1034,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1190,
        "y": 1480,
        "wires": [
            []
        ]
    },
    {
        "id": "88cc4b95.7c9c18",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1035 Gesamtstromstärke",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1035,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1190,
        "y": 1520,
        "wires": [
            []
        ]
    },
    {
        "id": "1e79f3ed.4379e4",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1033 Gesamtverbrauch",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1033,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1190,
        "y": 1440,
        "wires": [
            []
        ]
    },
    {
        "id": "8f9d4b73.b59078",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "\nreturn {payload:msg.payload/232}",
        "outputs": 1,
        "noerr": 0,
        "x": 1000,
        "y": 1520,
        "wires": [
            [
                "88cc4b95.7c9c18"
            ]
        ]
    },
    {
        "id": "5c296a1b.2b8e54",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1027 Gesamtverbrauch ",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1027,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1310,
        "y": 1300,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "9c79692e.e8519",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "Gesamtverbrauch speichern",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1020,
        "y": 1340,
        "wires": [
            []
        ]
    },
    {
        "id": "2ecb1a8d.13d016",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "01 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 370,
        "y": 1120,
        "wires": [
            [
                "b7c26a64.946be"
            ]
        ]
    },
    {
        "id": "b7c26a64.946be",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "Tag speichern um 0:01 Uhr",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauch2",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 610,
        "y": 1120,
        "wires": [
            []
        ]
    },
    {
        "id": "d91d5658.914e88",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "Tagesverbrauch berechnen",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauch2\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1020,
        "y": 1240,
        "wires": [
            [
                "4e4fa459.b72984"
            ]
        ]
    },
    {
        "id": "4e4fa459.b72984",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1045 Gesamtverbrauch Tag",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1045,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1320,
        "y": 1240,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "d67b82d0.deaa58",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1046 Gesamtverbrauch Monat",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1046,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1330,
        "y": 1200,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "ea3c4acb.c5f628",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "Monatsverbrauch berechnen",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauchMonat\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1020,
        "y": 1200,
        "wires": [
            [
                "d67b82d0.deaa58"
            ]
        ]
    },
    {
        "id": "3402438e.390e3c",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "02 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 210,
        "y": 1160,
        "wires": [
            [
                "b8ac95eb.9d8a4"
            ]
        ]
    },
    {
        "id": "e5e820d4.f99cc",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "Monat speichern am 1. um 0:02",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauchMonat",
                "pt": "flow",
                "to": "gesamtverbrauch",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 620,
        "y": 1160,
        "wires": [
            []
        ]
    },
    {
        "id": "b8ac95eb.9d8a4",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "",
        "func": "var d = new Date();\nvar date2 = d.getDate() + \"-\" + (d.getMonth() + 1) + \"-\" + d.getFullYear()+\"_\"+d.getHours()+\":\"+d.getMinutes();\nif (d.getDate() === 1){return {payload:true}}\nelse\nreturn",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 1160,
        "wires": [
            [
                "e5e820d4.f99cc"
            ]
        ]
    },
    {
        "id": "58cee201.fba70c",
        "type": "inject",
        "z": "a09ad26b.315ae",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "02 00 * * 1",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 370,
        "y": 1200,
        "wires": [
            [
                "b63f4eac.b6f488"
            ]
        ]
    },
    {
        "id": "b63f4eac.b6f488",
        "type": "change",
        "z": "a09ad26b.315ae",
        "name": "Woche Speichern am Montag 0:02",
        "rules": [
            {
                "t": "set",
                "p": "gesamtverbrauchWoche1",
                "pt": "flow",
                "to": "gesamtverbrauch1",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 630,
        "y": 1200,
        "wires": [
            []
        ]
    },
    {
        "id": "ab63b4bf.78c718",
        "type": "template",
        "z": "a09ad26b.315ae",
        "name": "1047 Gesamtverbrauch Woche",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"attribute\":{\"id\":1047,\"value\":{{payload}}}}",
        "output": "json",
        "x": 1330,
        "y": 1160,
        "wires": [
            [
                "a2f13296.c8d18"
            ]
        ]
    },
    {
        "id": "c60ff652.df98",
        "type": "function",
        "z": "a09ad26b.315ae",
        "name": "Wochen verbrauch berechnen",
        "func": "var verb1 = flow.get(\"gesamtverbrauch\");\nvar verb2 = flow.get(\"gesamtverbrauchWoche\");\n\nreturn {payload: verb1-verb2}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1030,
        "y": 1160,
        "wires": [
            [
                "ab63b4bf.78c718"
            ]
        ]
    },
    {
        "id": "79700011.a96418",
        "type": "catch",
        "z": "a09ad26b.315ae",
        "name": "",
        "scope": null,
        "uncaught": false,
        "x": 400,
        "y": 1520,
        "wires": [
            []
        ]
    }
]

Die Berechnungen liegen an meinen Zähler und meinen separaten Energymeter . Damit der Zählerstand stimmt musste ich beim Einbau den alten Zählerstand abziehen etc.

Wenn du die Funktion benutzt musst du die automatischen inject einmal auslösen, damit auch der Verbrauch sich ändert ansonsten musst du entsprechend warten bis diese automatisch auslösen.
Tag löst nachts um 0:01Uhr , Woche Montag um 0:02Uhr und Monat immer am 1. um 0:02 Uhr.
Ich speichere immer den Gesamtverbrauch und zu den entsprechenden Zeiten wird der Gesamtverbrauch dann auf den Tag , Woche oder Monat gespeichert.
Daher kann es sein das erst am zweiten Tag der Tagesverbrauch angezeigt wird wenn du nicht manuell triggerst.

VG

2 „Gefällt mir“

Aha, ich lese meinen Stromzähler an der iR-Schnittstelle aus, das dauert recht lange, weil zum einen die Datenübertragung recht langsam ist zum anderen werden aber auch viele Daten übertragen. So werden neben dem Zählerstand z.Bsp. Verbrauch vom aktuellen Monat, Vormonat, -jahr und und und direkt übermittelt. Der Momentanverbrauch aber nicht.
Diese Schnittstelle ist ja nicht für Automationen, sondern für den Ablesedienst gedacht, daher ist das verständlich. Da der Zählerstand aber auf 3 Nachkommastellen, also auf’s Watt genau übertragen wird, bilde ich den Schnitt über die Zeit zw. zwei Auslesungen.

@Domino1707 ich speicher den vorherigen Zählerstand in einer globalen Variable, um den Durchschnittsverbrauch über 5 min. zu ermitteln.
Ich stelle meinen Flow hier auch mal ein, vielleicht nützt dir’s ja…

[
    {
        "id": "d657f836.792ed8",
        "type": "tab",
        "label": "Stromzähler",
        "disabled": false,
        "info": ""
    },
    {
        "id": "c6997192.9e6f4",
        "type": "debug",
        "z": "d657f836.792ed8",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 250,
        "y": 340,
        "wires": []
    },
    {
        "id": "70fb9e19.18b66",
        "type": "function",
        "z": "d657f836.792ed8",
        "name": "Verbrauch letzter Monat",
        "func": "var kw_month_1 = parseFloat(msg.payload[\"1-0:1.8.0*1\"].values[0].value);\nvar kw_month_2 = parseFloat(msg.payload[\"1-0:1.8.0*2\"].values[0].value);\nvar kw_month1 = kw_month_1 - kw_month_2;\nmsg.payload = {\"attribute\":{ \"id\": 3103, \"value\": kw_month1}};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 290,
        "y": 260,
        "wires": [
            [
                "3b8fff0.b67e882"
            ]
        ]
    },
    {
        "id": "3b8fff0.b67e882",
        "type": "homeeDevice",
        "z": "d657f836.792ed8",
        "virtual-homee": "",
        "name": "Stromzähler",
        "nodeId": "3100",
        "showNodeId": true,
        "profile": "32",
        "icon": "default",
        "attributes": [
            {
                "type": 4,
                "state": 0,
                "instance": 0,
                "minimum": 0,
                "maximum": 999999999,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "kWh",
                "step_value": 0.001,
                "editable": 0,
                "last_changed": 1613519191,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "3101",
                "node_id": "3100"
            },
            {
                "type": 4,
                "state": 1,
                "instance": 1,
                "minimum": 0,
                "maximum": 10000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "kWh",
                "step_value": 0.001,
                "editable": 0,
                "last_changed": 1613565964,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "3102",
                "node_id": "3100"
            },
            {
                "type": 4,
                "state": 1,
                "instance": 2,
                "minimum": 0,
                "maximum": 10000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "kWh",
                "step_value": 0.001,
                "editable": 0,
                "last_changed": 1613512653,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "3103",
                "node_id": "3100"
            },
            {
                "type": 4,
                "state": 1,
                "instance": 3,
                "minimum": 0,
                "maximum": 10000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "kWh",
                "step_value": 0.001,
                "editable": 0,
                "last_changed": 1613515059,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "3104",
                "node_id": "3100"
            },
            {
                "type": 3,
                "state": 1,
                "instance": 0,
                "minimum": 0,
                "maximum": 90000,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "W",
                "step_value": 1,
                "editable": 0,
                "last_changed": 1613565972,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "3105",
                "node_id": "3100"
            }
        ],
        "statusTemplate": "",
        "x": 590,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "80a06804.c48e78",
        "type": "smartmeter",
        "z": "d657f836.792ed8",
        "name": "Stromzähler",
        "datasource": "fa5df151.99f21",
        "protocol": "D0Protocol",
        "transport": "SerialRequestResponseTransport",
        "requestInterval": "295",
        "d0WakeupCharacters": "0",
        "d0SignOnMessage": "?",
        "d0BaudrateChangeoverOverwrite": "",
        "protocolSmlIgnoreInvalidCRC": false,
        "debugging": false,
        "x": 80,
        "y": 260,
        "wires": [
            [
                "70fb9e19.18b66",
                "8594543d.9fb928",
                "5f95278.07133d8",
                "a05cc906.3f503",
                "9cf8d7e9.143c5",
                "c6997192.9e6f4"
            ]
        ]
    },
    {
        "id": "8594543d.9fb928",
        "type": "function",
        "z": "d657f836.792ed8",
        "name": "Verbrauch Vormonat",
        "func": "var kw_month_2 = parseFloat(msg.payload[\"1-0:1.8.0*2\"].values[0].value);\nvar kw_month_3 = parseFloat(msg.payload[\"1-0:1.8.0*3\"].values[0].value);\nvar kw_month2 = kw_month_2 - kw_month_3;\nmsg.payload = {\"attribute\":{ \"id\": 3104, \"value\": kw_month2}};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 280,
        "y": 300,
        "wires": [
            [
                "3b8fff0.b67e882"
            ]
        ]
    },
    {
        "id": "5f95278.07133d8",
        "type": "function",
        "z": "d657f836.792ed8",
        "name": "Zählerstand",
        "func": "var counter = parseFloat(msg.payload[\"1-0:1.8.0*255\"].values[0].value);\nmsg.payload = {\"attribute\":{ \"id\": 3101, \"value\": counter}};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 250,
        "y": 140,
        "wires": [
            [
                "3b8fff0.b67e882"
            ]
        ]
    },
    {
        "id": "a05cc906.3f503",
        "type": "function",
        "z": "d657f836.792ed8",
        "name": "Verbrauch diesen Monat",
        "func": "var counter = parseFloat(msg.payload[\"1-0:1.8.0*255\"].values[0].value);\nvar kw_month_1 = parseFloat(msg.payload[\"1-0:1.8.0*1\"].values[0].value);\nvar this_mount = counter - kw_month_1;\nmsg.payload = {\"attribute\":{ \"id\": 3102, \"value\": this_mount}};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 290,
        "y": 220,
        "wires": [
            [
                "3b8fff0.b67e882"
            ]
        ]
    },
    {
        "id": "9cf8d7e9.143c5",
        "type": "function",
        "z": "d657f836.792ed8",
        "name": "Last Durchschnitt 5min.",
        "func": "//glob. Variable lesen und in old_counter speichern\nvar old_counter = global.get(\"glob_counter\");\nvar counter = parseFloat(msg.payload[\"1-0:1.8.0*255\"].values[0].value);\n//counter in glob. Variable speichern\nglobal.set(\"glob_counter\",counter); \nvar load_temp = counter - old_counter;\n//kWh*1000 -> Wh / 1/12 Stunden (5min.) -> Watt\nvar load = load_temp * 1000 * 12;\nmsg.payload = {\"attribute\":{ \"id\": 3105, \"value\": load}};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 290,
        "y": 180,
        "wires": [
            [
                "3b8fff0.b67e882"
            ]
        ]
    },
    {
        "id": "fa5df151.99f21",
        "type": "smartmeter-connection",
        "sourcetype": "serial",
        "serialport": "/dev/ttyUSB0",
        "serialbaud": "300",
        "databits": "7",
        "parity": "even",
        "stopbits": "1",
        "httphost": "localhost",
        "httpport": "80",
        "tcphost": "localhost",
        "tcpport": "502",
        "filepath": "/dev/null"
    }
]

Das ist halt bei einer IR Schnittstelle klar das hier die Daten etwas länger brauchen, gerade wenn du so viele übermittelt bekommst.

Hallo Ihr zwei,

vielen Dank Euch - ich werde beide Ansätze mal probieren und mal schauen, was für meine Umgebung am besten funktioniert :wink:

Ich bekomme meine Daten auch „nur“ über die IR-Schnittstelle - und leider auch nur relativ ungenau (100W Schritte).