Hi,
I'm using node-red-contrib-googlehome to connect my google home with node red and i have a problem
when using a node that simulates color light the function node that is after it throws this error: "TypeError: Cannot read property 'brightness' of undefined". And i dont know why because when using a debug node and setting it to display msg.payload.params.brightness it show right value. Even when using a function node that has:"msg.ledbrightness=msg.payload.params.brightness;"code inside it no error is shown. Please help!
Here is code from my function node that is throwing error:
Because you overwrite msg.payload in above code section, therefore msg.payload.brightness is no longer is defined.
[edit] may not be the case as i see you copy msg.payload and later replace it. But you may be replacing it with an empty value if the conditional where it's copied is not executed.