#Automation vs Scripts
1 messages · Page 1 of 1 (latest)
an automation is just a script with a trigger and condition
if you don't need a trigger or condition, then you can use a script
you can just call a script when you want, and return a result if you want
Repeatable actions too. Why create a good night and a good bye automation if you're going to do the same thing with both. Call the script
So it really comes down to whether or not I need a trigger?
Mainly, yes
The timing semantics are also different. By default, scripts run to completion when called, but triggering an automation runs in parallel. But that's configurable
Usually you use a script if you want to reuse the same code multiple times in different automations like @humble nest explained.
For example I have a script to notify my wife's and my phone. I use that in multiple automations, it also supports announcing the message on our echo dots.
If I ever want to change something with that logic I have a single place to modify, not dozens of automations