Setting a new topic with the change node with which I can use the "dot-notation" works fine. If I use the MQTT topic, which has slashes in it, I get the error message "Invalid JSONata expression: "The left side of the "+" operator must evaluate to a number". As recommended I am using the "bracket-notation" for this e.g. msg.payload["shellies/shellyem3-stromkasten/emeter/0/power"]
[
{
"id": "d944ef57a0872351",
"type": "mqtt in",
"z": "f6f2187d.f17ca8",
"name": "Phase 0 Power",
"topic": "shellies/shellyem3-stromkasten/emeter/0/power",
"qos": "2",
"datatype": "auto-detect",
"broker": "b912bc20557e4732",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 220,
"wires": [
[
"cee8fccc002717de",
"e992565aeaea2259",
"7c18da7111c71e67",
"5aabf5a421290caa"
]
]
},
{
"id": "cee8fccc002717de",
"type": "influxdb out",
"z": "f6f2187d.f17ca8",
"influxdb": "af175a885afb64ae",
"name": "Shelly 3EM",
"measurement": "phase_0_power",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "organisation",
"bucket": "bucket",
"x": 430,
"y": 220,
"wires": []
},
{
"id": "9f6d7fa801a4188b",
"type": "mqtt in",
"z": "f6f2187d.f17ca8",
"name": "Phase 1 Power",
"topic": "shellies/shellyem3-stromkasten/emeter/1/power",
"qos": "2",
"datatype": "auto-detect",
"broker": "b912bc20557e4732",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 280,
"wires": [
[
"1e07e7c67607a344",
"ea77bebac7c73a69",
"f2eeca205243ceba",
"5aabf5a421290caa"
]
]
},
{
"id": "0d2678269a90a66c",
"type": "mqtt in",
"z": "f6f2187d.f17ca8",
"name": "Phase 2 Power",
"topic": "shellies/shellyem3-stromkasten/emeter/2/power",
"qos": "2",
"datatype": "auto-detect",
"broker": "b912bc20557e4732",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 340,
"wires": [
[
"44abd4c0cec067cf",
"e1907a900a33b0ea",
"7f63e59035fb3b24",
"5aabf5a421290caa"
]
]
},
{
"id": "1e07e7c67607a344",
"type": "influxdb out",
"z": "f6f2187d.f17ca8",
"influxdb": "af175a885afb64ae",
"name": "Shelly 3EM",
"measurement": "phase_1_power",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "organisation",
"bucket": "bucket",
"x": 430,
"y": 280,
"wires": []
},
{
"id": "44abd4c0cec067cf",
"type": "influxdb out",
"z": "f6f2187d.f17ca8",
"influxdb": "af175a885afb64ae",
"name": "Shelly 3EM",
"measurement": "phase_2_power",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "organisation",
"bucket": "bucket",
"x": 430,
"y": 340,
"wires": []
},
{
"id": "e992565aeaea2259",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 0",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 600,
"y": 180,
"wires": []
},
{
"id": "ea77bebac7c73a69",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 600,
"y": 240,
"wires": []
},
{
"id": "e1907a900a33b0ea",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 600,
"y": 300,
"wires": []
},
{
"id": "7c18da7111c71e67",
"type": "change",
"z": "f6f2187d.f17ca8",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "phase0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 300,
"y": 400,
"wires": [
[
"4a6ce9b621c9c3de"
]
]
},
{
"id": "f2eeca205243ceba",
"type": "change",
"z": "f6f2187d.f17ca8",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "phase1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 300,
"y": 440,
"wires": [
[
"4a6ce9b621c9c3de"
]
]
},
{
"id": "7f63e59035fb3b24",
"type": "change",
"z": "f6f2187d.f17ca8",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "phase2",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 300,
"y": 480,
"wires": [
[
"4a6ce9b621c9c3de"
]
]
},
{
"id": "4a6ce9b621c9c3de",
"type": "join",
"z": "f6f2187d.f17ca8",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "3",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 690,
"y": 480,
"wires": [
[
"e994ccd034181f58",
"017207fe9a6b42dc"
]
]
},
{
"id": "142c1c268cf1fb31",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 10",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 480,
"wires": []
},
{
"id": "e994ccd034181f58",
"type": "change",
"z": "f6f2187d.f17ca8",
"name": "$sum(payload)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "msg.payload.phase0 + msg.payload.phase1 + msg.payload.phase2",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 900,
"y": 480,
"wires": [
[
"142c1c268cf1fb31"
]
]
},
{
"id": "017207fe9a6b42dc",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 12",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 860,
"y": 540,
"wires": []
},
{
"id": "5aabf5a421290caa",
"type": "join",
"z": "f6f2187d.f17ca8",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "3",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 690,
"y": 360,
"wires": [
[
"c41fb1d26fe92321",
"0af975e5a9f5297c"
]
]
},
{
"id": "8423a2b8eeade224",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 13",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 360,
"wires": []
},
{
"id": "c41fb1d26fe92321",
"type": "change",
"z": "f6f2187d.f17ca8",
"name": "$sum(payload)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "msg.payload[\"shellies/shellyem3-stromkasten/emeter/0/power\"] + msg.payload[\"shellies/shellyem3-stromkasten/emeter/1/power\"] + msg.payload[\"shellies/shellyem3-stromkasten/emeter/2/power\"]",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 900,
"y": 360,
"wires": [
[
"8423a2b8eeade224"
]
]
},
{
"id": "0af975e5a9f5297c",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "debug 14",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 860,
"y": 420,
"wires": []
},
{
"id": "b912bc20557e4732",
"type": "mqtt-broker",
"name": "Rapserry Pi Daten 1",
"broker": "192.168.0.76",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "af175a885afb64ae",
"type": "influxdb",
"hostname": "192.168.0.76",
"port": "8086",
"protocol": "http",
"database": "shellyDB",
"name": "Shellys",
"usetls": false,
"tls": "",
"influxdbVersion": "1.x",
"url": "http://localhost:8086",
"rejectUnauthorized": true
}
]