WRT this thread:
I got confused trying to make a payload and did it the wrong way.
Mia culpa.
So I was thinking about HOW I was thinking wrongly.
Here's why I was making that mistake.
Example flow:
inject - function - debug
[{"id":"8b10d682f4fe2612","type":"inject","z":"26262ba1.62dcbc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":5000,"y":7180,"wires":[["f4f62a0bc9525937"]]},{"id":"f4f62a0bc9525937","type":"function","z":"26262ba1.62dcbc","name":"Start tirigger","func":"const device = \"Foo\"\n\nmsg.topic = device + \"/cmnd/power1\"\n\nnode.warn(\"Device \" + device)\n\nmsg.payload = {\n config: {\n name: device\n }\n}\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":5155,"y":7180,"wires":[["2d5eeb80655c6a5a"]],"l":false},{"id":"2d5eeb80655c6a5a","type":"debug","z":"26262ba1.62dcbc","name":"debug 77","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":5330,"y":7180,"wires":[]}]
I was wanting to make a message with the structure:
msg.payload.config.name
(hint - there's part of the problem)
I was ACTUALLY wanting it to be:
msg.payload = {
config: {
name: "A1"
}
};
So the elephant in the room - for me at least - when I look in the debug ad copy the path I am told/given
payload.config.name
Yes, I know: I have been here for a few years now. I should know better.
But as I take a lot of things literally........ (What I see)
I think it would be more intuitive if it was shown as: