Differentiating Short and Long Press Triggers in Home Assistant Automations

Hi everyone, I’m thrilled to join this vibrant community and share my experiences with integrating various smart home devices. After spending over three years setting up and fine-tuning my smart home ecosystem, I’ve encountered a challenge that I’m eager to overcome. I currently have over 75 Homematic IP wired devices, a few wireless units, and a selection of Philips Hue lights. Initially, I managed everything through CCU3 and the Philips Hue app, but I’ve recently transitioned to Home Assistant, which I’m finding incredibly powerful and flexible.

One of the features I’m particularly excited about is automating my Gira SPS-6-fach switches. These switches are connected to my Homematic IP system and integrated into Home Assistant via CCU3 and Homematic(IP) Local. I’ve set up pseudo-programs on the CCU3 to push button events to Home Assistant, which allows me to monitor how each button is pressed. However, I’m struggling with a specific aspect of this setup: differentiating between short and long presses on the same button.

In my current configuration, I’m using state changes to detect whether a button is pressed short or long. While this works for long presses, which cycle through multiple states (press_long_start, press_long, press_long_release), it doesn’t handle multiple consecutive short presses effectively. This is because the state doesn’t change when the button is pressed short multiple times in a row, so the automation doesn’t trigger as intended.

I’ve tried various approaches, including using different triggers and conditions, but I haven’t found a reliable solution yet. I suspect that accessing the event attributes directly might be the key, but I’m not entirely sure how to implement this in Home Assistant. Any insights or suggestions from the community would be invaluable. I’m confident that with the right configuration, I can achieve the desired functionality and take my smart home setup to the next level. Thanks in advance for your help and support!