I found the original problem which was stopping me, but there are still things I am not getting.
This is the message received which I want to dissect.
{"topic":null,"host":null,"_msgid":"a2c057de.049818","_topic":null,"payload":{"Who":"TimePi","device":"UpLink","UpLink":"Online"},"_event":"node:97bcd5bc.1a76e8","condition":"Online"}
The only thing which will change is the condition and UpLink values.
So, I was trying to switch
the message.
on: msg.payload.UpLink
It wasn't working.
So I tried msg.Uplink
. Same.
So at a stretch I tried msg.condition
. Also failed.
I opened a debug
window and changed the msg.payload
to msg.condition
.
Got this:
(Nice I can't copy that. Clicking on the clipboard icon and it says "value coppied" when I paste I got my previous stuff re-pasted.)
Anyway. . . . .
So what's going on?
Putting aside the problems with the switch node - I found/fixed the problem.
Why can't I put msg.condition
in the debug node and see the value?
While here, about the message structure.
"Who":"TimePi","device":"UpLink"
(I hope)
When I am making message (from my post on subflows) I was shown how to make messages.
It was like this:
msg = {
payload: "blah",
other_stuff:"and so on"
}
(Text formatting gone wonky)
Else where I remember the names having ' around them.
Somewhere else it was not the single ' but the `""` ones.
(Second one needed to stop the quote thing happening.)
And the paste above has the names in `""`
Which is right?
What conditions need which - if any?