Hi,
Might be a simple answer but I can’t get this to work.
What I want to do is use a button on a velbus glaspanel button and switch a hue light on and off with the same button.
I know how to use node red to switch on a hue light and change scenes etc. What I cannot get to work is how I use the input of the velbus button and use that as a trigger for the hue action of switching the hue light on and off. When I use the openhab item in node red and use the button as input it just does not register the pressed status of the button.
Anyone did something similar or point me in the right direction?>
Thanks
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
2
I might be able to assist Mr Verbist…
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
hehehe I did. I try that. So you are saying that I need to do the actual function in Node Red and have the led on the glaspannel feedback via a rule?
I tried fiddling with the node red function. What I can’t seem to get is the state of the velbus button. When I monitor it the button just gives met NULL
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
4
Hi
You can do either, in either.
The DSL rule examples above deal with both the button to HUE and the HUE state back to the Feedback LEDs.
Which are you happier working in?
The only thing that you should need to change in the Function node is the button address
It’ll look something like
velbus:vmbgp4:xxxxxxx:ch1
If you’ve done that, the next question is…
Have you connected the input to the Function node to the openHAB2 events node, to get all the data?
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
5
What’s the code for the button your are trying to detect, as shown in PaperUi?