MQTT to InfluxDB function problem

Greetings all. I'm working on a piece of a flow to store existing MQTT data coming into a dashboard (working) and can not get the function to work to reformat for InfluxDB. All of the existing flow works (albeit cobbled and ugly) to display data on the dash.

Complete Flow. Working change node circled in green to drive a meter. Similar syntax used of the function node (circled in red) kicks out "generator", but not "CHP".

Raw JSON coming out of the MQTT node:
Raw subscribe JSON

Change node syntax that works
Change node for meter

Function node syntax that doesn't work
Non-working function node

Function node error
function node error

I've looked through every tutorial and reference I can find and don't understand it, so any assistance appreciated.

the -are not allowed in JS when using .notation
you will need to use the [ ] notation
msg.payload["CHP-Generator-KW"]

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.