Button released events?

Hi,

I have recently added a Shelly 2.5 device to my HA installation. I successfully created simple automation rules to toggle different lights, as proposed in the documentation.

Now, I would like to be able to dim my lights by pressing the pushbuttons that I have connected to my Shelly. I would like the behaviour to be as follows:

  • Single press: toggle on/off
  • Long press: increase/decrease the birghtness, as long as the button is pressed, keep the brightness at the level it is as soon as the button is released.

The buttons support things like single, double, triple and long click. But those are fired after the button is released. For my scenario, I would need events like “start press” (fired as soon as the button is pressed) and “release” (fired as soon as the button is released again), or similar. Is there a way to get these type of events?

Best regards,
Bart

There is a PR about this one: Add pressed and released event to allow usage as momentary button by indykoning · Pull Request #360 · custom-cards/button-card (github.com)

Please keep an eye on that one.

Yes.
It is possible to make this PR mentioned above installed on your instance so you can enjoy simple and very needed functionality.
I have used to to move my camera so as long as the button in dashboard is pressed (and hold) the camera is moving, the moment button is released, camera is stop moving. Simple and extremely intuitive.

1 Like

i need the release event for the exact same reason :slight_smile:
did you found any solution other than forking ha with a PR?

Unfortunately NOT. I use that one from PR with some stability issues.
Also to be honest recenty I did not have time to look at it.
Was hoping that maybe recent changes in HA Core have introduced this functionality in a standard button area - but also did not have a time to check. :frowning:

I’ve gone through the comments in the PR, it looks like it will never be merged.

That said, my original post was not about a Lovelace button, but about a physical hardware push button, connected to a Shelly device. So the mentioned PR would not solve my problem. I’ve switched to a different approach, with a Zigbee dimmer that has a rotating dimmer control.