Duplicate msg output (undefined and value)

Hi all,

I am new with Node-red and started with my AhoyDTU solar panels streaming values to an influxdb - worked perfect.

Now I am trying to stream my smart meter values via MQTT. Data are coming in perfect, but I have an issue when I split the values.

I use the function method as follows:

var value1 = { payload: msg.payload.Total };
var value2 = { payload: msg.payload.Supply };
return [value1, value2];

I get the values, but - each time I also get an output message that says undefined.

Anyone can support? Don't know what I do wrong ....

What is the data coming in? Add a debug node (set to display the complete msg object) to the output of the node feeding the function node.

Then copy past the results to a reply

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

Found it - it was due to the split node .....

1 Like

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