Photovoltaik Werte einer Kostal Piko in Node-Red

Hier ist ein „Flow“, um die Werte eines Photovoltaik-Inverters von Kostal per Node-Red auszulesen und zusätzlich als MQTT-Nachrichten zu versenden.

Der Hintergrund ist, dass die Anlage nicht per SNMP oder ähnlich gängigen Verfahren auszulesen war, sondern nur über eine Webseite die Werte anzeigte. Zwar gibt es eine Software, aber die hat meine Wünsche nicht wirklich erfüllt.

Mit diesem Flow ist es möglich, die aktuelle Leistung einer PV-Anlage aktiv alle z.B. 20 Sekunden abzufragen, und die gelieferten Werte als Diagramm im Dashboard darzustellen.

Node-Red Flow
Node-Red Flow

Zur Langzeitvisualisierung versende ich die Werte zusätzlich an ein weiteres System (Zabbix). Das sieht dann so aus:

Zabbix Visualisierung

Und hier kommt der „Flow“-Code:

[
{
"id": "347111747d6d4c72",
"type": "tab",
"label": "Kostal Pico",
"disabled": false,
"info": "",
"env": []
},
{
"id": "4ad0e46.7796d1c",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse http",
"func": "acPowerCurrent = parseInt(msg.payload[14].replace(/([^a-z0-9]+)/gi, ''));\ntotalEnergy = parseInt(msg.payload[17].replace(/([^A-Z0-9]+)/gi, ''));\ndailyEnergy = parseInt(msg.payload[26].replace(/([^a-z0-9]+)/gi, ''))/100;\nstring1voltage = parseInt(msg.payload[56].replace(/([^a-z0-9]+)/gi, ''));\nstring1current = parseInt(msg.payload[65].replace(/([^a-z0-9]+)/gi, ''))/100;\nstring2voltage = parseInt(msg.payload[82].replace(/([^a-z0-9]+)/gi, ''));\nstring2current = parseInt(msg.payload[91].replace(/([^a-z0-9]+)/gi, ''))/100;\nline1voltage = parseInt(msg.payload[59].replace(/([^a-z0-9]+)/gi, ''));\nline1power = parseInt(msg.payload[68].replace(/([^a-z0-9]+)/gi, ''));\nline2voltage = parseInt(msg.payload[85].replace(/([^a-z0-9]+)/gi, ''));\nline2power = parseInt(msg.payload[94].replace(/([^a-z0-9]+)/gi, ''));\nline3voltage = parseInt(msg.payload[111].replace(/([^a-z0-9]+)/gi, ''));\nline3power = parseInt(msg.payload[120].replace(/([^a-z0-9]+)/gi, ''));\nstatus = msg.payload[32].replace(/\r?\n|\r/g, '').replace(/\s/g, \"\");\n\n\nif (Number.isNaN(acPowerCurrent) === true){\n acPowerCurrent = 0;\n}\nif (Number.isNaN(totalEnergy) === true){\n totalEnergy = -1;\n}\nif (Number.isNaN(dailyEnergy) === true){\n dailyEnergy = 0;\n}\nif (Number.isNaN(string1voltage) === true){\n string1voltage = 0;\n}\nif (Number.isNaN(string1current) === true){\n string1current = 0;\n}\nif (Number.isNaN(string2voltage) === true){\n string2voltage = 0;\n}\nif (Number.isNaN(string2current) === true){\n string2current = 0;\n}\nif (Number.isNaN(line1voltage) === true){\n line1voltage = 0;\n}\nif (Number.isNaN(line1power) === true){\n line1power = 0;\n}\nif (Number.isNaN(line2voltage) === true){\n line2voltage = 0;\n}\nif (Number.isNaN(line2power) === true){\n line2power = 0;\n}\nif (Number.isNaN(line3voltage) === true){\n line3voltage = 0;\n}\nif (Number.isNaN(line3power) === true){\n line3power = 0;\n}\n\nmsg.payload = {\n \"acPowerCurrent\" : acPowerCurrent,\n \"totalEnergy\" : totalEnergy,\n \"dailyEnergy\" : dailyEnergy,\n \"status\" : status,\n \"string1voltage\" : string1voltage,\n \"string1current\" : string1current,\n \"string2voltage\" : string2voltage,\n \"string2current\" : string2current,\n \"line1voltage\" : line1voltage,\n \"line1power\" : line1power,\n \"line2voltage\" : line2voltage,\n \"line2power\" : line2power,\n \"line3voltage\" : line3voltage,\n \"line3power\" : line3power\n}\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 40,
"wires": [
[
"34e425ddfbd52922",
"851d74df4b8af250",
"a0f4b6bc546a5feb",
"6f7347f07dbaddbc",
"debfb65e018929b6",
"796c0ba818f32273",
"4d2581af083ac9fa",
"f83bdf7d776677fd",
"bb682b4f55ea5261",
"0fc320415691c33b",
"c242a15391c6e138",
"cb1f12452ef3f638",
"b1ccbcd5cf01096d"
]
]
},
{
"id": "fd1711f2.7e7b4",
"type": "http request",
"z": "347111747d6d4c72",
"name": "kostal",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://192.168.1.2/index.fhtml",
"tls": "",
"persist": false,
"proxy": "",
"authType": "basic",
"senderr": false,
"credentials": {},
"x": 260,
"y": 40,
"wires": [
[
"3f445786.6a93b8"
]
]
},
{
"id": "3f445786.6a93b8",
"type": "html",
"z": "347111747d6d4c72",
"name": "",
"property": "payload",
"outproperty": "payload",
"tag": "td",
"ret": "text",
"as": "single",
"x": 410,
"y": 40,
"wires": [
[
"4ad0e46.7796d1c",
"f3549090d79f4c9c",
"ac418f3bb6f53c8c",
"e40d0ff0542d8491",
"eb1ef10bd2d98a04",
"aa0fd29746e7f82d",
"6bc46f3e373ea374",
"01fd97e66dd1e7ed",
"49d7fbfce0853df5",
"b749aec74297da98",
"1f90685264d36a3b",
"32d7bb0afd1faeb5",
"37e5e4eb0f275f2d",
"4ec5b28516254e78"
]
]
},
{
"id": "b32e7821.c1dc78",
"type": "inject",
"z": "347111747d6d4c72",
"name": "20 sec",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payloadType": "date",
"x": 90,
"y": 40,
"wires": [
[
"fd1711f2.7e7b4"
]
]
},
{
"id": "bf48b05b907a3b46",
"type": "debug",
"z": "347111747d6d4c72",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 270,
"y": 100,
"wires": []
},
{
"id": "34e425ddfbd52922",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "c8c536ef38e613a8",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "GesamtEnergie",
"format": "{{msg.payload.totalEnergy}}",
"layout": "row-spread",
"className": "",
"x": 1080,
"y": 40,
"wires": []
},
{
"id": "851d74df4b8af250",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "c8c536ef38e613a8",
"order": 5,
"width": 0,
"height": 0,
"name": "",
"label": "aktuelle AC-Leistung",
"format": "{{msg.payload.acPowerCurrent}}",
"layout": "row-spread",
"className": "",
"x": 1100,
"y": 120,
"wires": []
},
{
"id": "cb1f12452ef3f638",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "c8c536ef38e613a8",
"order": 4,
"width": 0,
"height": 0,
"name": "",
"label": "TagesEnergie",
"format": "{{msg.payload.dailyEnergy}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 80,
"wires": []
},
{
"id": "a0f4b6bc546a5feb",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "0816668bf0491bd9",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "string1voltage",
"format": "{{msg.payload.string1voltage}}",
"layout": "row-spread",
"className": "",
"x": 1080,
"y": 160,
"wires": []
},
{
"id": "debfb65e018929b6",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "0816668bf0491bd9",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "string2voltage",
"format": "{{msg.payload.string2voltage}}",
"layout": "row-spread",
"className": "",
"x": 1080,
"y": 240,
"wires": []
},
{
"id": "6f7347f07dbaddbc",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "0816668bf0491bd9",
"order": 2,
"width": 0,
"height": 0,
"name": "",
"label": "string1current",
"format": "{{msg.payload.string1current}}",
"layout": "row-spread",
"className": "",
"x": 1080,
"y": 200,
"wires": []
},
{
"id": "796c0ba818f32273",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "0816668bf0491bd9",
"order": 4,
"width": 0,
"height": 0,
"name": "",
"label": "string2current",
"format": "{{msg.payload.string2current}}",
"layout": "row-spread",
"className": "",
"x": 1080,
"y": 280,
"wires": []
},
{
"id": "b1ccbcd5cf01096d",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "2e650c287c8977c6",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "line1voltage",
"format": "{{msg.payload.line1voltage}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 320,
"wires": []
},
{
"id": "f83bdf7d776677fd",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "2e650c287c8977c6",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "line2voltage",
"format": "{{msg.payload.line2voltage}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 400,
"wires": []
},
{
"id": "4d2581af083ac9fa",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "2e650c287c8977c6",
"order": 2,
"width": 0,
"height": 0,
"name": "",
"label": "line1power",
"format": "{{msg.payload.line1power}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 360,
"wires": []
},
{
"id": "bb682b4f55ea5261",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "2e650c287c8977c6",
"order": 4,
"width": 0,
"height": 0,
"name": "",
"label": "line2power",
"format": "{{msg.payload.line2power}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 440,
"wires": []
},
{
"id": "0fc320415691c33b",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "2e650c287c8977c6",
"order": 5,
"width": 0,
"height": 0,
"name": "",
"label": "line3voltage",
"format": "{{msg.payload.line3voltage}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 480,
"wires": []
},
{
"id": "c242a15391c6e138",
"type": "ui_text",
"z": "347111747d6d4c72",
"group": "2e650c287c8977c6",
"order": 6,
"width": 0,
"height": 0,
"name": "",
"label": "line3power",
"format": "{{msg.payload.line3power}}",
"layout": "row-spread",
"className": "",
"x": 1070,
"y": 520,
"wires": []
},
{
"id": "9e8331d8f24e5508",
"type": "ui_chart",
"z": "347111747d6d4c72",
"name": "",
"group": "c8c536ef38e613a8",
"order": 2,
"width": 0,
"height": 0,
"label": "TagesEnergie",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "12",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 830,
"y": 180,
"wires": [
[]
]
},
{
"id": "060a6f4f7709d212",
"type": "ui_chart",
"z": "347111747d6d4c72",
"name": "",
"group": "c8c536ef38e613a8",
"order": 1,
"width": 0,
"height": 0,
"label": "GesamtEnergie",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "604800",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 840,
"y": 140,
"wires": [
[]
]
},
{
"id": "f3549090d79f4c9c",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse totalEnergy",
"func": "totalEnergy = parseInt(msg.payload[17].replace(/([^A-Z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(totalEnergy) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = totalEnergy\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 260,
"wires": [
[
"060a6f4f7709d212",
"5d7fd7bd61272bf3"
]
]
},
{
"id": "ac418f3bb6f53c8c",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse dailyEnergy",
"func": "dailyEnergy = parseInt(msg.payload[26].replace(/([^a-z0-9]+)/gi, ''))/100;\n\n\nif (Number.isNaN(dailyEnergy) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = dailyEnergy\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 300,
"wires": [
[
"9e8331d8f24e5508",
"b0d1ee8efbccf83c"
]
]
},
{
"id": "e40d0ff0542d8491",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse acPowerCurrent",
"func": "acPowerCurrent = parseInt(msg.payload[14].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(acPowerCurrent) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = acPowerCurrent\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 340,
"wires": [
[
"6c98dadd8dfa1b2b",
"98b85716012ff0f1"
]
]
},
{
"id": "6c98dadd8dfa1b2b",
"type": "ui_chart",
"z": "347111747d6d4c72",
"name": "",
"group": "c8c536ef38e613a8",
"order": 2,
"width": 0,
"height": 0,
"label": "aktuelle Leistung",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "12",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 850,
"y": 220,
"wires": [
[]
]
},
{
"id": "98b85716012ff0f1",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/acPowerCurrent",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 640,
"y": 340,
"wires": []
},
{
"id": "5d7fd7bd61272bf3",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/totalEnergy",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 620,
"y": 260,
"wires": []
},
{
"id": "b0d1ee8efbccf83c",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/dailyEnergy",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 620,
"y": 300,
"wires": []
},
{
"id": "68f495560987754b",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/string1voltage",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 380,
"wires": []
},
{
"id": "e33e75fdf4b82aac",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/string1current",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 420,
"wires": []
},
{
"id": "8d9268aef7b8eba8",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/string2voltage",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 460,
"wires": []
},
{
"id": "960f3f76488c3e98",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/string2current",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 500,
"wires": []
},
{
"id": "c5ccb0f701055bc1",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/line1voltage",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 540,
"wires": []
},
{
"id": "f7dad6605a58f5c6",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/line1power",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 620,
"y": 580,
"wires": []
},
{
"id": "7d0a3ec6865e297e",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/line2voltage",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 620,
"wires": []
},
{
"id": "7f9fed855e70fed7",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/line2power",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 620,
"y": 660,
"wires": []
},
{
"id": "771b4926c3e76ab5",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/line3voltage",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 630,
"y": 700,
"wires": []
},
{
"id": "6b3309a879659da4",
"type": "mqtt out",
"z": "347111747d6d4c72",
"name": "",
"topic": "tele/photovoltaic/line3power",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "634cbb5f.887d54",
"x": 620,
"y": 740,
"wires": []
},
{
"id": "eb1ef10bd2d98a04",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse string1voltage",
"func": "string1voltage = parseInt(msg.payload[56].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(string1voltage) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = string1voltage\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 380,
"wires": [
[
"68f495560987754b"
]
]
},
{
"id": "aa0fd29746e7f82d",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse string1current",
"func": "string1current = parseInt(msg.payload[65].replace(/([^a-z0-9]+)/gi, ''))/100;\n\n\nif (Number.isNaN(string1current) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = string1current\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 420,
"wires": [
[
"e33e75fdf4b82aac"
]
]
},
{
"id": "6bc46f3e373ea374",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse string2voltage ",
"func": "string2voltage = parseInt(msg.payload[82].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(string2voltage) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = string2voltage\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 460,
"wires": [
[
"8d9268aef7b8eba8"
]
]
},
{
"id": "01fd97e66dd1e7ed",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse string2current",
"func": "string2current = parseInt(msg.payload[91].replace(/([^a-z0-9]+)/gi, ''))/100;\n\n\nif (Number.isNaN(string2current) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = string2current\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 500,
"wires": [
[
"960f3f76488c3e98"
]
]
},
{
"id": "49d7fbfce0853df5",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse line1voltage",
"func": "line1voltage = parseInt(msg.payload[59].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(line1voltage) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = line1voltage\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 540,
"wires": [
[
"c5ccb0f701055bc1"
]
]
},
{
"id": "b749aec74297da98",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse line1power",
"func": "line1power = parseInt(msg.payload[68].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(line1power) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = line1power\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 580,
"wires": [
[
"f7dad6605a58f5c6"
]
]
},
{
"id": "1f90685264d36a3b",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse line2voltage",
"func": "line2voltage = parseInt(msg.payload[85].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(line2voltage) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = line2voltage\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 620,
"wires": [
[
"7d0a3ec6865e297e"
]
]
},
{
"id": "32d7bb0afd1faeb5",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse line2power",
"func": "line2power = parseInt(msg.payload[94].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(line2power) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = line2power\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 660,
"wires": [
[
"7f9fed855e70fed7"
]
]
},
{
"id": "37e5e4eb0f275f2d",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse line3voltage",
"func": "line3voltage = parseInt(msg.payload[111].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(line3voltage) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = line3voltage\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 700,
"wires": [
[
"771b4926c3e76ab5"
]
]
},
{
"id": "4ec5b28516254e78",
"type": "function",
"z": "347111747d6d4c72",
"name": "parse line3power",
"func": "line3power = parseInt(msg.payload[120].replace(/([^a-z0-9]+)/gi, ''));\n\n\nif (Number.isNaN(line3power) === true){\n totalEnergy = -1;\n}\n\n\nmsg.payload = line3power\n\n\nglobal.set(\"kostal\", msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 740,
"wires": [
[
"6b3309a879659da4"
]
]
},
{
"id": "c8c536ef38e613a8",
"type": "ui_group",
"name": "Werte",
"tab": "d3de2ec7ddd38014",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "0816668bf0491bd9",
"type": "ui_group",
"name": "PV-Generator",
"tab": "d3de2ec7ddd38014",
"order": 2,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "2e650c287c8977c6",
"type": "ui_group",
"name": "Ausgangsleistung",
"tab": "d3de2ec7ddd38014",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "634cbb5f.887d54",
"type": "mqtt-broker",
"broker": "192.168.1.10",
"port": "1883",
"clientid": "nodeRed",
"autoConnect": true,
"usetls": false,
"protocolVersion": 4,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "d3de2ec7ddd38014",
"type": "ui_tab",
"name": "PV-Anlage",
"icon": "dashboard",
"order": 6,
"disabled": false,
"hidden": false
}
]

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert