I personally not in favor of long running automations as in any failures/restarts, they will not continue. I would stick with shorter/atomic automations as much as possible.
Thank you for all your help, it really is MUCH appreciated. Unfortunately, I’m not a programmer so that’s probably going to take quite some time to learn. It literarily took me 2.5 hours to figure out how to format the time to 12hr for my time zone.
I’m quickly learning what people meant when they talk about the learning curve required and functional resistance in setting up automation in HA. At the rate I’m going It’ll be 2037 before I’m done moving my home from HomeSeer to HA…
Wait, a simple 10 second delay in an automation is a point of possible failure in HA?
Delays in the order of tens of minutes and more can cause issues. Restarting may catch these automations in the delay and your devices may end up in an unwanted state.
A delay of 10 seconds or so is less likely to fall afoul of this.
The only issue is when you restart HA or reload automations (and if you save an automation in the UI editor since that automatically does an automation reload) while an automation is actually running.
So yes, it is technically possible to have issues with the automation that contains a 10 second (or even a 1 second) delay if you happen to do the above two things while the automation is actually running (waiting for the 10 second delay). And this doesn’t just work like that for delays either - wait_for_trigger, wait_template and even timers suffer from the same limitations (except timers aren’t affected by automation reloads but the automation that uses them are cancelled so it’s effectively the same result).
But it will only be an issue for that one automation and only for that specific run. Other non-running automations won’t have any problems.
But the point Tom was making is that the odds of you restarting/reloading during a short duration delay and screwing up the automation is less as the delay in the automation is shorter.
My comfort zone for a delay in any automation that I really want to run accurately is 5 minutes. Or even less if it’s absolutely critical. Anything longer than that I shy away from delays directly coded into the automation unless I really don’t care that much if the automation doesn’t complete on time. Then again I do a lot of tweaking so I am more likely to restart/reload way more often than someone who just “sets it and forgets it”. For those people long delays are perfectly acceptable and won’t cause any issues at all.
State triggers are the best way to mitigate those limitations of timers/delays but if it isn’t possible then the only way to get truly reliable delays is to use an input_datetime to set the actual time that you want the action to run.
So in summary, a 5 sec delay should be just fine the vast majority of time.
What is the functionality that you are expecting from a delay and why isn’t the current functionality wanted? Based on all the information you’ve provided, it seems that this would do what you want. I’m just trying to determine what the core problem that you are trying to solve is.
Thanks for that explanation, it’s an eye opener for sure…
It raises a question. I use time based automation a fair amount. IE: If Motion = True, Then turn fan on. If no motion for x time; turn fan off is just one of many time based automation that would be effected by “resetting everything” when work is being done to HA.
Since this is core architectural effect, what are people doing to deal with this? I have to believe there are some clever (most likely extremely complicated) solution to this?
What did you do in Homeseer? Or are you saying that after a restart, Homeseer would resume exactly where it left off within every running script that had been interrupted by the restart?
Expected.
Trigger fires automation path
Conditions processed
Actions - followed in a liner path (Hence the up and down arrow for placing actions)
Action List
Action Performed 1
< Send an audio file to the CCA device. >
Action Performed 2
< Wait > 5 sec. before continuing to next action
Action Performed 3
< Send tts to the CCA device. >
This is what I expected, but that is not how Wait (as defined in my OP) functions. Wait appears to fire the entire action list when resolved True (wait timer has completed) so Action Performed 1 doesn’t fire.
It doesn’t matter if you rarely ever had to restart Homeseer. The point is that if you ever did restart it, any scripts that were in-progress would be cancelled, just like in Home Assistant. Mitigating this is a consideration for both products, arguably more for Home Assistant because of the higher likelihood of a restart/reload.
The mitigation techniques aren’t onerous and often not required if the action’s waiting time is brief.
Delays were points of failure in HomeSeer (HS) as well. HS did not pick up the state where it left off. I use delays in irrigation automation in HA and HS before I made the switch. The delays are up to 10 minutes per zone. I know if my system reboots during the watering cycle that it is not going to complete the automation.
IMO no sprinkler controller can do what home automation can do to save water. I live in the western US so water is precious. The minor downside does not outweigh the benefit. Also why I use ups on rack servers and critical equipment.