My project is to control the color of a bulb with a color picker node. The payload is on the picture. I need to alter the payload to use in a call service node like this
{"rgb_color":[msg.payload.r,msg.payload.g,msg.payload.b]}
But I can't get the syntax right!
If you were to use an inject to set colour, what would you enter?
In other words, show us what you wish this value be converted to.
Colin
14 July 2022 13:02
5
Show us the full code and the error.
I suspect the node is wanting an object like {"rgb_color":[60,195,155]}
not a string
In a function node...
msg.payload = {
rbg_color: [
msg.payload.r,
msg.payload.g,
msg.payload.b
]
}
return msg;
Thank you! That solved my problem! After correcting to rgb_color
Colin
14 July 2022 13:47
8
Isn't that the same as you showed in your first post?
I see that now, but for some reason only Steve-Mcl's solution worked
Colin
14 July 2022 14:03
10
You must have had a typo in the line.
system
Closed
12 September 2022 14:04
11
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.