I am trying to get the color, brightness and state from a Domoticz virtual device.
Whe brightness and state are working, but can't get the color temp working.
In the debug node, I see:
When I click the Color object and check the path to the ww variable, I see: payload.Color.ww
When using msg.payload.Color.ww in a function as variable, I get an error:
The function I use is:
var colortemp = msg.payload.Color.ww;
What am I doing wrong?
function : (error)
"TypeError: Cannot read property 'ww' of undefined"
Yes i saw that but it does not show the structue, and error contradicts it. so can we see the debug values copied directly or and image with objects expanded.
I would think your payload did not have the properties in it (that why you got the error). Something else you did fixed the issue. You can remove that line as it was just to confirm that the payload did exist in the function , and if it existed what properties it had.
I added a switch node before the function, because after adding the extra line I got a lot of logs from other idx from Domoticz. This is the switch node I added, to only filter out the idx I needed.