Need help with Emoncms node red flow

Hello everyone,

A bit of context You can skip to the question :slight_smile:
I have a self hosted emoncms dashboard which has been running for the past 7 years. I usually use emonhub for posting to my dashboard but I recently changed solar hardware and moved to a victron ecosystem. Victron have their proprietary VRM portal for monitoring but I have found it to be quite limited and also prefer my data to be on my server and in a standard compliant system like emoncms.

I have the VenusOS installed on a raspberry pi and enabled node-red. Victron has support for node red which is great because it data from all my victron devices are available.

My goal is to use the victron emoncms flow (which I installed) to send system data to my emoncms dashboard.

Question
I am looking for the most optimal and efficient way to post data to emoncms using the emoncms flow. I am quite new to node red so a step by step would be very helpful. If there is anything I need to read up on so as not to be a nuisance please suggest I would gladly… just that right now it all feels quite overwhelming.

What I have done so far
I have been able to post data to emoncms by selecting a victron node representing one of my devcie e,g Solar charger, I can send that data to emoncms as one node. If I try to connect multiple victron node to the emoncms posh node… the output on my emoncms dashboard input… would alternate between the multiple victron node.

What I am doing right now is to connect one Victron node to 1 emoncms push… this creates an input node on my emoncms dashboard which is not efficient. I might have close to 30 or 50 input nodes for every data I want to monitor. I feel there should be a more efficient way to do this.

I also noticed that using valid json fails. So right now I am sending data via simple json.

I have attached a screenshot to of my current node red flow and the output on emoncms


If anyone has a similar setup please sharing your flow and what works for you would be very helpful.

Apologies if my post is long and all over the place.

I found a very good nodered dashboard and flows for a Sunsynk inverter, this uses a Modbus connection. You can download it yourself and read more about it at https://powerforum.co.za/topic/8451-sunsynk-inverter-monitoring/#comment-94321.

I’ve created a new page for myself with only the aspects we’re interested in. As below.

As you can see, there are 2 different intervals for collecting the data from the inverter and once the data is collected, a join node concatenates the data before it is converted to JSON and then sent to emoncms. The offpage connectors are to a modbus read but could be replaced by a Victron read. Data is also sent to MQTT.

I can upload the export of this page if you are interested but it would probably be well worth looking at the forum page linked to above.

b

@Bramco Thanks so much. I will certainly look into the forum post you shared.

Hello @Bramco Please can you share / upload the flow of the screenshot you shared in your post. I have seen the powerforum post before and even played with the flow they used when I considered moving to Deye.

Uploading the flow in your post screensot would be very helpful especailly the use of Join and the convert to json settings.

[
    {
        "id": "64ceaefe882e7cf2",
        "type": "cycle",
        "z": "196d497cf8771b59",
        "name": "Cycle - 1 per timestamp",
        "outputs": 5,
        "x": 170,
        "y": 120,
        "wires": [
            [
                "91d8490a952cdf35"
            ],
            [
                "cfda44f12d677e0a"
            ],
            [
                "779afc33368e966f"
            ],
            [
                "102dd7c34c4501bf"
            ],
            [
                "09470b948f700710"
            ]
        ]
    },
    {
        "id": "461d831defef6dec",
        "type": "gate",
        "z": "196d497cf8771b59",
        "name": "Monitor_Gate",
        "controlTopic": "monitor_gate",
        "defaultState": "open",
        "openCmd": "open",
        "closeCmd": "close",
        "toggleCmd": "toggle",
        "defaultCmd": "default",
        "persist": false,
        "x": 140,
        "y": 200,
        "wires": [
            [
                "64ceaefe882e7cf2"
            ]
        ]
    },
    {
        "id": "5a8e4ade739c1cdd",
        "type": "inject",
        "z": "196d497cf8771b59",
        "name": "timestamp - 1 minute",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "60",
        "crontab": "",
        "once": true,
        "onceDelay": "1",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 260,
        "wires": [
            [
                "461d831defef6dec"
            ]
        ]
    },
    {
        "id": "56710c4029e46451",
        "type": "link out",
        "z": "196d497cf8771b59",
        "name": "ModBusRead_Out",
        "links": [
            "33447edd.f55762"
        ],
        "x": 795,
        "y": 120,
        "wires": []
    },
    {
        "id": "18d1fc10dea8f3ec",
        "type": "link in",
        "z": "196d497cf8771b59",
        "name": "ModBusRead_In",
        "links": [
            "c9dbf7d1.cf6138"
        ],
        "x": 395,
        "y": 320,
        "wires": [
            [
                "325e3fabca90e905",
                "584bf3f9420e8427",
                "ee6e7308df30ad5f",
                "02e9c08415db5371",
                "1edaebf70288a6fb"
            ]
        ]
    },
    {
        "id": "325e3fabca90e905",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Grid_Import",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n   msg.payload = (a - 65535) / 10;\n} else {\n   msg.payload = (a) / 10;\n}\nif (msg.topic === \"grid_import\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 280,
        "wires": [
            [
                "07b5f34631635dc6"
            ]
        ]
    },
    {
        "id": "ef86a7ae93546f63",
        "type": "json",
        "z": "196d497cf8771b59",
        "name": "Convert to JSON",
        "property": "payload",
        "action": "",
        "pretty": true,
        "x": 1010,
        "y": 440,
        "wires": [
            [
                "5b8fb20e5ec37242"
            ]
        ]
    },
    {
        "id": "5b8fb20e5ec37242",
        "type": "emoncms",
        "z": "196d497cf8771b59",
        "name": "emoncms node 12",
        "emonServer": "28a6e6e1f021f287",
        "nodegroup": "12",
        "datatype": "json",
        "x": 1030,
        "y": 500,
        "wires": []
    },
    {
        "id": "2ca547bd628f7112",
        "type": "cycle",
        "z": "196d497cf8771b59",
        "name": "Cycle - 1 per timestamp",
        "outputs": 4,
        "x": 170,
        "y": 520,
        "wires": [
            [
                "f5a6cac805434a07"
            ],
            [
                "c968dbcb5ffc9385"
            ],
            [
                "609f92c93e354c76"
            ],
            [
                "e632874042db9ac9"
            ]
        ]
    },
    {
        "id": "c968dbcb5ffc9385",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Power",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "power",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "W",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 500,
        "wires": [
            [
                "4b31d613b0131aee"
            ]
        ]
    },
    {
        "id": "609f92c93e354c76",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Power",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "power",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "W",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 540,
        "wires": [
            [
                "3ea5860f3b7ae68c"
            ]
        ]
    },
    {
        "id": "4b31d613b0131aee",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Solar_PV1_Power 186",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 186, \n    'quantity': 1 }; \nmsg.topic = \"Solar_PV1_Power\"\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 580,
        "y": 500,
        "wires": [
            [
                "665c3c22e60cc3fa"
            ]
        ]
    },
    {
        "id": "3ea5860f3b7ae68c",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Solar_PV2_Power 187",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 187, \n    'quantity': 1 }; \nmsg.topic = \"Solar_PV2_Power\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 540,
        "wires": [
            [
                "665c3c22e60cc3fa"
            ]
        ]
    },
    {
        "id": "665c3c22e60cc3fa",
        "type": "link out",
        "z": "196d497cf8771b59",
        "name": "ModBusRead_Out",
        "links": [
            "33447edd.f55762"
        ],
        "x": 795,
        "y": 520,
        "wires": []
    },
    {
        "id": "c3f56fca5af711b1",
        "type": "link in",
        "z": "196d497cf8771b59",
        "name": "ModBusRead_In",
        "links": [
            "c9dbf7d1.cf6138"
        ],
        "x": 355,
        "y": 700,
        "wires": [
            [
                "3d6e917b362b6092",
                "d6dd3538d587d97f",
                "52301dce9e1f5518",
                "e3f77cc605c03e89"
            ]
        ]
    },
    {
        "id": "3d6e917b362b6092",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Solar_PV1_Power",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n  msg.payload = (a - 65535) / 1;\n} else {\n    msg.payload = (a) / 1;\n}\nif (msg.topic === \"Solar_PV1_Power\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 720,
        "wires": [
            [
                "011c215fda45d573"
            ]
        ]
    },
    {
        "id": "d6dd3538d587d97f",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Solar_PV2_Power",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n  msg.payload = (a - 65535) / 1;\n} else {\n    msg.payload = (a) / 1;\n}\nif (msg.topic === \"Solar_PV2_Power\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 570,
        "y": 760,
        "wires": [
            [
                "011c215fda45d573"
            ]
        ]
    },
    {
        "id": "011c215fda45d573",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Solar_total_Power",
        "func": "var p1value = flow.get(\"p1value\");\nvar p2value = flow.get(\"p2value\");\nvar total;\n\nif (msg.topic == \"Solar_PV1_Power\") {\n    v1value = msg.payload;\n    flow.set(\"p1value\",msg.payload);\n}else if (msg.topic == \"Solar_PV2_Power\"){\n    v2value = msg.payload;\n    flow.set(\"p2value\",msg.payload);\n}\nif (p1value !== undefined && p2value !== undefined) {\n   total = p1value + p2value;\n   msg.payload = total;\n   msg.topic = 'solar_total_power';\n   return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 790,
        "y": 740,
        "wires": [
            [
                "e2345191f92fac15",
                "36df7f7f05f1db0f"
            ]
        ]
    },
    {
        "id": "779afc33368e966f",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Percentage",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "battery",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "%",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 390,
        "y": 120,
        "wires": [
            [
                "67c06178208ba832"
            ]
        ]
    },
    {
        "id": "67c06178208ba832",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Battery_SoC - 184",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 184, \n    'quantity': 1 }; \nmsg.topic = \"battery_soc\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 120,
        "wires": [
            [
                "56710c4029e46451"
            ]
        ]
    },
    {
        "id": "584bf3f9420e8427",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Battery_SoC",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n  msg.payload = (a - 65535) / 1;\n} else {\n    msg.payload = (a) / 1;\n}\nif (msg.topic === \"battery_soc\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 570,
        "y": 320,
        "wires": [
            [
                "07b5f34631635dc6"
            ]
        ]
    },
    {
        "id": "0cb97f47956413cd",
        "type": "inject",
        "z": "196d497cf8771b59",
        "name": "timestamp - 5 seconds",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "5",
        "crontab": "",
        "once": true,
        "onceDelay": "1",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 150,
        "y": 340,
        "wires": [
            [
                "d62cca52297dcb4b"
            ]
        ]
    },
    {
        "id": "07b5f34631635dc6",
        "type": "join",
        "z": "196d497cf8771b59",
        "name": "Join",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "5",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "num",
        "reduceFixup": "",
        "x": 790,
        "y": 300,
        "wires": [
            [
                "ef86a7ae93546f63"
            ]
        ]
    },
    {
        "id": "d62cca52297dcb4b",
        "type": "gate",
        "z": "196d497cf8771b59",
        "name": "Monitor_Gate",
        "controlTopic": "monitor_gate",
        "defaultState": "open",
        "openCmd": "open",
        "closeCmd": "close",
        "toggleCmd": "toggle",
        "defaultCmd": "default",
        "statusCmd": "",
        "persist": false,
        "x": 140,
        "y": 420,
        "wires": [
            [
                "2ca547bd628f7112"
            ]
        ]
    },
    {
        "id": "52301dce9e1f5518",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Total_Load",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n  msg.payload = (a - 65535) / 1;\n} else {\n    msg.payload = (a) / 1;\n}\nif (msg.topic === \"total_load\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 550,
        "y": 680,
        "wires": [
            [
                "59af343111c8486b",
                "36df7f7f05f1db0f"
            ]
        ]
    },
    {
        "id": "e632874042db9ac9",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Power",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "power",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "W",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 580,
        "wires": [
            [
                "2382964ea0daa659"
            ]
        ]
    },
    {
        "id": "2382964ea0daa659",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Total_Load - 178",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 178, \n    'quantity': 1 }; \nmsg.topic = \"total_load\"\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 570,
        "y": 580,
        "wires": [
            [
                "665c3c22e60cc3fa"
            ]
        ]
    },
    {
        "id": "e2345191f92fac15",
        "type": "mqtt out",
        "z": "196d497cf8771b59",
        "name": "",
        "topic": "solar",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "45c9f7441128d571",
        "x": 970,
        "y": 740,
        "wires": []
    },
    {
        "id": "59af343111c8486b",
        "type": "mqtt out",
        "z": "196d497cf8771b59",
        "name": "",
        "topic": "use",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "45c9f7441128d571",
        "x": 970,
        "y": 680,
        "wires": []
    },
    {
        "id": "85d475cc6b593256",
        "type": "mqtt out",
        "z": "196d497cf8771b59",
        "name": "",
        "topic": "export",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "45c9f7441128d571",
        "x": 970,
        "y": 600,
        "wires": []
    },
    {
        "id": "2b3d89cb0e5e47af",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "only pass export",
        "func": "var export_power = msg.payload;\nif (export_power < 0) {\n    (export_power = export_power * -1)}\nelse {export_power=0};\nmsg.payload = export_power;\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 780,
        "y": 600,
        "wires": [
            [
                "85d475cc6b593256"
            ]
        ]
    },
    {
        "id": "cfda44f12d677e0a",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Energy",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "energy",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "kWh",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 80,
        "wires": [
            [
                "5cf0d4f5b4af9811"
            ]
        ]
    },
    {
        "id": "5cf0d4f5b4af9811",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Grid Import - 076",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 76, \n    'quantity': 1 }; \nmsg.topic = \"grid_import\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 80,
        "wires": [
            [
                "56710c4029e46451"
            ]
        ]
    },
    {
        "id": "36df7f7f05f1db0f",
        "type": "join",
        "z": "196d497cf8771b59",
        "name": "Join",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "3",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "num",
        "reduceFixup": "",
        "x": 790,
        "y": 640,
        "wires": [
            [
                "ef86a7ae93546f63"
            ]
        ]
    },
    {
        "id": "91d8490a952cdf35",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Energy",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "energy",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "kWh",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 40,
        "wires": [
            [
                "ccf8235eee71b3bc"
            ]
        ]
    },
    {
        "id": "ccf8235eee71b3bc",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Grid Export - 077",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 77, \n    'quantity': 1 }; \nmsg.topic = \"grid_export\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 40,
        "wires": [
            [
                "56710c4029e46451"
            ]
        ]
    },
    {
        "id": "ee6e7308df30ad5f",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Grid_Export",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n   msg.payload = (a - 65535) / 10;\n} else {\n   msg.payload = (a) / 10;\n}\nif (msg.topic === \"grid_export\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 240,
        "wires": [
            [
                "07b5f34631635dc6",
                "9c4eb69f6c1318bf"
            ]
        ]
    },
    {
        "id": "f5a6cac805434a07",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Power",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "power",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "W",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 460,
        "wires": [
            [
                "bc823e79b3e6b815"
            ]
        ]
    },
    {
        "id": "bc823e79b3e6b815",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Grid_Grid_CT - 172",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 172, \n    'quantity': 1 }; \nmsg.topic = \"grid_ct\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 460,
        "wires": [
            [
                "665c3c22e60cc3fa"
            ]
        ]
    },
    {
        "id": "e3f77cc605c03e89",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Grid_Grid_CT",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n  msg.payload = (a - 65535) / 1;\n} else {\n    msg.payload = (a) / 1;\n}\nif (msg.topic === \"grid_ct\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 640,
        "wires": [
            [
                "36df7f7f05f1db0f",
                "2b3d89cb0e5e47af"
            ]
        ]
    },
    {
        "id": "9c4eb69f6c1318bf",
        "type": "mqtt out",
        "z": "196d497cf8771b59",
        "name": "",
        "topic": "export_total",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "45c9f7441128d571",
        "x": 990,
        "y": 240,
        "wires": []
    },
    {
        "id": "102dd7c34c4501bf",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Energy",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "energy",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "kWh",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 160,
        "wires": [
            [
                "0a6be891c280821c"
            ]
        ]
    },
    {
        "id": "0a6be891c280821c",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "PV Total - 108",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 108, \n    'quantity': 1 }; \nmsg.topic = \"PV\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 160,
        "wires": [
            [
                "56710c4029e46451"
            ]
        ]
    },
    {
        "id": "02e9c08415db5371",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "PV Total",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n   msg.payload = (a - 65535) / 10;\n} else {\n   msg.payload = (a) / 10;\n}\nif (msg.topic === \"PV\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 360,
        "wires": [
            [
                "07b5f34631635dc6",
                "2a0e0ab60cb6e56e"
            ]
        ]
    },
    {
        "id": "2a0e0ab60cb6e56e",
        "type": "mqtt out",
        "z": "196d497cf8771b59",
        "name": "",
        "topic": "PV_total",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "45c9f7441128d571",
        "x": 980,
        "y": 320,
        "wires": []
    },
    {
        "id": "f7ad56720b4cf0e7",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Load Total - 84",
        "func": "msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 84, \n    'quantity': 1 }; \nmsg.topic = \"load_total\"\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 200,
        "wires": [
            [
                "56710c4029e46451"
            ]
        ]
    },
    {
        "id": "1edaebf70288a6fb",
        "type": "function",
        "z": "196d497cf8771b59",
        "name": "Load Total",
        "func": "var a\na = (msg.payload.data / 1)\nif (a > 32767) {\n   msg.payload = (a - 65535) / 10;\n} else {\n   msg.payload = (a) / 10;\n}\nif (msg.topic === \"load_total\") {\n   return [ msg, null ];\n} else {\n   return [ null, msg ];\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 400,
        "wires": [
            [
                "07b5f34631635dc6",
                "f3f9f9b3a3cbad7a"
            ]
        ]
    },
    {
        "id": "f3f9f9b3a3cbad7a",
        "type": "mqtt out",
        "z": "196d497cf8771b59",
        "name": "",
        "topic": "load_total",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "45c9f7441128d571",
        "x": 980,
        "y": 380,
        "wires": []
    },
    {
        "id": "09470b948f700710",
        "type": "change",
        "z": "196d497cf8771b59",
        "name": "Energy",
        "rules": [
            {
                "t": "set",
                "p": "deviceclass",
                "pt": "msg",
                "to": "energy",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "unit",
                "pt": "msg",
                "to": "kWh",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 200,
        "wires": [
            [
                "f7ad56720b4cf0e7"
            ]
        ]
    },
    {
        "id": "28a6e6e1f021f287",
        "type": "emoncms-server",
        "server": "http://192.168.86.249",
        "name": "new emoncms server"
    },
    {
        "id": "45c9f7441128d571",
        "type": "mqtt-broker",
        "name": "Ashcroft MQTT broker",
        "broker": "192.168.86.65",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

Thanks so much @Bramco borrowing elements from your flow worked and everything is working as I would have expected. The data is not under one Node on emoncms. Although Valid Json gave an error simplified Json worked without issues.