Add display options for scripts

Right now, the only simple way to manually trigger a script is to put it into a group. It then appears in the UI with the script name followed by either an “ACTIVATE” button (if the script runs quickly) or a switch (if the script contains any delays).

That’s a great default behavior, but it’d be lovely if we had some control over it. For example, I just wanted to insert a couple seconds’ delay between two steps in a script, but to me it’s still an “immediate” script — it feels like the wrong UI to flip a switch and then watch it quickly flip itself back.

Could we add some option or parameter for overriding the default, allowing us to ACTIVATE a script even if it has a delay, or maybe even display a switch for scripts that currently show ACTIVATE? (I’m not sure why you’d do the latter… but it really ought to be up to the user, right?)

If you customise the script with can_cancel: false in your customize section it does you first request

or you can use input_boolean with some rules for automation

Can you explain how to do that? I searched and couldn’t find can_cancel anywhere in the docs or via google. I tried:

  night_mode:
    customize:
      - can_cancel: false
    sequence:
      - service: light.turn_on
        entity_id: light.zachs_bathroom_dimmer_level
        data:
          brightness_pct: 3
      - service: notify.notify
        data:
          message: 'Good night!'
      - delay:
          seconds: 5
      - service: switch.turn_off
        entity_id: switch.office_lights_switch

…but this just causes Hass to not load scripts at all.

Thank you, but input_boolean appears to suffer the exact same limitation: it always appears as an on/off switch. I want a push button (that simply triggers a script when pressed).

Customisation needs to be in the customize section.