I am currently playing around with HomeMatic, NodeRed and some HUE lights.
What I would like to implement is a toggle switch so that I can turn a HUE light on and off by pressing the same button.
The HomeMAtic Switch is integrated via RedMatic, Hue via HueMagic.
The HomeMatic Switch is delivering a boolean "true" every time I press the button.
I can get the status of the HueLight by reading out the msg.payload.on value - this is either true or false.
What I don't seem to get working is to read out the status and dependent on the outcome change the output from the HomeMatic switch to false to then turn off the light.
In simple terms I guess I am looking for an implementation of an if statement that checks the status of the hue light but here I start to get lost
Thanks so much in advance for any help