Scripts don’t do anything by themselves. They need to be executed either manually or in an automation. This automation would trigger whenever the input_select changes and should start the appropriate timer:
I think that does help… the concepts of the 2 are fairly close, I just struggle with working out which one is being triggered against which one is a flow of event’s.
The two things to me seem very similar - hence my mistake above…
An automation consists of three parts: one or more triggers (events), optional condition(s), and an action. When a trigger happens, and there are no conditions or the conditions are all true, the action is executed.
A script only consists of one part: an action. It’s not looking for an event (trigger) to happen like an automation is.
Adding to what Tediore said.
Putting stuuf in a script, means that timimg events don’t get confused and automations can still be called.
Running an automation the second time whilst a timer in that automation is running just skips stuff straight to the action. (you have to make sure to cancel the script before calling it again if that is the issue).
Scripts also allow you to write one set of code and call it from multiple automations
Scripts can be called if you want to ‘set a scene’, I don’t use scenes, I just run a script.