Smart Nora + temperature?

I've just started playing with Smart Nora and wondering how to send temperature to a SN sensor node?

I have a test that works but not sure the right way to implement it in a flow. the test inject is like this

{
    "temperature": 24.1
}

But how do I get the a payload of temperature into that object form ?

After a dozen or so tries I came up with wish works

var temp = msg.payload
msg.payload = {temperature:temp}
return msg

Do you have the required temperature in msg.payload? If not where is it?

If it is in the payload then you can move it using a Change node configured like this

image

Feed that into a Debug node and check it is what you want.

1 Like

Yes the function has msg.payload incoming to it containing the temperature

2022-12-09 11_40_01-Node-RED _ 192.168.2.207

So did my suggestion work for you?

Just tried it and no it didn't work sorry

The two debugs look like this

2022-12-09 11_38_27-Node-RED _ 192.168.2.207
2022-12-09 11_38_04-Node-RED _ 192.168.2.207

image

You mistyped into the change node

1 Like

Ahh, well that was embarrassing :grinning_face_with_smiling_eyes: :roll_eyes:

Yes indeed your example worked !

Stopping to think is never a good idea when typing :grinning:

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