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 :slight_smile: )

Add ‘DEBUG’ nodes along the way so you see what your data looks like at each stage.

image

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

image

1 Like