[ { "id": "6e802f1553b18149", "type": "subflow", "name": "JSON or Obj to IOBroker", "info": "# Creates an IOBroker tree\n\nThis node creates an IOBroker tree out of an Java-Object or JSON String.\n\nThe object tree will be created under 0_userdata.0\nIn addition to the JSON-String or Java Object as `msg.payload` it is necessary to specify a `msg.top` properity in addition to the msg-Object.\n\nThe object tree will be created under 0_userdata.0\n\nExisting `msg.topic` entries will be deleted.\nAn iobroker-out node has to be appended to this subflow node. It is not part of the subflow itself. No topic should be specified in the iobroker out node.\n\nIs `msg.top` property isn't defined, the `top` property of the subflow-node is used. \n\nIn the properties of the subflow node a new property `keepTopic` has been added. Default is _false_ to keep the current behaviour. If set to _true_ then the originial topic will be placed between the `top` property of the subflow node and the property of the analyzed JSON object.\n\n**Attention:**\nIf msg.top and top is empty, all msg.topics (msg.topic) will be directly prefixed with 0_userdata.0. . \n\n# Erstellt einen Objektbaum im ioBroker\n\nDiese Node erstellt einen Objektbaum im ioBroker aus einem JAVA Objekt bzw. einem JSON String. \n\nDer Baum wird in jedem Fall unter 0_userdata.0 erstellt und zwar unter dem Topic der in` msg.top` mitgegeben wurde. In der `msg.payload` befindet sich dann der JSON String oder das entsprechende Objekt.\n\nExistierende `msg.topic `Einträge werden gelöscht.\nEin entsprechende iobroker-out Node muss an den Flow angehängt werden. Sie ist nicht Bestandteil des Subflows. In dieser iobroker-out Node darf kein Topic angegeben werden. \n\nFalls msg.top nicht definiert wurde, wird der `top`-Wert der Subflow-Node verwendet.\n\nIn den Eigenschaften der Subflow-Node wurde ein neuer Parameter `keepTopic` hinzugefügt. Standardwert ist _false_, um das bisherige Verhalten beizubehalten. Setzt man die Eigenschaft auf _true_, dann wird das originale Topic zwischen der `top` Eigenschaft der Subflow-Node und Eigenschaft des analysierten JSON Objektes eingefügt.\n\n**Achtung:**\nWenn top und msg.top leer ist, werden alle msg.topics (msg.topic) direkt unter dem Präfix 0_userdata.0., angelegt bzw. ausgegeben. ", "category": "", "in": [ { "x": 60, "y": 160, "wires": [ { "id": "554b8c663bcb46c2" } ] } ], "out": [ { "x": 2320, "y": 280, "wires": [ { "id": "f5d52c6a57d08904", "port": 0 }, { "id": "74c895ce724750de", "port": 0 } ] } ], "env": [ { "name": "top", "type": "str", "value": "Huawei0" }, { "name": "keepTopic", "type": "bool", "value": "false" } ], "meta": {}, "color": "#E2D96E", "icon": "node-red/batch.svg" }, { "id": "3e11e8338f694832", "type": "split", "z": "6e802f1553b18149", "name": "split object", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "key", "x": 1370, "y": 160, "wires": [ [ "0562a4249c8b856b" ] ] }, { "id": "0562a4249c8b856b", "type": "change", "z": "6e802f1553b18149", "name": "add key to topic", "rules": [ { "t": "set", "p": "stateName", "pt": "msg", "to": "key", "tot": "msg" }, { "t": "set", "p": "topic", "pt": "msg", "to": "topic & '.' & key", "tot": "jsonata" }, { "t": "change", "p": "topic", "pt": "msg", "from": " ", "fromt": "str", "to": "_", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1560, "y": 160, "wires": [ [ "ddc90985bef0fafa" ] ] }, { "id": "ddc90985bef0fafa", "type": "switch", "z": "6e802f1553b18149", "name": "is type?", "property": "payload", "propertyType": "msg", "rules": [ { "t": "istype", "v": "array", "vt": "array" }, { "t": "istype", "v": "object", "vt": "object" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 1740, "y": 160, "wires": [ [ "bfce19b206660fbe" ], [ "3e11e8338f694832" ], [ "1a8c03d866b85b12" ] ] }, { "id": "bfce19b206660fbe", "type": "split", "z": "6e802f1553b18149", "name": "split array", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "x": 780, "y": 280, "wires": [ [ "e89927810c6d75ec" ] ] }, { "id": "e89927810c6d75ec", "type": "change", "z": "6e802f1553b18149", "name": "add index to topic", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "topic & '.' & parts.index", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 970, "y": 280, "wires": [ [ "a4d1a5d04564dc77" ] ] }, { "id": "f5d52c6a57d08904", "type": "change", "z": "6e802f1553b18149", "name": "finalize msg.topic", "rules": [ { "t": "set", "p": "top", "pt": "msg", "to": "'0_userdata.0.' & top", "tot": "jsonata" }, { "t": "set", "p": "topic", "pt": "msg", "to": "top & '.' & topic", "tot": "jsonata" }, { "t": "change", "p": "topic", "pt": "msg", "from": "..", "fromt": "str", "to": ".", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2170, "y": 240, "wires": [ [] ] }, { "id": "c863dd7d651b2272", "type": "switch", "z": "6e802f1553b18149", "name": "is type?", "property": "payload", "propertyType": "msg", "rules": [ { "t": "istype", "v": "json", "vt": "json" }, { "t": "istype", "v": "object", "vt": "object" }, { "t": "istype", "v": "array", "vt": "array" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 4, "x": 580, "y": 160, "wires": [ [ "158930afddd0780b" ], [ "3e11e8338f694832" ], [ "bfce19b206660fbe" ], [ "a4d1a5d04564dc77" ] ] }, { "id": "158930afddd0780b", "type": "json", "z": "6e802f1553b18149", "name": "", "property": "payload", "action": "", "pretty": false, "x": 770, "y": 120, "wires": [ [ "3649300b4c233b10" ] ] }, { "id": "1a8c03d866b85b12", "type": "switch", "z": "6e802f1553b18149", "name": "is msg.top != null", "property": "top", "propertyType": "msg", "rules": [ { "t": "nnull" }, { "t": "null" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1950, "y": 280, "wires": [ [ "f5d52c6a57d08904" ], [ "74c895ce724750de" ] ] }, { "id": "e023fe88445ce43e", "type": "change", "z": "6e802f1553b18149", "name": "", "rules": [ { "t": "delete", "p": "topic", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 350, "y": 200, "wires": [ [ "c863dd7d651b2272" ] ] }, { "id": "3649300b4c233b10", "type": "switch", "z": "6e802f1553b18149", "name": "is array?", "property": "payload", "propertyType": "msg", "rules": [ { "t": "istype", "v": "array", "vt": "array" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 900, "y": 120, "wires": [ [ "bfce19b206660fbe" ], [ "3e11e8338f694832" ] ] }, { "id": "1b8480cd2df7ba3f", "type": "comment", "z": "6e802f1553b18149", "name": "Array", "info": "", "x": 600, "y": 280, "wires": [] }, { "id": "b3541807672be040", "type": "comment", "z": "6e802f1553b18149", "name": "object", "info": "", "x": 1340, "y": 100, "wires": [] }, { "id": "a4d1a5d04564dc77", "type": "switch", "z": "6e802f1553b18149", "name": "is type?", "property": "payload", "propertyType": "msg", "rules": [ { "t": "istype", "v": "object", "vt": "object" }, { "t": "istype", "v": "array", "vt": "array" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 1160, "y": 280, "wires": [ [ "3e11e8338f694832" ], [ "bfce19b206660fbe" ], [ "1a8c03d866b85b12" ] ] }, { "id": "74c895ce724750de", "type": "change", "z": "6e802f1553b18149", "name": "finalize msg.topic", "rules": [ { "t": "set", "p": "top", "pt": "msg", "to": "top", "tot": "env" }, { "t": "set", "p": "top", "pt": "msg", "to": "'0_userdata.0.' & top", "tot": "jsonata" }, { "t": "set", "p": "topic", "pt": "msg", "to": "top & '.' & topic", "tot": "jsonata" }, { "t": "change", "p": "topic", "pt": "msg", "from": "..", "fromt": "str", "to": ".", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2170, "y": 320, "wires": [ [] ] }, { "id": "554b8c663bcb46c2", "type": "switch", "z": "6e802f1553b18149", "name": "", "property": "keepTopic", "propertyType": "env", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 170, "y": 160, "wires": [ [ "e30ba9f0483285e4" ], [ "e023fe88445ce43e" ] ] }, { "id": "e30ba9f0483285e4", "type": "change", "z": "6e802f1553b18149", "name": "", "rules": [ { "t": "change", "p": "topic", "pt": "msg", "from": "/", "fromt": "str", "to": ".", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 350, "y": 120, "wires": [ [ "c863dd7d651b2272" ] ] }, { "id": "95db18fde30fb61d", "type": "tab", "label": "Huawei Sun2000", "disabled": false, "info": "", "env": [] }, { "id": "e194ae7a3d757b0d", "type": "inject", "z": "95db18fde30fb61d", "d": true, "name": "Every Minute", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "60", "crontab": "", "once": true, "onceDelay": "0.5", "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 880, "wires": [ [ "ef91022a521e3b4d" ] ] }, { "id": "ef91022a521e3b4d", "type": "modbus-getter", "z": "95db18fde30fb61d", "name": "Inverter Data 32000-32116", "showStatusActivities": false, "showErrors": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "32000", "quantity": "116", "server": "70220ecd.1ca1e", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "x": 260, "y": 980, "wires": [ [ "b29392128d3eec41" ], [ "7247511b469a1b45" ] ] }, { "id": "7247511b469a1b45", "type": "modbus-getter", "z": "95db18fde30fb61d", "name": "Battery und Smart-Meter 37000-37125", "showStatusActivities": false, "showErrors": true, "showWarnings": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "37000", "quantity": "125", "server": "70220ecd.1ca1e", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 290, "y": 1040, "wires": [ [ "a7e9680bf89b4542" ], [ "0ddd65628d4e28f8" ] ] }, { "id": "175165bec5f95995", "type": "join", "z": "95db18fde30fb61d", "name": "", "mode": "custom", "build": "merged", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "43", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 710, "y": 1040, "wires": [ [ "284872112f923872", "533448f8d50b0739", "0578daa5ee6f5af9" ] ] }, { "id": "284872112f923872", "type": "debug", "z": "95db18fde30fb61d", "name": "dbg_LongInterval_Join_Output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 950, "y": 980, "wires": [] }, { "id": "0e599f3a84be6d7a", "type": "comment", "z": "95db18fde30fb61d", "name": "SUN2000 Query", "info": "", "x": 120, "y": 60, "wires": [] }, { "id": "0ddd65628d4e28f8", "type": "modbus-getter", "z": "95db18fde30fb61d", "name": "Battery Charge/Discharge 37784-37788", "showStatusActivities": false, "showErrors": true, "showWarnings": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "37784", "quantity": "4", "server": "70220ecd.1ca1e", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 300, "y": 1100, "wires": [ [ "635dbfa8debcc247" ], [] ] }, { "id": "635dbfa8debcc247", "type": "buffer-parser", "z": "95db18fde30fb61d", "name": "[x2]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "uint32be", "name": "Battery Current Day Charge Capacity", "offset": 0, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "uint32be", "name": "Battery Current Day Discharge Capacity", "offset": 4, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 1100, "wires": [ [ "175165bec5f95995" ] ] }, { "id": "533448f8d50b0739", "type": "subflow:6e802f1553b18149", "z": "95db18fde30fb61d", "name": "", "env": [ { "name": "top", "value": "Huawei0", "type": "str" } ], "x": 930, "y": 1040, "wires": [ [ "f035ab3bed14f8b0" ] ] }, { "id": "f035ab3bed14f8b0", "type": "ioBroker out", "z": "95db18fde30fb61d", "name": "", "topic": "", "ack": "true", "autoCreate": "true", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1160, "y": 1040, "wires": [] }, { "id": "db232f33ced5fd14", "type": "inject", "z": "95db18fde30fb61d", "name": "Every 5 Seconds", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "5", "crontab": "", "once": true, "onceDelay": "2", "topic": "", "payload": "", "payloadType": "date", "x": 170, "y": 340, "wires": [ [ "876a89588ea10a78" ] ] }, { "id": "63b7400518aa73ae", "type": "modbus-getter", "z": "95db18fde30fb61d", "name": "Input Power & Inverter Active Power", "showStatusActivities": false, "showErrors": true, "showWarnings": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "32064", "quantity": "18", "server": "70220ecd.1ca1e", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 290, "y": 620, "wires": [ [ "ab99daf7623f1513" ], [ "ac8dc178ddee5a32" ] ] }, { "id": "ab99daf7623f1513", "type": "buffer-parser", "z": "95db18fde30fb61d", "name": " [x2]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int32be", "name": "Input Power", "offset": 0, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Inverter Active Power", "offset": 32, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 620, "wires": [ [ "2a4fb43ef4a6f11f" ] ] }, { "id": "ac8dc178ddee5a32", "type": "modbus-getter", "z": "95db18fde30fb61d", "name": "Battery Charging Power 37001", "showStatusActivities": false, "showErrors": true, "showWarnings": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "37001", "quantity": "2", "server": "70220ecd.1ca1e", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 270, "y": 680, "wires": [ [ "df58543510cd4f57" ], [ "5bb12e3e2a9cf757" ] ] }, { "id": "df58543510cd4f57", "type": "buffer-parser", "z": "95db18fde30fb61d", "name": "[x1]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int32be", "name": "Battery Charging Power", "offset": 0, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 680, "wires": [ [ "2a4fb43ef4a6f11f" ] ] }, { "id": "5bb12e3e2a9cf757", "type": "modbus-getter", "z": "95db18fde30fb61d", "name": "Meter Active Power 37113", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "37113", "quantity": "2", "server": "70220ecd.1ca1e", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "1", "x": 250, "y": 740, "wires": [ [ "82dd5457be91220e" ], [] ] }, { "id": "82dd5457be91220e", "type": "buffer-parser", "z": "95db18fde30fb61d", "name": "[x1]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int32be", "name": "Meter Active Power", "offset": 0, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 740, "wires": [ [ "2a4fb43ef4a6f11f" ] ] }, { "id": "2a4fb43ef4a6f11f", "type": "join", "z": "95db18fde30fb61d", "name": "", "mode": "custom", "build": "merged", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "4", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 710, "y": 680, "wires": [ [ "4f39b75b527ebad0", "7be54fe85cdbbcca" ] ] }, { "id": "ecfd4015e8fc23a6", "type": "buffer-parser", "z": "95db18fde30fb61d", "d": true, "name": " [x22]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int16be", "name": "PV1 Voltage", "offset": 32, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int16be", "name": "PV1 Current", "offset": 34, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int16be", "name": "PV2 Voltage", "offset": 36, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int16be", "name": "PV2 Current", "offset": 38, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Input Power", "offset": 128, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase A Voltage", "offset": 138, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase B Voltage", "offset": 140, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase C Voltage", "offset": 142, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Inverter Phase A Current", "offset": 144, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Phase B Current", "offset": 148, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Phase C Current", "offset": 152, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Active Power", "offset": 160, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Inverter Reactive Power", "offset": 164, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int16be", "name": "Inverter Power Factor", "offset": 168, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "uint16be", "name": "Inverter Grid Frequency", "offset": 170, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "uint16be", "name": "Inverter Efficiency", "offset": 172, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int16be", "name": "Inverter Internal Temperature", "offset": 174, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Insulation Resistance", "offset": 176, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "hex", "name": "Inverter Device Status", "offset": 178, "length": 2, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Inverter Fault Code", "offset": 180, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint32be", "name": "Inverter Total Energy Yield", "offset": 212, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "uint32be", "name": "Inverter Daily Energy Yield", "offset": 228, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 1160, "wires": [ [] ] }, { "id": "af055bcb330cb42a", "type": "buffer-parser", "z": "95db18fde30fb61d", "d": true, "name": "[x19]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "uint16be", "name": "Battery Running Status", "offset": 0, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Battery Charging Power", "offset": 2, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Battery Voltage", "offset": 6, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Battery State of Charge", "offset": 8, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Battery Working Mode", "offset": 12, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int16be", "name": "Battery Temperature", "offset": 44, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase A", "offset": 202, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase B", "offset": 206, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase C", "offset": 210, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase A", "offset": 214, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase B", "offset": 218, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase C", "offset": 222, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Active Power", "offset": 226, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Meter Reactive Power", "offset": 230, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int16be", "name": "Meter Power Factor", "offset": 234, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int16be", "name": "Meter Grid Frequency", "offset": 236, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Positive active power", "offset": 238, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "int32be", "name": "Meter Reverse active power", "offset": 242, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "int32be", "name": "Meter Accumulated reactive power", "offset": 246, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 1200, "wires": [ [] ] }, { "id": "c6c92844cc2247b9", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "Alte Parser", "info": "", "x": 420, "y": 1160, "wires": [] }, { "id": "8a19bc3339309740", "type": "comment", "z": "95db18fde30fb61d", "name": "Long interval (statistical data)", "info": "", "x": 180, "y": 840, "wires": [] }, { "id": "be3be65f7a8a1704", "type": "comment", "z": "95db18fde30fb61d", "name": "Short interval (automation data)", "info": "", "x": 190, "y": 580, "wires": [] }, { "id": "40222ab163785b5f", "type": "ioBroker out", "z": "95db18fde30fb61d", "name": "", "topic": "", "ack": "true", "autoCreate": "true", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1160, "y": 680, "wires": [] }, { "id": "4f39b75b527ebad0", "type": "subflow:6e802f1553b18149", "z": "95db18fde30fb61d", "name": "", "x": 930, "y": 680, "wires": [ [ "40222ab163785b5f" ] ] }, { "id": "7be54fe85cdbbcca", "type": "debug", "z": "95db18fde30fb61d", "name": "dbg_ShortInterval_Join_Output", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 950, "y": 620, "wires": [] }, { "id": "5f373c64d81321b1", "type": "buffer-parser", "z": "95db18fde30fb61d", "d": true, "name": " [x20]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int16be", "name": "PV1 Voltage", "offset": 32, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int16be", "name": "PV1 Current", "offset": 34, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int16be", "name": "PV2 Voltage", "offset": 36, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int16be", "name": "PV2 Current", "offset": 38, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase A Voltage", "offset": 138, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase B Voltage", "offset": 140, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase C Voltage", "offset": 142, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Inverter Phase A Current", "offset": 144, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Phase B Current", "offset": 148, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Phase C Current", "offset": 152, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Reactive Power", "offset": 164, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int16be", "name": "Inverter Power Factor", "offset": 168, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "uint16be", "name": "Inverter Grid Frequency", "offset": 170, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "uint16be", "name": "Inverter Efficiency", "offset": 172, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int16be", "name": "Inverter Internal Temperature", "offset": 174, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Insulation Resistance", "offset": 176, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "hex", "name": "Inverter Device Status", "offset": 178, "length": 2, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Inverter Fault Code", "offset": 180, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint32be", "name": "Inverter Total Energy Yield", "offset": 212, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "uint32be", "name": "Inverter Daily Energy Yield", "offset": 228, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 850, "y": 1160, "wires": [ [] ] }, { "id": "1fd872d057419dc0", "type": "buffer-parser", "z": "95db18fde30fb61d", "d": true, "name": "[x17]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "uint16be", "name": "Battery Running Status", "offset": 0, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Battery Voltage", "offset": 6, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Battery State of Charge", "offset": 8, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Battery Working Mode", "offset": 12, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int16be", "name": "Battery Temperature", "offset": 44, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase A", "offset": 202, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase B", "offset": 206, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase C", "offset": 210, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase A", "offset": 214, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase B", "offset": 218, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase C", "offset": 222, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Reactive Power", "offset": 230, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int16be", "name": "Meter Power Factor", "offset": 234, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int16be", "name": "Meter Grid Frequency", "offset": 236, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Positive active power", "offset": 238, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "int32be", "name": "Meter Reverse active power", "offset": 242, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "int32be", "name": "Meter Accumulated reactive power", "offset": 246, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 850, "y": 1200, "wires": [ [] ] }, { "id": "e268f98e73a1a2f9", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "Neue Parser?", "info": "", "x": 710, "y": 1160, "wires": [] }, { "id": "b29392128d3eec41", "type": "buffer-parser", "z": "95db18fde30fb61d", "name": " [x22]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int16be", "name": "PV1 Voltage", "offset": 32, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int16be", "name": "PV1 Current", "offset": 34, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int16be", "name": "PV2 Voltage", "offset": 36, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int16be", "name": "PV2 Current", "offset": 38, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Input Power", "offset": 128, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase A Voltage", "offset": 138, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase B Voltage", "offset": 140, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Phase C Voltage", "offset": 142, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Inverter Phase A Current", "offset": 144, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Phase B Current", "offset": 148, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Phase C Current", "offset": 152, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int32be", "name": "Inverter Active Power", "offset": 160, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Inverter Reactive Power", "offset": 164, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int16be", "name": "Inverter Power Factor", "offset": 168, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "uint16be", "name": "Inverter Grid Frequency", "offset": 170, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "uint16be", "name": "Inverter Efficiency", "offset": 172, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int16be", "name": "Inverter Internal Temperature", "offset": 174, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Inverter Insulation Resistance", "offset": 176, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "hex", "name": "Inverter Device Status", "offset": 178, "length": 2, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Inverter Fault Code", "offset": 180, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint32be", "name": "Inverter Total Energy Yield", "offset": 212, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "uint32be", "name": "Inverter Daily Energy Yield", "offset": 228, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 980, "wires": [ [ "175165bec5f95995" ] ] }, { "id": "a7e9680bf89b4542", "type": "buffer-parser", "z": "95db18fde30fb61d", "name": "[x19]", "data": "responseBuffer.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "uint16be", "name": "Battery Running Status", "offset": 0, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Battery Charging Power", "offset": 2, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "uint16be", "name": "Battery Voltage", "offset": 6, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Battery State of Charge", "offset": 8, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "uint16be", "name": "Battery Working Mode", "offset": 12, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int16be", "name": "Battery Temperature", "offset": 44, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase A", "offset": 202, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase B", "offset": 206, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Voltage Phase C", "offset": 210, "length": 1, "offsetbit": 0, "scale": "/10", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase A", "offset": 214, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase B", "offset": 218, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Grid Current Phase C", "offset": 222, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Active Power", "offset": 226, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int32be", "name": "Meter Reactive Power", "offset": 230, "length": 1, "offsetbit": 0, "scale": "1", "mask": "" }, { "type": "int16be", "name": "Meter Power Factor", "offset": 234, "length": 1, "offsetbit": 0, "scale": "/1000", "mask": "" }, { "type": "int16be", "name": "Meter Grid Frequency", "offset": 236, "length": 1, "offsetbit": 0, "scale": "/100", "mask": "" }, { "type": "int32be", "name": "Meter Positive active power", "offset": 238, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "int32be", "name": "Meter Reverse active power", "offset": 242, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" }, { "type": "int32be", "name": "Meter Accumulated reactive power", "offset": 246, "length": 1, "offsetbit": 0, "scale": "*10", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "output", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 550, "y": 1040, "wires": [ [ "175165bec5f95995" ] ] }, { "id": "6deba48172e07c6a", "type": "inject", "z": "95db18fde30fb61d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 150, "y": 220, "wires": [ [ "08cc2593d15694af", "e81e1164f72222f9" ] ] }, { "id": "08cc2593d15694af", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "set", "p": "counter", "pt": "flow", "to": "0", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 340, "y": 200, "wires": [ [] ] }, { "id": "e86f5eedd463bca3", "type": "comment", "z": "95db18fde30fb61d", "name": "READ ME - required node-red modules", "info": "node-red-contrib-calc\nnode-red-contrib-buffer-parser\nnode-red-contrib-modbus\n\nnode-red-contrib-influxdb\n -> required for writing long interval\n values to time series DB \"influxDB\"\n\nnode-red-contrib-sun-position\n -> required for solar forecast flow", "x": 210, "y": 100, "wires": [] }, { "id": "41d0684bec69093f", "type": "function", "z": "95db18fde30fb61d", "name": "Counter", "func": "// initialize var and parse flow value\n// default value is 0\nvar counter = flow.get(\"counter\") || 0\n\n// Reset counter, or increment?\nif (msg.topic == \"reset\") {\n counter = 0\n} else {\n counter ++\n}\n\n// write counter value to flow variable\nflow.set(\"counter\", counter)\n\n// write counter value to message payload\nmsg.payload = counter\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 220, "y": 460, "wires": [ [ "3c2fcb2895934ffd" ] ] }, { "id": "c587b4b11048cf99", "type": "comment", "z": "95db18fde30fb61d", "name": "Initialize variables", "info": "", "x": 150, "y": 160, "wires": [] }, { "id": "3c2fcb2895934ffd", "type": "switch", "z": "95db18fde30fb61d", "name": "", "property": "counter", "propertyType": "flow", "rules": [ { "t": "lt", "v": "12", "vt": "str" }, { "t": "gte", "v": "12", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 210, "y": 500, "wires": [ [ "63b7400518aa73ae" ], [ "acecf371b46e5843" ] ] }, { "id": "acecf371b46e5843", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "set", "p": "counter", "pt": "flow", "to": "0", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 220, "y": 920, "wires": [ [ "ef91022a521e3b4d" ] ] }, { "id": "135a55ba2897f3da", "type": "comment", "z": "95db18fde30fb61d", "name": "Initiate heartbeat", "info": "", "x": 140, "y": 300, "wires": [] }, { "id": "f4a83a09c427d3e0", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "-> increment 1 with every beat", "info": "", "x": 440, "y": 460, "wires": [] }, { "id": "64c576806ac5f1a4", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "counter <12: short interval", "info": "", "x": 430, "y": 500, "wires": [] }, { "id": "d4c63c26fa0ff915", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "counter >=12: long interval", "info": "", "x": 430, "y": 540, "wires": [] }, { "id": "edddd62113fbce94", "type": "comment", "z": "95db18fde30fb61d", "name": "Reset counter", "info": "", "x": 410, "y": 920, "wires": [] }, { "id": "8bc45ccae0511aba", "type": "modbus-write", "z": "95db18fde30fb61d", "d": true, "name": "47082 (Bat Discharge cutof capacity SET)", "showStatusActivities": false, "showErrors": true, "unitid": "2", "dataType": "HoldingRegister", "adr": "47082", "quantity": "1", "server": "70220ecd.1ca1e", "emptyMsgOnFail": false, "keepMsgProperties": false, "x": 560, "y": 1440, "wires": [ [], [] ] }, { "id": "ac1d555a73fa8f93", "type": "ioBroker in", "z": "95db18fde30fb61d", "d": true, "name": "JSON_test", "topic": "javascript.0.eigene_variablen.JSON_test", "payloadType": "value", "onlyack": "", "func": "all", "gap": "", "fireOnStart": "false", "x": 130, "y": 1440, "wires": [ [ "8bc45ccae0511aba", "e9b5676c457b2f02" ] ] }, { "id": "e9b5676c457b2f02", "type": "modbus-write", "z": "95db18fde30fb61d", "d": true, "name": "47078 (Bat Max Discharge Power)", "showStatusActivities": false, "showErrors": true, "unitid": "2", "dataType": "HoldingRegister", "adr": "47078", "quantity": "1", "server": "70220ecd.1ca1e", "emptyMsgOnFail": false, "keepMsgProperties": false, "x": 540, "y": 1500, "wires": [ [], [] ] }, { "id": "b7c8eb25732548b4", "type": "comment", "z": "95db18fde30fb61d", "name": "Writing to registers - WIP", "info": "", "x": 170, "y": 1380, "wires": [] }, { "id": "277d19cdad324bb4", "type": "ioBroker in", "z": "95db18fde30fb61d", "d": true, "name": "Battery_Max_Discharge_Power_SET", "topic": "0_userdata.0.Huawei.Battery.Battery_Max_Discharge_Power_SET", "payloadType": "value", "onlyack": "", "func": "all", "gap": "", "fireOnStart": "false", "x": 210, "y": 1620, "wires": [ [ "f475710974dd4f72", "f8a0c2685c545991" ] ] }, { "id": "f475710974dd4f72", "type": "function", "z": "95db18fde30fb61d", "d": true, "name": "", "func": "var fc=16;\nvar sa=50;\nvar addresses=2;\nvar buf=Buffer.alloc(4);//create buffer\nbuf.writeInt32BE(msg.payload);\nvar values=[(buf[0]*256+buf[1]),(buf[2]*256)+buf[3]]\nmsg.slave_ip=\"192.168.1.76\";\nmsg.payload=values;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 500, "y": 1620, "wires": [ [ "e3e7d8a6a73f4f41" ] ] }, { "id": "e3e7d8a6a73f4f41", "type": "modbus-write", "z": "95db18fde30fb61d", "d": true, "name": "47077 (Max Discharge Power)", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "2", "dataType": "MHoldingRegisters", "adr": "47077", "quantity": "2", "server": "70220ecd.1ca1e", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 810, "y": 1620, "wires": [ [], [] ] }, { "id": "3d97649554c43897", "type": "ioBroker in", "z": "95db18fde30fb61d", "d": true, "name": "Battery_Max_Charge_Power_SET", "topic": "0_userdata.0.Huawei.Battery.Battery_Max_Charge_Power_SET", "payloadType": "value", "onlyack": "", "func": "all", "gap": "", "fireOnStart": "false", "x": 210, "y": 1700, "wires": [ [ "6fd103e078669e42", "f8a0c2685c545991" ] ] }, { "id": "6fd103e078669e42", "type": "function", "z": "95db18fde30fb61d", "d": true, "name": "", "func": "var fc=16;\nvar sa=50;\nvar addresses=2;\nvar buf=Buffer.alloc(4);//create buffer\nbuf.writeInt32BE(msg.payload);\nvar values=[(buf[0]*256+buf[1]),(buf[2]*256)+buf[3]]\nmsg.slave_ip=\"192.168.1.76\";\nmsg.payload=values;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 500, "y": 1700, "wires": [ [ "16cb74b6a9ea2d7a" ] ] }, { "id": "16cb74b6a9ea2d7a", "type": "modbus-write", "z": "95db18fde30fb61d", "d": true, "name": "47075 (Max Charge Power)", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "2", "dataType": "MHoldingRegisters", "adr": "47075", "quantity": "2", "server": "70220ecd.1ca1e", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 800, "y": 1700, "wires": [ [], [] ] }, { "id": "77058cd920e6a5f8", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "Battery charge and discharge settings", "info": "", "x": 210, "y": 1560, "wires": [] }, { "id": "f8a0c2685c545991", "type": "change", "z": "95db18fde30fb61d", "d": true, "name": "", "rules": [ { "t": "set", "p": "pause", "pt": "flow", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 520, "y": 1780, "wires": [ [ "68e1bee10813ce0e" ] ] }, { "id": "68e1bee10813ce0e", "type": "trigger", "z": "95db18fde30fb61d", "d": true, "name": "", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "20", "extend": false, "overrideDelay": false, "units": "s", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 710, "y": 1780, "wires": [ [ "4bdf2704cd4c3dba" ] ] }, { "id": "4bdf2704cd4c3dba", "type": "change", "z": "95db18fde30fb61d", "d": true, "name": "", "rules": [ { "t": "set", "p": "pause", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 970, "y": 1780, "wires": [ [] ] }, { "id": "a1c32e70ef3e047a", "type": "ioBroker in", "z": "95db18fde30fb61d", "d": true, "name": "Workingmode_Change_2 max self_ 5TOU", "topic": "0_userdata.0.Huawei.Battery.Battery_Working_Mode_2_5", "payloadType": "value", "onlyack": "", "func": "all", "gap": "", "fireOnStart": "false", "outFormat": "MQTT", "x": 220, "y": 1840, "wires": [ [ "6ad552c2bf3e178e", "f8a0c2685c545991" ] ] }, { "id": "4f2a7ddaba0401ee", "type": "modbus-write", "z": "95db18fde30fb61d", "d": true, "name": "47086 (Workingmode)", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "2", "dataType": "HoldingRegister", "adr": "47086", "quantity": "1", "server": "70220ecd.1ca1e", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 780, "y": 1840, "wires": [ [], [] ] }, { "id": "6ad552c2bf3e178e", "type": "function", "z": "95db18fde30fb61d", "d": true, "name": "", "func": "var sa = 50; // Startadresse des Registers\nvar address = 1; // Adressen des Registers\nvar value = msg.payload; // Wert, den du schreiben möchtest (16-Bit)\n\nvar buf = Buffer.alloc(2);\nbuf.writeUInt16BE(value); // Schreibe den 16-Bit Wert in den Buffer\n\nmsg.payload = {\n 'fc': 6, // Funktion 6 für das Schreiben eines einzelnen Registers\n 'unitid': 2, // Modbus-Geräte-ID\n 'value': buf.readUInt16BE(0) // Lese den Wert aus dem Buffer\n};\n\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 500, "y": 1840, "wires": [ [ "4f2a7ddaba0401ee" ] ] }, { "id": "5f5f9b51c0f5ac7b", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "2: Max Eigenverbrauch / 5: TOU (Netzladen)", "info": "", "x": 350, "y": 1880, "wires": [] }, { "id": "876a89588ea10a78", "type": "switch", "z": "95db18fde30fb61d", "name": "Pause ?", "property": "pause", "propertyType": "flow", "rules": [ { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 220, "y": 400, "wires": [ [ "41d0684bec69093f" ] ] }, { "id": "726d848ebcc4341c", "type": "comment", "z": "95db18fde30fb61d", "d": true, "name": "-> pause register query, if register is being written", "info": "", "x": 500, "y": 400, "wires": [] }, { "id": "e81e1164f72222f9", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "set", "p": "pause", "pt": "flow", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 340, "y": 240, "wires": [ [] ] }, { "id": "0578daa5ee6f5af9", "type": "influxdb out", "z": "95db18fde30fb61d", "influxdb": "d05a24a2.774be8", "name": "PVdaten -> InfluxDB", "measurement": "PVdaten", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "organisation", "bucket": "bucket", "x": 920, "y": 1080, "wires": [] }, { "id": "f546d5e2fa9676c9", "type": "http request", "z": "95db18fde30fb61d", "name": "Solcast API - get Live+Forecast JSON", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "bearer", "senderr": false, "headers": [], "x": 1110, "y": 2540, "wires": [ [ "e806024df5118ea7" ] ] }, { "id": "2f2c146b50e3d5af", "type": "debug", "z": "95db18fde30fb61d", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1390, "y": 2500, "wires": [] }, { "id": "3f7ba678709884f9", "type": "http request", "z": "95db18fde30fb61d", "name": "Solcast API - get Past + Estimated Actuals", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "bearer", "senderr": false, "headers": [], "x": 920, "y": 2660, "wires": [ [ "e806024df5118ea7" ] ] }, { "id": "e806024df5118ea7", "type": "switch", "z": "95db18fde30fb61d", "name": "StatusCode", "property": "statusCode", "propertyType": "msg", "rules": [ { "t": "eq", "v": "200", "vt": "num" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1210, "y": 2660, "wires": [ [ "d62b0e19887d05e9" ], [ "2f2c146b50e3d5af", "3cee6ee93a99c131" ] ] }, { "id": "1277b7d03e105aea", "type": "split", "z": "95db18fde30fb61d", "name": "", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "x": 970, "y": 2860, "wires": [ [ "2c7f8c84d9b46b45" ] ] }, { "id": "646cacbdd979be2f", "type": "join", "z": "95db18fde30fb61d", "name": "", "mode": "auto", "build": "string", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 1350, "y": 2880, "wires": [ [ "11f4a030cdeae649" ] ] }, { "id": "2c7f8c84d9b46b45", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "[[\t{\"value\": $.payload.pv_estimate * 1000,\t\"time\": $toMillis($.payload.period_end)},\t{\"topic\": \"pv_initial_estimate\"}\t],\t[\t{\"value\": $.payload.pv_estimate * 1000,\t\"time\": $toMillis($.payload.period_end)},\t{\"topic\": \"pv_estimate\"}\t],\t[\t{\"value\": $.payload.pv_estimate10 * 1000,\t\"time\": $toMillis($.payload.period_end)},\t{\"topic\": \"pv_estimate10\"}\t],\t[\t{\"value\": $.payload.pv_estimate90 * 1000,\t\"time\": $toMillis($.payload.period_end)},\t{\"topic\": \"pv_estimate90\"}\t]\t]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1120, "y": 2860, "wires": [ [ "646cacbdd979be2f", "8f8d4fb6e380029e" ] ] }, { "id": "8f8d4fb6e380029e", "type": "influxdb out", "z": "95db18fde30fb61d", "influxdb": "d05a24a2.774be8", "name": "Solcast -> InfluxDB", "measurement": "solcast", "precision": "ms", "retentionPolicy": "", "database": "", "retentionPolicyV18Flux": "", "org": "", "bucket": "", "x": 1350, "y": 2840, "wires": [] }, { "id": "b3e354e2fe07e0ae", "type": "time-inject", "z": "95db18fde30fb61d", "name": "forecasts", "nameInt": "sunrise start↶ - sunset end↷ = timestamp ↻90min", "positionConfig": "8c7609ce.dd5798", "props": [ { "p": "", "pt": "msgPayload", "v": "", "vt": "date", "o": "1", "oT": "none", "oM": "60000", "f": 0, "fS": 0, "fT": "UNIX timestamp (ms)", "fI": "0", "next": true, "days": "*", "months": "*", "onlyOddDays": false, "onlyEvenDays": false, "onlyOddWeeks": false, "onlyEvenWeeks": false }, { "p": "", "pt": "msgTopic", "v": "forecasts", "vt": "str", "o": "1", "oT": "none", "oM": "60000", "f": 0, "fS": 0, "fT": "UNIX timestamp (ms)", "fI": "0", "next": false, "days": "*", "months": "*", "onlyOddDays": false, "onlyEvenDays": false, "onlyOddWeeks": false, "onlyEvenWeeks": false } ], "injectTypeSelect": "interval-time", "intervalCount": "90", "intervalCountType": "num", "intervalCountMultiplier": 60000, "time": "sunriseStart", "timeType": "pdsTime", "offset": "-15", "offsetType": "num", "offsetMultiplier": 60000, "timeEnd": "sunsetEnd", "timeEndType": "pdsTime", "timeEndOffset": "15", "timeEndOffsetType": "num", "timeEndOffsetMultiplier": 60000, "timeDays": "*", "timeOnlyOddDays": false, "timeOnlyEvenDays": false, "timeOnlyOddWeeks": false, "timeOnlyEvenWeeks": false, "timeMonths": "*", "timedatestart": "", "timedateend": "", "property": "", "propertyType": "none", "propertyCompare": "true", "propertyThreshold": "", "propertyThresholdType": "num", "timeAlt": "", "timeAltType": "entered", "timeAltDays": "*", "timeAltOnlyOddDays": false, "timeAltOnlyEvenDays": false, "timeAltOnlyOddWeeks": false, "timeAltOnlyEvenWeeks": false, "timeAltMonths": "*", "timeAltOffset": 0, "timeAltOffsetType": "none", "timeAltOffsetMultiplier": 60000, "once": false, "onceDelay": 0.1, "recalcTime": 2, "x": 240, "y": 2340, "wires": [ [ "1c9303f7662d9822" ] ] }, { "id": "3cee6ee93a99c131", "type": "change", "z": "95db18fde30fb61d", "name": "timestamp", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "", "tot": "date" }, { "t": "delete", "p": "statusCode", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1010, "y": 2600, "wires": [ [ "aca4857554dec12b" ] ] }, { "id": "aca4857554dec12b", "type": "delay", "z": "95db18fde30fb61d", "name": "", "pauseType": "delay", "timeout": "3", "timeoutUnits": "minutes", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "outputs": 1, "x": 1180, "y": 2600, "wires": [ [ "4a838ef78c945aba" ] ] }, { "id": "1c9303f7662d9822", "type": "within-time-switch", "z": "95db18fde30fb61d", "name": "neuer Tag?", "nameInt": "", "positionConfig": "8c7609ce.dd5798", "startTime": "sunriseStart", "startTimeType": "pdsTime", "startOffset": "-15", "startOffsetType": "num", "startOffsetMultiplier": 60000, "endTime": "sunsetEnd", "endTimeType": "pdsTime", "endOffset": "60", "endOffsetType": "num", "endOffsetMultiplier": 60000, "timeRestrictions": "", "timeRestrictionsType": "none", "timeDays": "*", "timeOnlyOddDays": false, "timeOnlyEvenDays": false, "timeMonths": "*", "timedatestart": "", "timedateend": "", "propertyStart": "", "propertyStartType": "none", "propertyStartCompare": "true", "propertyStartThreshold": "", "propertyStartThresholdType": "num", "startTimeAlt": "", "startTimeAltType": "entered", "startOffsetAlt": 0, "startOffsetAltType": "none", "startOffsetAltMultiplier": 60000, "propertyEnd": "", "propertyEndType": "none", "propertyEndCompare": "true", "propertyEndThreshold": "", "propertyEndThresholdType": "num", "endTimeAlt": "", "endTimeAltType": "entered", "endOffsetAlt": 0, "endOffsetAltType": "none", "endOffsetAltMultiplier": 60000, "withinTimeValueType": "msgInput", "outOfTimeValueType": "msgInput", "tsCompare": "0", "x": 490, "y": 2300, "wires": [ [ "4a838ef78c945aba" ], [ "7fbddbe3c5b8c1c4" ] ] }, { "id": "447d77a08785da4c", "type": "inject", "z": "95db18fde30fb61d", "name": "forecasts", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "forecasts", "payload": "", "payloadType": "date", "x": 240, "y": 2520, "wires": [ [ "4a838ef78c945aba" ] ] }, { "id": "7fbddbe3c5b8c1c4", "type": "change", "z": "95db18fde30fb61d", "name": "reset counter", "rules": [ { "t": "set", "p": "reset", "pt": "msg", "to": "true", "tot": "bool" }, { "t": "set", "p": "topic.reset", "pt": "msg", "to": "reset", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 690, "y": 2260, "wires": [ [ "4a838ef78c945aba" ] ] }, { "id": "4a838ef78c945aba", "type": "counter", "z": "95db18fde30fb61d", "name": "Counter", "init": "0", "step": "1", "lower": null, "upper": null, "mode": "increment", "outputs": "1", "x": 900, "y": 2300, "wires": [ [ "086bdb1ae596cc5d", "7452446e4065550d" ] ] }, { "id": "0309f1b42805ff85", "type": "switch", "z": "95db18fde30fb61d", "name": "counter", "property": "count", "propertyType": "msg", "rules": [ { "t": "btwn", "v": "1", "vt": "num", "v2": "20", "v2t": "num" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1240, "y": 2280, "wires": [ [ "0f2fd78486578abf" ], [ "2f2c146b50e3d5af" ] ] }, { "id": "086bdb1ae596cc5d", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "delete", "p": "reset", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1070, "y": 2280, "wires": [ [ "0309f1b42805ff85" ] ] }, { "id": "d62b0e19887d05e9", "type": "switch", "z": "95db18fde30fb61d", "name": "", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "estimated_actuals", "vt": "str" }, { "t": "eq", "v": "forecasts", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 473, "y": 2840, "wires": [ [ "04d95565580b5d09" ], [ "237dc5a833be3982" ] ] }, { "id": "cf0594fe1a3cfda9", "type": "split", "z": "95db18fde30fb61d", "name": "", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "x": 970, "y": 2820, "wires": [ [ "195ab70579255122" ] ] }, { "id": "195ab70579255122", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "[\t{\"value\": $.payload.pv_estimate * 1000,\t\"time\": $toMillis($.payload.period_end)},\t{\"topic\": \"pv_estimate\"}\t]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1120, "y": 2820, "wires": [ [ "c1c148b348b5acc7", "8f8d4fb6e380029e" ] ] }, { "id": "16f83586c36dcb3b", "type": "inject", "z": "95db18fde30fb61d", "name": "tägl. 02:00Uhr", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "00 02 * * *", "once": false, "onceDelay": 0.1, "topic": "Counter_Reset", "payload": "", "payloadType": "date", "x": 260, "y": 2200, "wires": [ [ "1c9303f7662d9822" ] ] }, { "id": "066ba6f8d5709a61", "type": "time-inject", "z": "95db18fde30fb61d", "name": "estimated_actuals", "nameInt": "sunrise start↷ - sunset end↷ = timestamp ↻4h", "positionConfig": "8c7609ce.dd5798", "props": [ { "p": "", "pt": "msgPayload", "v": "", "vt": "date", "o": "1", "oT": "none", "oM": "60000", "f": 0, "fS": 0, "fT": "UNIX timestamp (ms)", "fI": "0", "next": true, "days": "*", "months": "*", "onlyOddDays": false, "onlyEvenDays": false, "onlyOddWeeks": false, "onlyEvenWeeks": false }, { "p": "", "pt": "msgTopic", "v": "estimated_actuals", "vt": "str", "o": "1", "oT": "none", "oM": "60000", "f": 0, "fS": 0, "fT": "UNIX timestamp (ms)", "fI": "0", "next": false, "days": "*", "months": "*", "onlyOddDays": false, "onlyEvenDays": false, "onlyOddWeeks": false, "onlyEvenWeeks": false } ], "injectTypeSelect": "interval-time", "intervalCount": "4", "intervalCountType": "num", "intervalCountMultiplier": 3600000, "time": "sunriseStart", "timeType": "pdsTime", "offset": "90", "offsetType": "num", "offsetMultiplier": 60000, "timeEnd": "sunsetEnd", "timeEndType": "pdsTime", "timeEndOffset": "60", "timeEndOffsetType": "num", "timeEndOffsetMultiplier": 60000, "timeDays": "*", "timeOnlyOddDays": false, "timeOnlyEvenDays": false, "timeOnlyOddWeeks": false, "timeOnlyEvenWeeks": false, "timeMonths": "*", "timedatestart": "", "timedateend": "", "property": "", "propertyType": "none", "propertyCompare": "true", "propertyThreshold": "", "propertyThresholdType": "num", "timeAlt": "", "timeAltType": "entered", "timeAltDays": "*", "timeAltOnlyOddDays": false, "timeAltOnlyEvenDays": false, "timeAltOnlyOddWeeks": false, "timeAltOnlyEvenWeeks": false, "timeAltMonths": "*", "timeAltOffset": 0, "timeAltOffsetType": "none", "timeAltOffsetMultiplier": 60000, "once": false, "onceDelay": 0.1, "recalcTime": 2, "x": 270, "y": 2380, "wires": [ [ "1c9303f7662d9822" ] ] }, { "id": "0f2fd78486578abf", "type": "switch", "z": "95db18fde30fb61d", "name": "topic", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "estimated_actuals", "vt": "str" }, { "t": "eq", "v": "forecasts", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 850, "y": 2540, "wires": [ [ "3f7ba678709884f9" ], [ "f546d5e2fa9676c9" ] ] }, { "id": "8d35574ab430a1fd", "type": "inject", "z": "95db18fde30fb61d", "name": "estimated_actuals", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "estimated_actuals", "payload": "", "payloadType": "date", "x": 270, "y": 2560, "wires": [ [ "4a838ef78c945aba" ] ] }, { "id": "c2d341c890e280e5", "type": "comment", "z": "95db18fde30fb61d", "name": "Manual queries", "info": "", "x": 220, "y": 2480, "wires": [] }, { "id": "191152a4d9e1ed02", "type": "comment", "z": "95db18fde30fb61d", "name": "Timed queries", "info": "", "x": 210, "y": 2300, "wires": [] }, { "id": "be626e78a73a97c6", "type": "comment", "z": "95db18fde30fb61d", "name": "query API", "info": "", "x": 960, "y": 2480, "wires": [] }, { "id": "12b48c16fb10a043", "type": "comment", "z": "95db18fde30fb61d", "name": "Write forecast to InfluxDB", "info": "", "x": 470, "y": 2780, "wires": [] }, { "id": "072f49c2aa177496", "type": "comment", "z": "95db18fde30fb61d", "name": "1-20 API calls/day possible", "info": "", "x": 1036, "y": 2221, "wires": [] }, { "id": "c1c148b348b5acc7", "type": "join", "z": "95db18fde30fb61d", "name": "", "mode": "auto", "build": "string", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 1350, "y": 2800, "wires": [ [ "11f4a030cdeae649" ] ] }, { "id": "11f4a030cdeae649", "type": "debug", "z": "95db18fde30fb61d", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1570, "y": 2840, "wires": [] }, { "id": "237dc5a833be3982", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "move", "p": "payload.forecasts", "pt": "msg", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 700, "y": 2860, "wires": [ [ "1277b7d03e105aea", "ce330e277a3175d8" ] ] }, { "id": "04d95565580b5d09", "type": "change", "z": "95db18fde30fb61d", "name": "", "rules": [ { "t": "move", "p": "payload.estimated_actuals", "pt": "msg", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 730, "y": 2820, "wires": [ [ "cf0594fe1a3cfda9", "f576dab05a1bccdb" ] ] }, { "id": "66a86f39834b4045", "type": "comment", "z": "95db18fde30fb61d", "name": "Reset API call counter", "info": "", "x": 240, "y": 2120, "wires": [] }, { "id": "568f20b06b17eacb", "type": "inject", "z": "95db18fde30fb61d", "name": "Counter_Reset", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "Counter_Reset", "payload": "", "payloadType": "date", "x": 260, "y": 2160, "wires": [ [ "7fbddbe3c5b8c1c4" ] ] }, { "id": "7452446e4065550d", "type": "debug", "z": "95db18fde30fb61d", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "count", "targetType": "msg", "x": 1061, "y": 2321, "wires": [] }, { "id": "f576dab05a1bccdb", "type": "debug", "z": "95db18fde30fb61d", "name": "estimate_debug", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1080, "y": 2760, "wires": [] }, { "id": "ce330e277a3175d8", "type": "debug", "z": "95db18fde30fb61d", "name": "forecast_debug", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1080, "y": 2920, "wires": [] }, { "id": "bec1c3933ae78290", "type": "comment", "z": "95db18fde30fb61d", "name": "IMPORTANT - forecast vs. estimate", "info": "https://articles.solcast.com.au/en/articles/2348589-the-difference-between-estimated-actuals-and-forecasts\n\nForecast = Forecasts, aber\nEstimated Actuals sollten den Forecast nicht überschreiben, wenn es um die Erkennung der Genautigkeit geht!", "x": 720, "y": 2900, "wires": [] }, { "id": "398c18cd27a04eeb", "type": "comment", "z": "95db18fde30fb61d", "name": "Solcast solar forecast query", "info": "", "x": 160, "y": 2060, "wires": [] }, { "id": "e0d3f71d5d5773e1", "type": "comment", "z": "95db18fde30fb61d", "name": "Report back actual solar power to Solcast", "info": "", "x": 200, "y": 3040, "wires": [] }, { "id": "f37803a76460e692", "type": "influxdb in", "z": "95db18fde30fb61d", "influxdb": "d05a24a2.774be8", "name": "PV Power PT5M", "query": "", "rawOutput": false, "precision": "", "retentionPolicy": "", "org": "", "x": 820, "y": 3320, "wires": [ [ "c57e2399957b5524" ] ] }, { "id": "0de21ca7d8e521df", "type": "debug", "z": "95db18fde30fb61d", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "x": 1310, "y": 3640, "wires": [] }, { "id": "55c18ab43b0ac058", "type": "change", "z": "95db18fde30fb61d", "name": "umbau POST measurements", "rules": [ { "t": "set", "p": "measurements", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "delete", "p": "payload", "pt": "msg" }, { "t": "set", "p": "payload.measurements", "pt": "msg", "to": "measurements", "tot": "msg" }, { "t": "delete", "p": "measurements", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 560, "y": 3640, "wires": [ [ "acdff7f0370a078f", "0fb554c661ae3e9a" ] ] }, { "id": "c57e2399957b5524", "type": "split", "z": "95db18fde30fb61d", "name": "", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "x": 750, "y": 3500, "wires": [ [ "14d974e2744e39fb" ] ] }, { "id": "a1df312b522e7e24", "type": "join", "z": "95db18fde30fb61d", "name": "", "mode": "auto", "build": "string", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 1150, "y": 3500, "wires": [ [ "55c18ab43b0ac058" ] ] }, { "id": "14d974e2744e39fb", "type": "change", "z": "95db18fde30fb61d", "name": "umbau auf solcast payload", "rules": [ { "t": "set", "p": "payload.period_end", "pt": "msg", "to": "payload.time", "tot": "msg" }, { "t": "set", "p": "payload.total_power", "pt": "msg", "to": "payload.mean", "tot": "msg" }, { "t": "set", "p": "payload.period", "pt": "msg", "to": "PT5M", "tot": "str" }, { "t": "delete", "p": "payload.time", "pt": "msg" }, { "t": "delete", "p": "payload.mean", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 954, "y": 3500, "wires": [ [ "a1df312b522e7e24" ] ] }, { "id": "acdff7f0370a078f", "type": "http request", "z": "95db18fde30fb61d", "name": "Solcast API - post measurements", "method": "POST", "ret": "txt", "paytoqs": "ignore", "url": "", "tls": "", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "bearer", "senderr": false, "headers": [], "x": 860, "y": 3640, "wires": [ [ "73ed424e8ae82176" ] ] }, { "id": "73ed424e8ae82176", "type": "switch", "z": "95db18fde30fb61d", "name": "StatusCode", "property": "statusCode", "propertyType": "msg", "rules": [ { "t": "eq", "v": "200", "vt": "num" }, { "t": "btwn", "v": "399", "vt": "num", "v2": "501", "v2t": "num" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 1110, "y": 3640, "wires": [ [ "0de21ca7d8e521df" ], [ "0de21ca7d8e521df" ], [ "0de21ca7d8e521df", "240f26df4838b90e" ] ] }, { "id": "240f26df4838b90e", "type": "change", "z": "95db18fde30fb61d", "name": "timestamp", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "", "tot": "date" }, { "t": "delete", "p": "statusCode", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 530, "y": 3720, "wires": [ [ "e0a4bbde09c41e69" ] ] }, { "id": "e0a4bbde09c41e69", "type": "delay", "z": "95db18fde30fb61d", "name": "", "pauseType": "delay", "timeout": "5", "timeoutUnits": "minutes", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "outputs": 1, "x": 320, "y": 3760, "wires": [ [ "c91beb34ddc919cc" ] ] }, { "id": "691ffedd187dbcd7", "type": "inject", "z": "95db18fde30fb61d", "name": "last 25h", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "00 22 * * *", "once": false, "onceDelay": 0.1, "topic": "query", "payload": "", "payloadType": "date", "x": 220, "y": 3340, "wires": [ [ "c91beb34ddc919cc" ] ] }, { "id": "c91beb34ddc919cc", "type": "change", "z": "95db18fde30fb61d", "name": "set msg query", "rules": [ { "t": "set", "p": "query", "pt": "msg", "to": "SELECT mean(\"Input Power\") /1000 FROM \"PVdaten\" WHERE (time >= now()-25h AND time <= now()-7m) GROUP BY time(5m) fill(0)", "tot": "str" }, { "t": "delete", "p": "payload", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 520, "y": 3340, "wires": [ [ "f37803a76460e692" ] ] }, { "id": "ff5d1006ac46391b", "type": "inject", "z": "95db18fde30fb61d", "d": true, "name": "between last 48h to last 24h", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "00 22 * * *", "once": false, "onceDelay": 0.1, "topic": "query", "payload": "", "payloadType": "date", "x": 280, "y": 3420, "wires": [ [ "fe6dd2d1596f179a" ] ] }, { "id": "fe6dd2d1596f179a", "type": "change", "z": "95db18fde30fb61d", "name": "set msg query", "rules": [ { "t": "set", "p": "query", "pt": "msg", "to": "SELECT mean(\"Input Power\") /1000 FROM \"PVdaten\" WHERE (time >= now()-48h AND time <= now()-24h) GROUP BY time(5m) fill(0)", "tot": "str" }, { "t": "delete", "p": "payload", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 520, "y": 3420, "wires": [ [ "f37803a76460e692" ] ] }, { "id": "c48ea033ee2ccbca", "type": "inject", "z": "95db18fde30fb61d", "name": "last 10h", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "18000", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "query", "payload": "", "payloadType": "date", "x": 220, "y": 3500, "wires": [ [ "ee6902c61662183c" ] ] }, { "id": "ee6902c61662183c", "type": "change", "z": "95db18fde30fb61d", "name": "set msg query", "rules": [ { "t": "set", "p": "query", "pt": "msg", "to": "SELECT mean(\"Input Power\") /1000 FROM \"PVdaten\" WHERE (time >= now()-10h AND time <= now()-7m) GROUP BY time(5m) fill(0)", "tot": "str" }, { "t": "delete", "p": "payload", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 520, "y": 3500, "wires": [ [ "f37803a76460e692" ] ] }, { "id": "16f5cc9e7f6794eb", "type": "comment", "z": "95db18fde30fb61d", "name": "d", "info": "", "x": 190, "y": 3100, "wires": [] }, { "id": "aef073094a3d1679", "type": "comment", "z": "95db18fde30fb61d", "name": "weitere Abfragen und Lieferung", "info": "", "x": 350, "y": 3260, "wires": [] }, { "id": "1b93e98449a2031d", "type": "change", "z": "95db18fde30fb61d", "name": "set msg query", "rules": [ { "t": "set", "p": "query", "pt": "msg", "to": "SELECT mean(\"Input Power\") /1000 FROM \"PVdaten\" WHERE (time >= now()-1h AND time <= now()-7m) GROUP BY time(5m) fill(0)", "tot": "str" }, { "t": "delete", "p": "payload", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 560, "y": 3160, "wires": [ [ "f37803a76460e692" ] ] }, { "id": "0d4015ab597a6862", "type": "comment", "z": "95db18fde30fb61d", "name": "HTTP Response - bei Fehler (!=200) in 5min nochmal versuchen", "info": "", "x": 1270, "y": 3600, "wires": [] }, { "id": "1d70c4a09aa1874c", "type": "comment", "z": "95db18fde30fb61d", "name": "influx query", "info": "", "x": 810, "y": 3280, "wires": [] }, { "id": "54cded9ba1896204", "type": "comment", "z": "95db18fde30fb61d", "name": "solcast POST", "info": "", "x": 890, "y": 3600, "wires": [] }, { "id": "2c37b941070ae2e3", "type": "comment", "z": "95db18fde30fb61d", "name": "influx response zu solcast measurements umbauen", "info": "", "x": 930, "y": 3460, "wires": [] }, { "id": "0fb554c661ae3e9a", "type": "debug", "z": "95db18fde30fb61d", "name": "POST Message", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 840, "y": 3740, "wires": [] }, { "id": "0ab4658f0bf7b481", "type": "time-inject", "z": "95db18fde30fb61d", "name": "Request letzte Stunde", "nameInt": "sunrise start↶ - sunset end↷ = timestamp ↻30min", "positionConfig": "8c7609ce.dd5798", "props": [ { "p": "", "pt": "msgPayload", "v": "", "vt": "date", "o": "1", "oT": "none", "oM": "60000", "f": 0, "fS": 0, "fT": "UNIX timestamp (ms)", "fI": "0", "next": true, "days": "*", "months": "*", "onlyOddDays": false, "onlyEvenDays": false, "onlyOddWeeks": false, "onlyEvenWeeks": false }, { "p": "", "pt": "msgTopic", "v": "forecasts", "vt": "str", "o": "1", "oT": "none", "oM": "60000", "f": 0, "fS": 0, "fT": "UNIX timestamp (ms)", "fI": "0", "next": false, "days": "*", "months": "*", "onlyOddDays": false, "onlyEvenDays": false, "onlyOddWeeks": false, "onlyEvenWeeks": false } ], "injectTypeSelect": "interval-time", "intervalCount": "30", "intervalCountType": "num", "intervalCountMultiplier": 60000, "time": "sunriseStart", "timeType": "pdsTime", "offset": "-15", "offsetType": "num", "offsetMultiplier": 60000, "timeEnd": "sunsetEnd", "timeEndType": "pdsTime", "timeEndOffset": "15", "timeEndOffsetType": "num", "timeEndOffsetMultiplier": 60000, "timeDays": "*", "timeOnlyOddDays": false, "timeOnlyEvenDays": false, "timeOnlyOddWeeks": false, "timeOnlyEvenWeeks": false, "timeMonths": "*", "timedatestart": "", "timedateend": "", "property": "", "propertyType": "none", "propertyCompare": "true", "propertyThreshold": "", "propertyThresholdType": "num", "timeAlt": "", "timeAltType": "entered", "timeAltDays": "*", "timeAltOnlyOddDays": false, "timeAltOnlyEvenDays": false, "timeAltOnlyOddWeeks": false, "timeAltOnlyEvenWeeks": false, "timeAltMonths": "*", "timeAltOffset": 0, "timeAltOffsetType": "none", "timeAltOffsetMultiplier": 60000, "once": false, "onceDelay": 0.1, "recalcTime": 2, "x": 260, "y": 3160, "wires": [ [ "1b93e98449a2031d" ] ] }, { "id": "70220ecd.1ca1e", "type": "modbus-client", "name": "Huawei sDongle", "clienttype": "tcp", "bufferCommands": true, "stateLogEnabled": false, "queueLogEnabled": false, "failureLogEnabled": false, "tcpHost": "10.0.0.10", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "/dev/ttyUSB", "serialType": "RTU-BUFFERD", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "serialConnectionDelay": "100", "serialAsciiResponseStartDelimiter": "", "unit_id": "1", "commandDelay": "1", "clientTimeout": "5000", "reconnectOnTimeout": true, "reconnectTimeout": "2000", "parallelUnitIdsAllowed": true }, { "id": "d05a24a2.774be8", "type": "influxdb", "hostname": "10.0.0.20", "port": "8086", "protocol": "http", "database": "PVtest", "name": "", "usetls": false, "tls": "", "influxdbVersion": "1.x", "url": "", "rejectUnauthorized": false }, { "id": "8c7609ce.dd5798", "type": "position-config", "name": "Haus", "isValide": "true", "longitude": "0", "latitude": "0", "angleType": "deg", "timeZoneOffset": 99, "timeZoneDST": 0, "stateTimeFormat": "3", "stateDateFormat": "12", "contextStore": "" } ]