What is recommended? Multiple actions in an automation or one action to call a script?

I am setting up a new automation and was wondering what the pros/cons are to an automation with multiple actions or an automation with one action that calls a script containing those actions.

Pros of scripts:

  • Use of delays in the sequence of the script
  • Call your script from multiple automations is nice and easy
  • Option to test/control your script in the frontend of your HA

Cant really think of a downside using scripts. I’ve recently moved all my switch actions in to scripts, added some delay functions and its really working fine so far :slight_smile:

2 Likes

What if you have an automation with one action?

Delays can also be used inside actions.
The others reasons metioned are indeed advantages that made me decide to use scripts more and more

Delays inside actions? How do you do that?

You can cancel a script once in progress while you cannot cancel an automation once triggered.

1 Like

Delays in actions are no different from delays in scripts.
See https://home-assistant.io/docs/automation/action/
There is an example which uses a delay inside the action

1 Like

Ok, I think if you want to cancel (not delay), you need a script. If you have a series of many actions that you want to stop, then you need to cancel, not delay.