Just saw this thread. Here is how I solved it:
[
{
"id": "d65995ec5d968cf6",
"type": "tab",
"label": "ACloads - three phase totalization",
"disabled": false,
"info": "",
"env": []
},
{
"id": "11864f2a9d86b4b7",
"type": "group",
"z": "d65995ec5d968cf6",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"9fab40a4e73435d0",
"e098fdb840e063d0",
"989b17289964414b",
"b290de4f101e6cab",
"7293dc9f49b37f75",
"05e5af08ae6df47b",
"39885dd90f141ff1",
"56534908ca28fb6e"
],
"x": 14,
"y": 19,
"w": 792,
"h": 202
},
{
"id": "9fab40a4e73435d0",
"type": "change",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"name": "Save",
"rules": [
{
"t": "set",
"p": "powerL1",
"pt": "flow",
"to": "payload",
"tot": "msg",
"dc": true
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 310,
"y": 60,
"wires": [
[
"b290de4f101e6cab"
]
]
},
{
"id": "e098fdb840e063d0",
"type": "change",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"name": "Save",
"rules": [
{
"t": "set",
"p": "powerL2",
"pt": "flow",
"to": "payload",
"tot": "msg",
"dc": true
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 310,
"y": 120,
"wires": [
[
"b290de4f101e6cab"
]
]
},
{
"id": "989b17289964414b",
"type": "change",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"name": "Save",
"rules": [
{
"t": "set",
"p": "powerL3",
"pt": "flow",
"to": "payload",
"tot": "msg",
"dc": true
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 310,
"y": 180,
"wires": [
[
"b290de4f101e6cab"
]
]
},
{
"id": "b290de4f101e6cab",
"type": "function",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"name": "L1 + L2 + L3",
"func": "msg.payload = 0.0;\nmsg.payload += flow.get(\"powerL1\");\nmsg.payload += flow.get(\"powerL2\");\nmsg.payload += flow.get(\"powerL3\");\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 490,
"y": 120,
"wires": [
[
"56534908ca28fb6e"
]
]
},
{
"id": "7293dc9f49b37f75",
"type": "victron-input-acload",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"service": "com.victronenergy.acload/102",
"path": "/Ac/L1/Power",
"serviceObj": {
"service": "com.victronenergy.acload/102",
"name": "MQTT AC Loads"
},
"pathObj": {
"path": "/Ac/L1/Power",
"type": "float",
"name": "L1 Power (W)"
},
"name": "ACloads L1 Power",
"onlyChanges": false,
"roundValues": "0",
"x": 130,
"y": 60,
"wires": [
[
"9fab40a4e73435d0"
]
]
},
{
"id": "05e5af08ae6df47b",
"type": "victron-input-acload",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"service": "com.victronenergy.acload/102",
"path": "/Ac/L2/Power",
"serviceObj": {
"service": "com.victronenergy.acload/102",
"name": "MQTT AC Loads"
},
"pathObj": {
"path": "/Ac/L2/Power",
"type": "float",
"name": "L2 Power (W)"
},
"name": "ACloads L2 Power",
"onlyChanges": false,
"roundValues": "0",
"x": 130,
"y": 120,
"wires": [
[
"e098fdb840e063d0"
]
]
},
{
"id": "39885dd90f141ff1",
"type": "victron-input-acload",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"service": "com.victronenergy.acload/102",
"path": "/Ac/L3/Power",
"serviceObj": {
"service": "com.victronenergy.acload/102",
"name": "MQTT AC Loads"
},
"pathObj": {
"path": "/Ac/L3/Power",
"type": "float",
"name": "L3 Power (W)"
},
"name": "ACloads L3 Power",
"onlyChanges": false,
"roundValues": "0",
"x": 130,
"y": 180,
"wires": [
[
"989b17289964414b"
]
]
},
{
"id": "56534908ca28fb6e",
"type": "debug",
"z": "d65995ec5d968cf6",
"g": "11864f2a9d86b4b7",
"name": "ACloads Power",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 680,
"y": 120,
"wires": []
}
]
Hope this helps ![]()
Edit: Changed my code to this simpler version:
[
{
"id": "71a0ae4b10fb7caf",
"type": "function",
"z": "4597674c975e0b19",
"g": "686ea5711f030fb5",
"name": "L1 + L2 + L3",
"func": "let power = context.get(\"power\") || { powerL1: 0.0, powerL2: 0.0, powerL3: 0.0 };\nswitch((msg.topic).toUpperCase()) {\n case \"ACLOADS L1 POWER\": power.powerL1 = msg.payload; break;\n case \"ACLOADS L2 POWER\": power.powerL2 = msg.payload; break;\n case \"ACLOADS L3 POWER\": power.powerL3 = msg.payload; break;\n}\ncontext.set(\"power\", power);\n\nlet total = power.powerL1 + power.powerL2 + power.powerL3;\n\nglobal.set(\"acloads.power\", total);\nmsg.payload = total;\nnode.status({fill:\"grey\", shape:\"dot\", text:total + \" W\"});\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 1640,
"wires": [
[
"0090758d853aa6d0"
]
]
},
{
"id": "fb1fcae24d80b971",
"type": "victron-input-acload",
"z": "4597674c975e0b19",
"g": "686ea5711f030fb5",
"service": "com.victronenergy.acload/102",
"path": "/Ac/L1/Power",
"serviceObj": {
"service": "com.victronenergy.acload/102",
"name": "MQTT AC Loads"
},
"pathObj": {
"path": "/Ac/L1/Power",
"type": "float",
"name": "L1 Power (W)"
},
"name": "ACloads L1 Power",
"onlyChanges": false,
"roundValues": "0",
"x": 170,
"y": 1580,
"wires": [
[
"71a0ae4b10fb7caf"
]
]
},
{
"id": "e81f3b8afd7a130c",
"type": "victron-input-acload",
"z": "4597674c975e0b19",
"g": "686ea5711f030fb5",
"service": "com.victronenergy.acload/102",
"path": "/Ac/L2/Power",
"serviceObj": {
"service": "com.victronenergy.acload/102",
"name": "MQTT AC Loads"
},
"pathObj": {
"path": "/Ac/L2/Power",
"type": "float",
"name": "L2 Power (W)"
},
"name": "ACloads L2 Power",
"onlyChanges": false,
"roundValues": "0",
"x": 170,
"y": 1640,
"wires": [
[
"71a0ae4b10fb7caf"
]
]
},
{
"id": "304629738f2956a5",
"type": "victron-input-acload",
"z": "4597674c975e0b19",
"g": "686ea5711f030fb5",
"service": "com.victronenergy.acload/102",
"path": "/Ac/L3/Power",
"serviceObj": {
"service": "com.victronenergy.acload/102",
"name": "MQTT AC Loads"
},
"pathObj": {
"path": "/Ac/L3/Power",
"type": "float",
"name": "L3 Power (W)"
},
"name": "ACloads L3 Power",
"onlyChanges": false,
"roundValues": "0",
"x": 170,
"y": 1700,
"wires": [
[
"71a0ae4b10fb7caf"
]
]
}
]