I very much appreciate your knowledge and teaching.
In this, I do not see why @jazzyisj solution, which does not cause errors that need to be suppressed is not not a better answer. Thanks for your input. Maybe it is just semantics. However, as I write scripts and finally get them ‘working’, then come back to the many months later, I need flows that my old brain can ‘restart’
If you are only trying to “throttle” the automation for a few seconds so it doesn’t trigger multiple times in a short period (for example if you have many triggers for one automation), Tom’s suggestion is simpler and actually prevents the automation from triggering at all. HASS doesn’t have to evaluate a template to figure out if the automation should trigger or not.
I really wasn’t sure if you were trying to do that or create a condition within the script to only run part of it if was recently triggered, and well, my answer directly answered your question.
But if you are just trying to stop multiple triggers for a small period of time, try the delay method. It works quite well.
And the max_exceeded: silent suppressions aren’t errors - just notifications (warnings) that let you know it tried to run again but was already running. Harmless and it just gives you a way to not see them in the logs.
That’s why I was thinking to work on the time difference.
The infinite flip/flop loop happens on a group of 8 switches connected. Sometimes (not always), randomly, they start to go on/off continuously even if the conditions are:
the only way to stop the flip/flop is to disable the automation. Wait a little and re-enable… but this is not feasible when it happens to the kids and I’m not home