"Real" momentary button / script action when button is released

Hi,

reading here about momentary button solutions I’m still not sure how I should do this:

I need a real momentary button. Not a one which makes one action when pushed for a certain time. I need a button which sets an entity to “on” when pressed and keep the entity “on” as long as it’s pressed. When the button is released, the entity should change back to “off”.

I’ve seen I can call a script when the button is pressed, but how can I call another script when the button is released?

You can’t. There is no ‘release’ action/event in Lovelace. So no way to know when you have let go of the button.

Edit: I thought there was a WTH post asking for this but I can’t find one. Only lots of feature requests: For the love of gawd can we get a momentary switch already? possibly a good WTH for you to post.

You may check this thread: Button released events?