Trigger Long- and ShortPressed WallSwitches

Hello,

I like EnOcean Wall-Switches as they need not battery.
I migrated from FHEM to OH2 (it was a good decision) but I miss one thing:
When you press a wallswitch you get a “…:rockerswitchB triggered DIR1_PRESSED”
When you release the switch, ou get a “…:rockerswitchB triggered DIR1_RELEASED”
In FHEM you can create a trigger dependign on the time betwen this two events. Is there someting similar ar a script, rule…

Thanks
Robert

You should be able to detect that by using a timestamp. Save the timestamp of pressed to a DateTime item or a local rule variable. Then you can do some math on the difference of the timestamp.

You are right but I’d like to use one button for different things, depending how long you press the button.
When I simple measure the time, then the “short” Action is alread fired… Right?

HI Robert @KillRob

here you find an example of how to measure the time between pressed and released. You just have to adjust the release rule and add some more if cases which honor the different pressed time.

Best regards
Daniel

Thank you very much @fruggy83
I will try to implement this :gear: