Extract value from switch-bot reading

Hi there.

I have recently grown fond of the switch-bot IoT devices - they are well made and seem to be open for node-red.

I am using the node: test-switchbot-devices which reads my connected devices nicely. A call returns this:

and the device I am interested in is at "object 3" in the screenshot.


and I am specifically interested in collecting the temperature value.

I suppose I run this through a function node? How should it look like?

Thanks for the help.


In a change mode
set msg. payload
to JSONata J:
$$.payload[deviceId = "DE1B6383BD87"]

That should return the object.
To get indiviual readings add .temperature etc, or later in flow use msg.payload.temperature

1 Like

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