Closed blackpearlla closed 1 year ago
Try this:
[
{
"id": "3e7d5456fd2222e2",
"type": "json",
"z": "42e5fe8b46267f4b",
"name": "",
"property": "payload",
"action": "str",
"pretty": false,
"x": 930,
"y": 260,
"wires": [
[
"f709e6f07c8df0ec"
]
]
},
{
"id": "57e3f70fdb658f06",
"type": "function",
"z": "42e5fe8b46267f4b",
"name": "L1",
"func": "msg.topic = \"L1\"\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 220,
"wires": [
[
"b0dd0b4d12033e09"
]
]
},
{
"id": "40ed6cfcca33afec",
"type": "mqtt in",
"z": "42e5fe8b46267f4b",
"name": "PV Power L1",
"topic": "homeassistant/sensor/on_grid_l1_power/state",
"qos": "2",
"datatype": "auto-detect",
"broker": "e72e968db75c5c1e",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 170,
"y": 220,
"wires": [
[
"57e3f70fdb658f06"
]
]
},
{
"id": "58c9bf31b2bc9c45",
"type": "mqtt in",
"z": "42e5fe8b46267f4b",
"name": "PV Power L2",
"topic": "homeassistant/sensor/on_grid_l2_power/state",
"qos": "2",
"datatype": "auto-detect",
"broker": "e72e968db75c5c1e",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 170,
"y": 260,
"wires": [
[
"4050ab83cd52784e"
]
]
},
{
"id": "e4b9b5ae41499d92",
"type": "mqtt in",
"z": "42e5fe8b46267f4b",
"name": "PV Power L3",
"topic": "homeassistant/sensor/on_grid_l3_power/state",
"qos": "2",
"datatype": "auto-detect",
"broker": "e72e968db75c5c1e",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 170,
"y": 300,
"wires": [
[
"7a87dbe5d947fb07"
]
]
},
{
"id": "f709e6f07c8df0ec",
"type": "mqtt out",
"z": "42e5fe8b46267f4b",
"name": "Write to Venus OS",
"topic": "W/dca632a9b56e/system/0/Dc/Pv/Power",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "75914bed8db6b163",
"x": 1130,
"y": 260,
"wires": []
},
{
"id": "b0dd0b4d12033e09",
"type": "join",
"z": "42e5fe8b46267f4b",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "3",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 510,
"y": 260,
"wires": [
[
"6140a1c60e01aac7"
]
]
},
{
"id": "4050ab83cd52784e",
"type": "function",
"z": "42e5fe8b46267f4b",
"name": "L2",
"func": "msg.topic = \"L2\"\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 260,
"wires": [
[
"b0dd0b4d12033e09"
]
]
},
{
"id": "7a87dbe5d947fb07",
"type": "function",
"z": "42e5fe8b46267f4b",
"name": "L3",
"func": "msg.topic = \"L3\"\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 300,
"wires": [
[
"b0dd0b4d12033e09"
]
]
},
{
"id": "6140a1c60e01aac7",
"type": "function",
"z": "42e5fe8b46267f4b",
"name": "create json structure",
"func": "msg.payload = {\n \"pv\": {\n \"power\": msg.payload[\"L1\"] + msg.payload[\"L2\"] + msg.payload[\"L3\"],\n \"L1\": {\n \"power\": msg.payload[\"L1\"]\n },\n \"L2\": {\n \"power\": msg.payload[\"L2\"]\n },\n \"L3\": {\n \"power\": msg.payload[\"L3\"]\n }\n }\n}\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 260,
"wires": [
[
"3e7d5456fd2222e2"
]
]
},
{
"id": "e72e968db75c5c1e",
"type": "mqtt-broker",
"name": "Homeassistant MQTT Broker",
"broker": "192.168.178.126",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "5",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "75914bed8db6b163",
"type": "mqtt-broker",
"name": "VENUS OS MQTT Broker",
"broker": "192.168.178.185",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "5",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
Thanks a lot. It seems to work!
Hi,
I'm probably too stupid to map the configuration for 3 phases in Node RED. can someone please help me?
Here is my test configuration.