Velbus glass panel button

I managed to control my relais, dimmers and bose soundtouch with Openhab. But I can’t monitor a press of a button in openhab. I want to control my bose soundtouch with a few spare buttons I have on my glass panel. Is this possible via a rule (without a virtual relais) ?

I am not sure what you mean You will need to create Switch Items in order to use rules.

Here is a rule example that I use with Alexa for my garage. It has several proxy items (dummy switches) that allow me to turn on alerts for various things.

var Timer stopMotionTimer = null
var Timer startMotionTimer = null
var Timer startLightTimer = null
var Timer stopAlarmTimer = null
val int timeoutMinutes = 60

rule "Detect Motion when Garage is Open"
when
    Item Esp_Easy_Motion changed from OFF 
then
    if(Proxy_Motion.state == ON && stopMotionTimer === null && ESP_Easy_Door.state == OFF){  // Door open = OFF
        Echo_Plus_TTS.sendCommand('Alert, garage movement!')
            stopMotionTimer = createTimer(now.plusSeconds(15)) [|
                stopMotionTimer = null
            ]
    }
end

rule "Auto ON Garage Motion Detection after One Hour when Garage is Open"
when
    Item Proxy_Motion changed from ON to OFF
then
    if(startMotionTimer === null && Proxy_Motion.state == OFF){
        Echo_Plus_TTS.sendCommand('Garage light detection suspended for one hour')
            startMotionTimer = createTimer(now.plusMinutes(60)) [|
                Proxy_Motion.sendCommand(ON)
                Echo_Plus_TTS.sendCommand('Garage light detection is now on')
                startMotionTimer = null
            ]  
    }
end
rule "Garage Light Detection"
when
    Item Esp_Garage_Lightlevel received update
then 
    val Val_Light = Esp_Garage_Lightlevel.state as Number 
    if(Val_Light >= 700 && ESP_Easy_Door.state == ON){
        Proxy_Lightlevel.sendCommand(ON)
    }
end
rule "Light Alert"
when
    Item Proxy_Lightlevel changed 
then 
    if(Proxy_Lightlevel.state == ON && ESP_Easy_Door.state == ON && Proxy_Motion.state == ON && startLightTimer === null){
        startLightTimer = createTimer(now.plusMinutes(10)) [|
            Echo_Plus_TTS.sendCommand('The garage door is closed, and light has been left on')
            startLightTimer = null
        ]
    }
end
rule "Turn on alarm sound for 15 seconds if garage door opens"
when
    Item ESP_Easy_Door changed to OFF
then
    if(Garage_Door_Alert.state == ON){
        Echo_Plus_PlayAlarmSound.sendCommand('ECHO:system_alerts_atonal_02')
            if (stopAlarmTimer === null)
            {
            stopAlarmTimer = createTimer(now.plusSeconds(15)) [|
            stopAlarmTimer.cancel()
            stopAlarmTimer = null
            Echo_Plus_PlayAlarmSound.sendCommand('')
            Garage_Door_Alert.sendCommand(OFF)
        ]
        }
    }
end

Hi

Do you want to monitor these button events in DSL rules or NodeRed?

Either is possible.

A DSL rule might look like this

rule "button event"

when

Channel 'velbus:vmbgp2xxxx:xxxxxxxx:xx:ch3' triggered PRESSED // from the channel information of the Velbus Thing (rather than an Item, because Channel Triggers can not be linked to Items

then

// Your commands, which can include feedback led signalling to the Velbus glass panel

end

Useful threads

It’s very possible to use two Velbus buttons to control volume, making use of the LONG_PRESS & RELEASE triggers

The problem I can fill the “type” field…
see screenshot.

I use at this moment only papergui

I see

You don’t need to add an item to Thing.

Simply because Trigger Channels can’t be linked to Items.

But…

You can reference Triggers directly in DSL rules

You just need to start with the rule text as above and insert the channel code to match your own panel

You can click on the double boxes to copy the text to your pc clipboard

Ok, and when I have copied it, where can I use it ?
In rules ?
In Habpanel ?

ps: I’m now working on a PI, but I have installed another velbus binding(found on the velbus forum) on openhab on a windows machine, there the Type can be selected.
I cannot use that version on my PI, I can’t connect with putty (wrong password…)

Hi

If you’re new to openHAB2, I’d suggest reading the docs carefully and try little things.

Once you’ve got your head around how the DSL text rules work, it’s quite straightforward to adapt rules to work with Velbus hardware.

Just search this forum with terms like

triggered+Velbus+pressed

triggered+Velbus+long_pressed

Or you can look into using NodeRed as a visual rules solution.
I’m happy to help you create the Function nodes to filter the Velbus button events.

As for dropping the JAR file onto your Pi, have you setup the SSH access?

I don’t use Pi hardware, but plenty of great people on here do.

Thanks for your reply,
Before I jumps into command lines en scripting, …
so it is normal that I can’t program this functions in the paperui ? (buttons are not linkable (blue))image

SSH is working now, the password is openhabion and not habopen !:grinning:

Hi

It looks like you’ve got a perfect understanding now :smile:

It is normal for Trigger Channels not to be configurable within PaperUI, I’ve never really asked why, as the DSL rules / Node-Red have made everything work so far.

Until you start looking at LONG_PRESS & RELEASE actions for incrementing volumes etc, the DSL rules work just fine.

(Personally speaking) I’ve found Node-Red really easy for Volume / Brightness long press logic, I’m happy to share a flow template if you want to take a look.

The DSL rule example I posted earlier will get you straightforward button event linking.

The same as the other examples that people have offered.

Linking other events back to the Feedback LED status is easy enough, but I would advise putting that logic into seperate rules, so that the LEDs remain in sync.

Good luck,

Stuart

Wow, did you read any of the documentation or you can not type?:roll_eyes:

For others, it openhabian, not openhabion or habopen.

Good luck with accessing the console.:rofl:

The ssh login password is openhabian
The console password when using openhab-cli console is habopen.

Congrats, you just prevented another new topic…but only if others take time and read your post, not to mention the official documentation.:expressionless:

Automation with no comprehension, sometime the thought frightens me.:neutral_face:

1 Like

Only if you post it in a video tutorial. Only old timers actually READ instructions.

For a beginner It is not simple, I truggled more then 20 hours…
1/ get the pi working
2/ finding out how to login the pi with putty
3/ trying to login with the correct password…(and mistyping a few times :slight_smile:)
4/ finding out where and how to edit the file structure of the pi (I did it with windows explorer)
5/ finding out that you need an text editor (sublime text) to make rules (extension .rules)
6/ and now making rules and find the correct commands for velbus and sonos
and now i made this, and it works !

rule “verhoog volume Sonos Badkamer”

when
Channel ‘velbus:vmb8pbu:bc2e9d45:28:input#CH2’ triggered PRESSED
then
var Number v_adjustvolume = SonosConnectZone1_Volume.state as DecimalType
{
v_adjustvolume = v_adjustvolume + 1
sendCommand(SonosConnectZone1_Volume, v_adjustvolume)
}
end

rule “lower volume Sonos badkamer”

when
Channel ‘velbus:vmb8pbu:bc2e9d45:28:input#CH1’ triggered PRESSED
then
var Number v_adjustvolume = SonosConnectZone1_Volume.state as DecimalType
{
v_adjustvolume = v_adjustvolume - 1
sendCommand(SonosConnectZone1_Volume, v_adjustvolume)
}
end

rule “relais on muziek badkamer”

when
Channel ‘velbus:vmb8pbu:bc2e9d45:28:input#CH2’ triggered LONG_PRESSED
then
{
sendCommand(‘VelbusVmb4rynoAddress51_BadL’,‘ON’)
sendCommand(‘VelbusVmb4rynoAddress52_BadR’,‘ON’)
}
end

rule “relais off muziek badkamer”

when
Channel ‘velbus:vmb8pbu:bc2e9d45:28:input#CH1’ triggered LONG_PRESSED
then
{
sendCommand(‘VelbusVmb4rynoAddress51_BadL’,‘OFF’)
sendCommand(‘VelbusVmb4rynoAddress52_BadR’,‘OFF’)
}
end

1 Like

Reading the documentation would have avoided the password issue. You just validated my point

Ready for more? Connect to your Raspberry Pi SSH console using the username openhabian and password openhabian . You will see the following welcome screen:

From the official installation instructions.

Again, in the instructions.

Connect to the Samba network shares with username openhabian and password openhabian

Instructions?

The openHAB VS Code Extension offers support for rules building. It includes syntax checks and coloring, validation with error markers, content assist (Ctrl+Space) incl. templates etc. This makes the creation of rules very easy!

from Rules | openHAB

Need I continue?
There is also a good section on openHAB concepts in the documentation. You chose to travel the difficult path.

2 Likes

You have a point… all this info can be found in the docs.
But there are al lot of pages were you must find the correct info.

Can you point me to the correct page where I can find how I can make a (virtual) button in the habpanel that triggers a rule (or script)

and I’m still curious why in paperui, (velbus) buttons cannot fire an action (via rules in paperui), and thermostates can…

Sorry, I do not (yet?) use HABPanel or Velbus.
A virtual button would just be an Item that can be referenced and/or set in a Rule.Just create an Item with no linked channel to create a virtual button. I assume the Item would be a Switch?

What have you tried? This forum is geared more to help somebody resolve their issues and learn. It is not a Help Desk just providing solutions.

How to ask a good question / Help Us Help You - Tutorials & Examples - openHAB Community

It is no different in habpanel!!.
What you need is to create a virtual item first. And then link it in Habpanel.
Whatever you do with this item, could be as well as a trigger in a rule.

They can, and it´s pretty easy… But you need to understand how to create the item… This is where you seem to have gone stucked. Try searc for vitual items. As wel as channel triggers, (velbus button IS the channel trigger).

2 Likes

Most people read documentation before embarking on this journey.
First, study the concepts of OH.

The configuration Guide is a good next step.

Rules are described here.

Please read this information and return after you have tried to implement something. You could surprise yourself.

1 Like