How do I create an on-screen push button

I need a click able button on a Lovelace that I can hang some automation from. Kind of like an input_boolean, but as a clickable button, not a slide switch. Closest I’ve seen is the default for when you place a script onto a Lovelace card, but I’d rather not use a script if I don’t have to.

Ideally, it’d work like a momentary push button - state would briefly change to ‘on’ and then back to ‘off’.

Is there anything that can do that easily?

I can use a hidden input boolean and some scripting to do this, but I’m hoping for a simpler option.

There is no simple way. I use scripts or switch templates and combine them with the button-card or the custom:button-card. If you add a delay in the script at the end of it, it will show up as a toggle button that turns on for the duration of the delay.

This ‘button’ will turn on for half a second

script:
  my_button:
    sequence:
      - service: ...
      - delay:
          milliseconds: 500
2 Likes

I know this is a 4 year old post, and we have got button entities and a lot of other cool stuff.

However, this is solving a specific need for me in a dashboard with only custom:button-card