Node red - Velbus Glasspanel button - Hue lights(SOLVED)

I might be able to assist Mr Verbist… :wink:

Have you seen these ??

What you need is a Function node to isolate the Button Events, then query the state of your Hue Lights and act accordingly.

You can have a seperate Flow or DSL rule to change the state of the feedback LEDs dependant on the state of the HUE Thing.

Give me a shout if you need more information… (you’re the one that got me on Slack in the first place)

A pair of DSL rules might look like this

rule "Velbus button to Hue lamp"
when
Channel "velbus:vmbgp1:xxxxxxx:ch1" triggered PRESSED
then

if (Hue_Lamp_Switch.state == ON)
{ Hue_Lamp_Switch.sendCommand(OFF)
}

else

{ Hue_Lamp_Switch.sendCommand(ON)
}

end


rule "Hue Lamp to Velbus feedback"

when

Item Hue_Lamp_Switch changed

then

if (triggeringItem.state == ON)
{
VelbusGP1ButtonFeedback.sendCommand("SET_LED")
}
else

{
VelbusGP1ButtonFeedback.sendCommand("CLEAR_LED")
}

end