I post the complete JSON:
[
{
"id": "e181ab23ca2013dc",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "a51b2b36cf83199b",
"type": "mqtt in",
"z": "e181ab23ca2013dc",
"name": "",
"topic": "opendtu/12123/0/yieldtotal",
"qos": "0",
"datatype": "json",
"broker": "722c90e4f8ec0db9",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 270,
"y": 260,
"wires": [
[
"0184268473772f5f"
]
]
},
{
"id": "0184268473772f5f",
"type": "join",
"z": "e181ab23ca2013dc",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"useparts": true,
"accumulate": false,
"timeout": "",
"count": "1",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 630,
"y": 240,
"wires": [
[
"d185134d62647599"
]
]
},
{
"id": "d185134d62647599",
"type": "function",
"z": "e181ab23ca2013dc",
"name": "function 2",
"func": "var time = new Date();\n\nvar totalkwh = Number(msg.payload[\"opendtu/12123/0/yieldtotal\"]);\n\nif (isNaN(totalkwh)) {\n node.error(\"yieldtotal is not a number\");\n return null;\n}\n\nvar field1 = \"totalkwh\";\nvar totalkwhnew = totalkwh + 1544;\n\nmsg.params = [time, totalkwhnew, field1];\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 860,
"y": 260,
"wires": [
[
"20ebe008a74ff4f5"
]
]
},
{
"id": "20ebe008a74ff4f5",
"type": "debug",
"z": "e181ab23ca2013dc",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1140,
"y": 260,
"wires": []
},
{
"id": "722c90e4f8ec0db9",
"type": "mqtt-broker",
"name": "Mqtt Server",
"broker": "mosquitto",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "5",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
Frist Message is from MQTT to Join Node to Function Node to Debug