On HA, I’m using ‘Event sensor’ HACS add-on to track the switch events.
When I, for example, hold both lower buttons to generate event ‘98’, immediately after that there comes event ‘99’ which means the lower buttons were shortly pressed (not holded). So holding first generates correct ‘hold’ event ‘99’, but immediately also ‘press’ event ‘99’.
I’m trying to catch these events to automate stuff in HA, but getting that ‘hold’ event is impossible when ‘press’ event overrides it. Those 2 events come 1s - 2s apart from each other.
I am using the RunLessWire Friends of Hue switch, but get the same behavior; every long press also triggers the short press.
When configuring the switch via Hue app you can configure separate actions for short press versus long press, but in HA EventSensor history shows presses and releases.
I really don’t recall this issue anymore, but I guess I just worked my way around it.
Could you try my code below? First there’s an automation to catch the initial button press. The automation then calls a script that will catch the actual action user wanted to execute. First create “input_text.abb_switch_action” that will catch the button action.
You have to figure out what states your buttons will generate. Mine will generate:
recall_scene_0
recall_scene_1
recall_scene_2
…
recall_scene_7
press_1_of_2
press_2_of_2
release_1_of_2
release_2_of_2