[SOLVED] VELBUS + Openhab Rule not working

Hello,

As mentioned in my first post, i have a working Velbus system where i am trying to add some extra funtions trough Openhab.
Therefore i found a example of creating a rule to set a switch on/off.
The only problem is that i don’t seem to get the example even working…
Maybe a little help could put me in the right way…
This is my example code:

rule "test"
when
Channel 'velbus:vmb6pbn:********:23:input#CH3' triggered PRESSED
then
    if (OUT_STP.state == ON) {
        OUT_STP.sendCommand(OFF)
        }
    if (OUT_STP.state == OFF) {
        OUT_STP.sendCommand(ON)
    }
End

In my test OUT_STP is a thing defined as a switch, which is connected to a relay-output of an Velbus Module.
I already managed to get the pressed command working ==> when i open the log from openhab and press that button, i see home.event.ChannelTriggeredEvent - velbus.vmb6pbn:******:23:input#CH3 triggered PRESSED

Any suggestions?
Many thanks and a happy New Year!

You have a syntax error
Use end instead of End

1 Like

Many thanks!

If you’re interested.

You can create the inverse rule to set the feedback led of the VMB6PBN

Correct LED states are

  • CLEAR_LED
  • SET_LED
  • SLOW_BLINK_LED
  • FAST_BLINK_LED
  • VERY_FAST_BLINK_LED

As mentioned here

You’ll need to add a Feedback_LED Item for button 3, but something like this will do the trick

rule "test Led feedback"
when
Item OUT_STP changed
then
    if (OUT_STP.state == ON) {
        Feedback_LED_23_3.sendCommand("SET_LED")
        }
    else {
        Feedback_LED_23_3.sendCommand("CLEAR_LED")
    }
end
1 Like

Ok,
This is even getting better…
Works like a charm…
Where can i find these string commands?
I also have an onkyo connected and this way, i can use a velbus pb to control volume. Also maybe my harmony hub with connected stuff…

Many thanks

These commands…

CLEAR_LED
SET_LED
SLOW_BLINK_LED
FAST_BLINK_LED 
VERY_FAST_BLINK_LED 

Or different ones

Those of other bindings…
Like i said, for example the harmony binding.

Arrrr

You’ll be needing a Harmony guru…


Hey Ward,

One tiny thought.

To take into consideration ‘other’ states that your switch item might be in, for example null when first booted, this tiny change might be suitable

rule "test"
when
Channel 'velbus:vmb6pbn:********:23:input#CH3' triggered PRESSED
then
    if (OUT_STP.state == ON) {
        OUT_STP.sendCommand(OFF)
        }
    else {
        OUT_STP.sendCommand(ON)
    }
end