Can a running automation be stopped?


I’ve managed to write an automation which uses a repeat until loop and gets into an infinite loop sometimes.

I’m debugging this, but this is complicated by the fact I can’t see how to stop it. Is there some way on interrupting a running automation?

automation.turn_off will do that, but has the side- (or primary, really) effect of disabling the trigger. If you instead put the action into a script, then you can use script.turn_off.

Great thanks!

Just saving the automation in the UI does that?
I think it does. That is what it feel like at least.

Ensure the conditions you are using include a test that prevents more than a maximum number of repetitions.

Here’s a simple example :

  until: "{{ repeat.index > 20  or  your_other_conditions }}"