- ggf. Module in palette erst noch zu installieren
- Ich habe eine Summation drin die auch noch den Wert vom Norddach berücksichtigt und dann erst den Gesamt PV Wert an die OpenWB per MQTT schickt
- ggf. noch mehr...
Ich hab damit keinerlei Peaks mehr gesehen seit Monaten, nur schade daß man sowas nicht out of the box mit dem TW hinbekommt und wieder einen externen Workaround benötigt (ich habe es wirklich intensiv versucht, bin aber an dem "merken" des Vorgängerwertes letztlich gescheitert)
Code: Alles auswählen
[
{
"id": "e725d6247a1bcc15",
"type": "tab",
"label": "PV Süd",
"disabled": false,
"info": "",
"env": []
},
{
"id": "3626c1bf.cfc89e",
"type": "modbus-read",
"z": "e725d6247a1bcc15",
"name": "SolarEdge_Süd",
"topic": "",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"showWarnings": true,
"unitid": "1",
"dataType": "HoldingRegister",
"adr": "40069",
"quantity": "40",
"rate": "2",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "",
"server": "c92ba865.93cb78",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 127,
"y": 236,
"wires": [
[
"5c76ec567196f54b"
],
[
"7d0ea34e8c33bfdd",
"9ed7969e36e22283",
"4ea58b8ea0681158",
"476aa6d3c39814e9"
]
]
},
{
"id": "b24cd458.b49cc",
"type": "comment",
"z": "e725d6247a1bcc15",
"name": "Fetch Solaredge TCP modbus data",
"info": "zsdfzsdfg",
"x": 162.5,
"y": 175,
"wires": []
},
{
"id": "7d0ea34e8c33bfdd",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 87",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 340,
"y": 340,
"wires": []
},
{
"id": "5c76ec567196f54b",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 88",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 360,
"y": 100,
"wires": []
},
{
"id": "9ed7969e36e22283",
"type": "function",
"z": "e725d6247a1bcc15",
"name": "Strom A",
"func": "// Create new Buffer based on array bytes\nconst buf = Buffer.from(msg.payload.buffer);\n\nvar SF_A_old=flow.get('SF_A_old') || 0;\nvar SF_A_new=scalefactor(40076);\n//node.warn(SF_A_old);\n//node.warn(SF_A_new);\n\n// Check Scalefactor\n\nif (SF_A_old == SF_A_new)\n{\nmsg.payload = round(uint16(40072) * SF_A_new, 2);\nSF_A_old=SF_A_new;\n//node.warn(\"In IF Schleife vor Senden\");\nreturn msg;\n}\n//node.warn(\"IF Ende\");\nflow.set('SF_A_old', SF_A_new);\nreturn null;\n\nfunction word(address) {\n // Find the correct offset in bytes\n // 40070 is the starting address we fetch from SolarEdge inverter\n return (address-40070) * 2;\n}\n\nfunction scalefactor(address) {\n return Math.pow(10, buf.readInt16BE(word(address)));\n}\n\nfunction int16(address) {\n return buf.readInt16BE(word(address))\n}\n\nfunction uint16(address) {\n return buf.readUInt16BE(word(address));\n}\n\nfunction int32(address) {\n return buf.readInt32BE(word(address))\n}\n\nfunction uint32(address) {\n return buf.readUInt32BE(word(address))\n}\n\nfunction round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n} ",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 140,
"y": 420,
"wires": [
[
"27cbd029db86995f",
"0249d75abf4bf03e"
]
]
},
{
"id": "27cbd029db86995f",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 89",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 420,
"wires": []
},
{
"id": "4ea58b8ea0681158",
"type": "function",
"z": "e725d6247a1bcc15",
"name": "Energiezähler Wh",
"func": "// Create new Buffer based on array bytes\nconst buf = Buffer.from(msg.payload.buffer);\n\n// Create influxdb JSON\nmsg.payload = round(uint32(40094) * scalefactor(40096), 2);\nmsg.topic=\"PV_Sued_Wh\";\nreturn msg;\n\nfunction word(address) {\n // Find the correct offset in bytes\n // 40070 is the starting address we fetch from SolarEdge inverter\n return (address-40070) * 2;\n}\n\nfunction scalefactor(address) {\n return Math.pow(10, buf.readInt16BE(word(address)));\n}\n\nfunction int16(address) {\n return buf.readInt16BE(word(address))\n}\n\nfunction uint16(address) {\n return buf.readUInt16BE(word(address));\n}\n\nfunction int32(address) {\n return buf.readInt32BE(word(address))\n}\n\nfunction uint32(address) {\n return buf.readUInt32BE(word(address))\n}\n\nfunction round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n} ",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 170,
"y": 480,
"wires": [
[
"1b6ca75a61cc73ec",
"c47976913b4f4b57"
]
]
},
{
"id": "1b6ca75a61cc73ec",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 90",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 480,
"wires": []
},
{
"id": "476aa6d3c39814e9",
"type": "function",
"z": "e725d6247a1bcc15",
"name": "Leistung W",
"func": "// Create new Buffer based on array bytes\nconst buf = Buffer.from(msg.payload.buffer);\n\nvar SF_P_old=flow.get('SF_P_old') || 0;\nvar SF_P_new=scalefactor(40085);\n//node.warn(SF_P_old);\n//node.warn(SF_P_new);\n// Check Scalefactor\n\nif (SF_P_old == SF_P_new)\n{\nmsg.payload = round(uint16(40084) * SF_P_new, 0);\nSF_P_old=SF_P_new;\n//node.warn(\"In IF Schleife vor Senden\");\nreturn msg;\n}\n//node.warn(\"IF Ende\");\nflow.set('SF_P_old', SF_P_new);\nreturn null;\n\nfunction word(address) {\n // Find the correct offset in bytes\n // 40070 is the starting address we fetch from SolarEdge inverter\n return (address-40070) * 2;\n}\n\nfunction scalefactor(address) {\n return Math.pow(10, buf.readInt16BE(word(address)));\n}\n\nfunction int16(address) {\n return buf.readInt16BE(word(address))\n}\n\nfunction uint16(address) {\n return buf.readUInt16BE(word(address));\n}\n\nfunction int32(address) {\n return buf.readInt32BE(word(address))\n}\n\nfunction uint32(address) {\n return buf.readUInt32BE(word(address))\n}\n\nfunction round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n} ",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 150,
"y": 540,
"wires": [
[
"a603d084eb216212"
]
]
},
{
"id": "4ac12f143fab14b2",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 91",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 540,
"wires": []
},
{
"id": "690c72245095771b",
"type": "mqtt out",
"z": "e725d6247a1bcc15",
"name": "PV1 aktuelle Leistung (Süddach)",
"topic": "openWB/set/pv/3/get/power",
"qos": "0",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "2fd754d1c83cafa5",
"x": 1060,
"y": 660,
"wires": []
},
{
"id": "336061d273286948",
"type": "mqtt out",
"z": "e725d6247a1bcc15",
"name": "PV1 erzeugte Energie in Wh (Süddach)",
"topic": "openWB/set/pv/3/get/exported",
"qos": "0",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "2fd754d1c83cafa5",
"x": 1080,
"y": 420,
"wires": []
},
{
"id": "0249d75abf4bf03e",
"type": "link out",
"z": "e725d6247a1bcc15",
"name": "PV Sued L1 Strom",
"mode": "link",
"links": [
"255761233b0f4fb3"
],
"x": 585,
"y": 420,
"wires": []
},
{
"id": "a603d084eb216212",
"type": "range",
"z": "e725d6247a1bcc15",
"minin": "0",
"maxin": "4600",
"minout": "0",
"maxout": "4600",
"action": "clamp",
"round": false,
"property": "payload",
"name": "",
"x": 300,
"y": 540,
"wires": [
[
"4ac12f143fab14b2",
"54d4a3fde0e214b2"
]
]
},
{
"id": "85c48266a5b49b9f",
"type": "link out",
"z": "e725d6247a1bcc15",
"name": "PV Süd Energie Wh",
"mode": "link",
"links": [
"ba4f71fd7dd245b9"
],
"x": 985,
"y": 480,
"wires": []
},
{
"id": "2564c2c055c75a67",
"type": "link out",
"z": "e725d6247a1bcc15",
"name": "PV Süd Leistung W",
"mode": "link",
"links": [
"04b28f21464194f4",
"c27c90a9f806a501"
],
"x": 985,
"y": 540,
"wires": []
},
{
"id": "c47976913b4f4b57",
"type": "rbe",
"z": "e725d6247a1bcc15",
"name": "PV_Sued_Wh",
"func": "deadbandEq",
"gap": "2",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 660,
"y": 480,
"wires": [
[
"85c48266a5b49b9f",
"03a7f5db70afea23"
]
]
},
{
"id": "54d4a3fde0e214b2",
"type": "rbe",
"z": "e725d6247a1bcc15",
"name": "",
"func": "deadbandEq",
"gap": "10",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 640,
"y": 540,
"wires": [
[
"41b05d9089fb724e"
]
]
},
{
"id": "41b05d9089fb724e",
"type": "function",
"z": "e725d6247a1bcc15",
"name": "function 61",
"func": "if (msg.payload <10)\n{\n msg.payload = 0;\n}\nglobal.set('PV_Sued_Leistung_W',msg.payload);\nmsg.topic= \"PV_Sued_Leistung_W\";\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 790,
"y": 540,
"wires": [
[
"ae804929bbba7f7f",
"2564c2c055c75a67"
]
]
},
{
"id": "85a595762a8a8e2a",
"type": "link in",
"z": "e725d6247a1bcc15",
"name": "link in 12",
"links": [
"0224b7534989c68b"
],
"x": 655,
"y": 660,
"wires": [
[
"ae804929bbba7f7f"
]
]
},
{
"id": "ae804929bbba7f7f",
"type": "sum",
"z": "e725d6247a1bcc15",
"name": "PV_gesamt_W",
"topic": "PV_gesamt_Leistung_W",
"x": 780,
"y": 620,
"wires": [
[
"f5b4999545fd1d66"
]
],
"inputLabels": [
"PV_Nord_Leistung_W"
],
"outputLabels": [
"PV_Sued_Leistung_W"
]
},
{
"id": "03a7f5db70afea23",
"type": "sum",
"z": "e725d6247a1bcc15",
"name": "PV gesamt",
"topic": "PVgesamt",
"x": 830,
"y": 420,
"wires": [
[
"f748ad63e0bc459a",
"336061d273286948"
]
],
"inputLabels": [
"PV_Nord_Wh"
],
"outputLabels": [
"PV_Sued_Wh"
]
},
{
"id": "9275c754d8d485a1",
"type": "link in",
"z": "e725d6247a1bcc15",
"name": "link in 13",
"links": [
"e7cbf109abacf90d"
],
"x": 685,
"y": 360,
"wires": [
[
"03a7f5db70afea23"
]
]
},
{
"id": "f748ad63e0bc459a",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 104",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 990,
"y": 380,
"wires": []
},
{
"id": "a3551705ed389419",
"type": "debug",
"z": "e725d6247a1bcc15",
"name": "debug 105",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 990,
"y": 720,
"wires": []
},
{
"id": "f5b4999545fd1d66",
"type": "function",
"z": "e725d6247a1bcc15",
"name": "function 73",
"func": "// für OpenWB muss PV Produktion negativ gesendet werden!\n\nmsg.payload = msg.payload *(-1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 790,
"y": 720,
"wires": [
[
"a3551705ed389419",
"690c72245095771b"
]
]
},
{
"id": "c92ba865.93cb78",
"type": "modbus-client",
"name": "SolarEdge_Master",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"failureLogEnabled": false,
"tcpHost": "10.10.10.43",
"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": 200,
"clientTimeout": 1000,
"reconnectOnTimeout": true,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true
},
{
"id": "2fd754d1c83cafa5",
"type": "mqtt-broker",
"name": "OpenWB_Master",
"broker": "10.10.10.48",
"port": "1883",
"clientid": "VenusOS",
"autoConnect": true,
"usetls": false,
"protocolVersion": "3",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]