An automation can be triggered while it is already running.
mode configuration option controls what happens when the automation is triggered while the actions are still running from a previous trigger.
||(Default) Do not start a new run. Issue a warning.|
||Start a new run after first stopping previous run.|
||Start a new run after all previous runs complete. Runs are guaranteed to execute in the order they were queued.|
||Start a new, independent run in parallel with previous runs.|
parallel modes, configuration option
max controls the maximum
number of runs that can be executing and/or queued up at a time. The default is 10.
max is exceeded (which is effectively 1 for
single mode) a log message will be emitted to indicate this has happened. Configuration option
max_exceeded controls the severity level of that log message. Set it to
silent to ignore warnings or set it to a log level. The default is
Some automations you only want to run every 5 minutes. This can be achieved using the
single mode and silencing the warnings when the automation is triggered while it’s running.
automation: - mode: single max_exceeded: silent trigger: - ... action: - ... - delay: 300 # seconds (=5 minutes)
Sometimes an automation is doing an action on a device that does not support multiple simultaneous actions. In such cases, a queue can be used. In that case, the automation will be executed once it’s current invocation and queue are done.
automation: - mode: queued max: 25 trigger: - ... action: - ...