borpin
(Brian Orpin)
7
If you are not comfortable programming, a change node might be better to extract the right bit of data (Google or CoPilot is your friend)
If I assume the incoming structure is such that your variables are created correctly,
var newmsg = {};
newmsg.payload = {};
newmsg.payload.temperature = msg.payload.object.temperature;
newmsg.payload.humidity = msg.payload.object.humidity;
return newmsg;
I’ve cobbled that from something else I do. Long time since I have needed to play with functions (everything is setup and works
)
Add ‘DEBUG’ nodes along the way so you see what your data looks like at each stage.

It appears in the right hand pane if you select ‘debug’

1 Like