here is the complete code from the node-red-flow.
feel free to use on your own risk
[
{
"id": "95b1a3ab.e15c1",
"type": "tab",
"label": "OR-WE-514 - Flex Test",
"disabled": false,
"info": ""
},
{
"id": "62eff98004127c80",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get Voltage",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 530,
"y": 140,
"wires": [
[
"7a6463149d53365b"
],
[
"96e65b943cda6c15"
]
]
},
{
"id": "a79fb589bd77dafd",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0131 Voltage",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0131,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 140,
"wires": [
[
"62eff98004127c80"
]
]
},
{
"id": "96e65b943cda6c15",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100; \nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 140,
"wires": [
[
"19f3fd563d026744",
"9a46b7cad05cae9f"
]
]
},
{
"id": "19f3fd563d026744",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 Volts",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Volts"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "V"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1020,
"y": 140,
"wires": [
[]
]
},
{
"id": "53ad96eee82c4d59",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0139 Current",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0139,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 200,
"wires": [
[
"b7cf124cca2bc33b"
]
]
},
{
"id": "b7cf124cca2bc33b",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get Current",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 530,
"y": 200,
"wires": [
[
"7a6463149d53365b"
],
[
"f5cd417fd295827a"
]
]
},
{
"id": "f5cd417fd295827a",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 200,
"wires": [
[
"30da9faac195f00f",
"9a46b7cad05cae9f"
]
]
},
{
"id": "30da9faac195f00f",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 Amps",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Amps"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "A"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1020,
"y": 200,
"wires": [
[]
]
},
{
"id": "6c04d6080a763d91",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0140 Power",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0140,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 260,
"wires": [
[
"3ae21f81a0a03eb5"
]
]
},
{
"id": "3ae21f81a0a03eb5",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get Power",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 530,
"y": 260,
"wires": [
[
"7a6463149d53365b"
],
[
"73bc0677209b8f69"
]
]
},
{
"id": "73bc0677209b8f69",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 260,
"wires": [
[
"8f92714ace25797e",
"9a46b7cad05cae9f"
]
]
},
{
"id": "8f92714ace25797e",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 Watts",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Watts"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "kW"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1020,
"y": 260,
"wires": [
[]
]
},
{
"id": "5c5306075d976b32",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0130 Frequenz",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0130,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 340,
"wires": [
[
"81cadcab10457ee4"
]
]
},
{
"id": "81cadcab10457ee4",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get Frequenz",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 540,
"y": 340,
"wires": [
[
"7a6463149d53365b"
],
[
"66bd3e30ef5d9ee2"
]
]
},
{
"id": "66bd3e30ef5d9ee2",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 340,
"wires": [
[
"5b169d880863318b",
"9a46b7cad05cae9f"
]
]
},
{
"id": "5b169d880863318b",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 Herz",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Herz"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "Hz"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1020,
"y": 340,
"wires": [
[]
]
},
{
"id": "9a46b7cad05cae9f",
"type": "debug",
"z": "95b1a3ab.e15c1",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 80,
"wires": []
},
{
"id": "27b4acb1fcc55a39",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0158 cosP",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0158,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 400,
"wires": [
[
"9fbd417be7d48360"
]
]
},
{
"id": "9fbd417be7d48360",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get Factor",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 530,
"y": 400,
"wires": [
[
"7a6463149d53365b"
],
[
"e1ffdc440d4da86b"
]
]
},
{
"id": "e1ffdc440d4da86b",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 400,
"wires": [
[
"7f4c3d35b4a57a00",
"9a46b7cad05cae9f"
]
]
},
{
"id": "7f4c3d35b4a57a00",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 cosP",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 cosP"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "times"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1020,
"y": 400,
"wires": [
[]
]
},
{
"id": "f277332469bb2138",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0148 Power R",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0148,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 480,
"wires": [
[
"ac610ddc5d3448f3"
]
]
},
{
"id": "ac610ddc5d3448f3",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get P Reactive",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 540,
"y": 480,
"wires": [
[
"7a6463149d53365b"
],
[
"7110cf5c61470290"
]
]
},
{
"id": "7110cf5c61470290",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 480,
"wires": [
[
"885d0889e8282f13",
"9a46b7cad05cae9f"
]
]
},
{
"id": "885d0889e8282f13",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 Watts R",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Watts Reactive"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "kW"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1030,
"y": 480,
"wires": [
[]
]
},
{
"id": "7ef7af96fc8e69de",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0x0150 Power A",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0x0150,\n 'quantity': 1\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 540,
"wires": [
[
"c37f263d6a280bc8"
]
]
},
{
"id": "c37f263d6a280bc8",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get P Apperent",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 540,
"y": 540,
"wires": [
[
"7a6463149d53365b"
],
[
"c3422b9703aa8c35"
]
]
},
{
"id": "c3422b9703aa8c35",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "/100",
"func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 540,
"wires": [
[
"442abcab93282ffa",
"9a46b7cad05cae9f"
]
]
},
{
"id": "442abcab93282ffa",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 Watts A",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Watts Apperent"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "kW"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1030,
"y": 540,
"wires": [
[]
]
},
{
"id": "9679467918ae3783",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0xA000 P total",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0xA000,\n 'quantity': 2,\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 620,
"wires": [
[
"6fc00fd7e7ca5db6"
]
]
},
{
"id": "6fc00fd7e7ca5db6",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get P total",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 530,
"y": 620,
"wires": [
[
"7a6463149d53365b"
],
[
"12c4a0be3f713342"
]
]
},
{
"id": "12c4a0be3f713342",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "dword",
"func": "\nvalue= (msg.payload.data[0] << 16) + msg.payload.data[1];\n\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 620,
"wires": [
[
"8516c292d09d5657",
"9a46b7cad05cae9f"
]
]
},
{
"id": "8516c292d09d5657",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 total KWh",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Watts total"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "kWh"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1040,
"y": 620,
"wires": [
[]
]
},
{
"id": "1a96548c0546f20a",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "0xA030 P -1m",
"func": "msg.payload = {\n 'fc': 3,\n 'unitid': 1,\n 'address': 0xA030,\n 'quantity': 2\n };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 680,
"wires": [
[
"aba5fface027604a"
]
]
},
{
"id": "aba5fface027604a",
"type": "modbus-flex-getter",
"z": "95b1a3ab.e15c1",
"name": "Get P last month",
"showStatusActivities": true,
"showErrors": true,
"logIOActivities": false,
"server": "982d9453.cd0ef",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 550,
"y": 680,
"wires": [
[
"7a6463149d53365b"
],
[
"389eaf850223a381"
]
]
},
{
"id": "389eaf850223a381",
"type": "function",
"z": "95b1a3ab.e15c1",
"name": "dword",
"func": "\nvalue= (msg.payload.data[0] << 16) + msg.payload.data[1];\n\nif (value < 0.01) {\n value= 0\n}\nmsg.payload = value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 680,
"wires": [
[
"0ca8d6cfc81072c1",
"9a46b7cad05cae9f"
]
]
},
{
"id": "0ca8d6cfc81072c1",
"type": "ha-entity",
"z": "95b1a3ab.e15c1",
"name": "ModPow1 last month kWh",
"server": "69eb452d.8a610c",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": "Pow1 Watts last month"
},
{
"property": "device_class",
"value": ""
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": "kWh"
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": false,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "$entity().state ? \"on\": \"off\"",
"outputPayloadType": "jsonata",
"x": 1050,
"y": 680,
"wires": [
[]
]
},
{
"id": "7a6463149d53365b",
"type": "debug",
"z": "95b1a3ab.e15c1",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 80,
"wires": []
},
{
"id": "46ea014148b6fc68",
"type": "inject",
"z": "95b1a3ab.e15c1",
"name": "11sec int",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "11",
"crontab": "",
"once": true,
"onceDelay": "15",
"topic": "",
"payloadType": "date",
"x": 130,
"y": 60,
"wires": [
[
"a79fb589bd77dafd",
"53ad96eee82c4d59",
"6c04d6080a763d91",
"9679467918ae3783",
"1a96548c0546f20a"
]
]
},
{
"id": "982d9453.cd0ef",
"type": "modbus-client",
"name": "ORNO 514",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": true,
"queueLogEnabled": true,
"tcpHost": "10.0.0.68",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"unit_id": 1,
"commandDelay": 1,
"clientTimeout": 1000,
"reconnectOnTimeout": true,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true
},
{
"id": "69eb452d.8a610c",
"type": "server",
"name": "Home Assistant",
"version": 1,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]