Homematic IP Wired - virtual datapoints of buttons - long press fires SHORT_PRESSED command

Hardware: HmIPW-FIO6 module
OpenHAB version: 4.3.4

STR:

  • Press a button for a SHORT_PRESSED command
  • Within the first 2 seconds after releasing the button: Press and hold the same button for a LONG_PRESSED command

Current behavior:

  • SHORT_PRESSED raised for first push
  • SHORT_PRESSED and LONG_PRESSED raised for the second (long) push

Expected behavior:

  • SHORT_PRESSED raised for first push
  • LONG_PRESSED raised for the second (long) push

Log-File:

-------
First (short) press
-------
17:44:19.847 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'false' for '0017XXXXXX545C:0#CONFIG_PENDING' from gateway with id 'ccu'
17:44:19.847 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'false' for '0017XXXXXX545C:0#UNREACH' from gateway with id 'ccu'
17:44:19.849 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'true' for '0017XXXXXX545C:3#PRESS_SHORT' from gateway with id 'ccu'
17:44:19.849 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type SHORT, value true, button state null -> SHORT_PRESSED
17:44:19.849 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Delaying event for 2.0 seconds: '0017XXXXXX545C:3#PRESS_SHORT'
17:44:19.850 [INFO ] [openhab.event.ChannelTriggeredEvent  ] - homematic:HmIPW-FIO6:ccu:0017XXXXXX545C:3#BUTTON triggered SHORT_PRESSED

-------
Second (long) press
-------
17:44:20.704 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'false' for '0017XXXXXX545C:0#CONFIG_PENDING' from gateway with id 'ccu'
17:44:20.705 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'false' for '0017XXXXXX545C:0#UNREACH' from gateway with id 'ccu'
17:44:20.706 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'true' for '0017XXXXXX545C:3#PRESS_LONG' from gateway with id 'ccu'
17:44:20.707 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type LONG, value true, button state null -> SHORT_PRESSED
17:44:20.707 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Delaying event for 2.0 seconds: '0017XXXXXX545C:3#PRESS_LONG'
17:44:20.707 [INFO ] [openhab.event.ChannelTriggeredEvent  ] - homematic:HmIPW-FIO6:ccu:0017XXXXXX545C:3#BUTTON triggered SHORT_PRESSED
17:44:20.708 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'true' for '0017XXXXXX545C:3#PRESS_LONG_START' from gateway with id 'ccu'
17:44:20.709 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type LONG_START, value true, button state SHORT_PRESSED -> LONG_PRESSED
17:44:20.709 [INFO ] [openhab.event.ChannelTriggeredEvent  ] - homematic:HmIPW-FIO6:ccu:0017XXXXXX545C:3#BUTTON triggered LONG_PRESSED
17:44:20.709 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Delaying event for 2.0 seconds: '0017XXXXXX545C:3#PRESS_LONG_START'
17:44:21.253 [DEBUG] [communicator.AbstractHomematicGateway] - Received new (Boolean) value 'true' for '0017XXXXXX545C:3#PRESS_LONG_RELEASE' from gateway with id 'ccu'
17:44:21.253 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type LONG_RELEASE, value true, button state LONG_PRESSED -> LONG_RELEASED
17:44:21.254 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Delaying event for 2.0 seconds: '0017XXXXXX545C:3#PRESS_LONG_RELEASE'
17:44:21.254 [INFO ] [openhab.event.ChannelTriggeredEvent  ] - homematic:HmIPW-FIO6:ccu:0017XXXXXX545C:3#BUTTON triggered LONG_RELEASED
17:44:21.850 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Executing delayed event for '0017XXXXXX545C:3#PRESS_SHORT'
17:44:21.851 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type SHORT, value false, button state LONG_RELEASED -> null
17:44:22.707 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Executing delayed event for '0017XXXXXX545C:3#PRESS_LONG'
17:44:22.708 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type LONG, value false, button state null -> null
17:44:22.709 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Executing delayed event for '0017XXXXXX545C:3#PRESS_LONG_START'
17:44:22.710 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type LONG_START, value false, button state null -> null
17:44:23.254 [DEBUG] [mematic.internal.misc.DelayedExecuter] - Executing delayed event for '0017XXXXXX545C:3#PRESS_LONG_RELEASE'
17:44:23.255 [DEBUG] [virtual.ButtonVirtualDatapointHandler] - Handled virtual button event on 0017XXXXXX545C:3: press type LONG_RELEASE, value false, button state null -> null

As I was the one who last touched this code, I think I know what’s going on. You’re hitting this code path, and since no long press is already going on, the DP value stays untouched (that is, SHORT_PRESSED), which is why the channel triggers again. What’s missing there is an else clause setting the DP value to null.
Unfortunately I had to code this blindly, as I only own HM (non-IP) devices. In the equivalent HM code path I got it right :wink:
I’ll submit a PR.

Perfect, thank you. If there is a build available, I could use it for testing with my IP Wired component.

You can try this binding jar. It’s built off the 4.3.x branch + the PR changes on top. I haven’t tested the jar myself though, because I’m running 5.0 already, so please let me know about the testing results.

Tested with your jar file => works as expected. Thank you

1 Like