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
Colin
2
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
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
Colin
4
So did my suggestion work for you?
Just tried it and no it didn't work sorry
The two debugs look like this
Colin
7
You mistyped into the change node
1 Like
Ahh, well that was embarrassing
Yes indeed your example worked !
Stopping to think is never a good idea when typing
system
Closed
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.