How to get value out of msg.payload

deviceId: "db1241be-ca6c-46d1-9606-9067fbc128ba"
deviceType: "switch"
name: "lounge colour2"
value: 0

this is what I get from my msg.payload can anyone tell me how I can test what the "Value:" is
I guess i can use the switch node but I can't see how to pick up on the Value (or for that matter any of the other info"

I hope this make sense

You were on the right track. Simply use the switch node and access the payload properties according to your data.

msg.payload.value,, ....


Note that object properties are case-sensitive, so value and Value would be different.

off coarse thank you so much I though it should be simple

I see you've solved your issue, but take a look at the working with messages part of the documentation too. It's always a good idea to get familiar with it :slight_smile:

1 Like

very helpfull thanks

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