I am working on setting up some scripts to repeat an announcement when the scripts are called.
I had no trouble setting up the counted repeat (ref Script Syntax - Home Assistant).
However, when I try to set up the until loop (preferred) or while loop (acceptable alternative) repeat, the loop never stops, and the announcement is continuously repeated until I restart home-assistant.
Here is a sample of my scripts.yaml:
repeat_announcement:
alias: repeat announcement
sequence:
- repeat:
until:
- condition: state
entity_id: input_boolean.default_debounce_10
state: 'off'
sequence:
- service: tts.picotts_say
data:
entity_id: media_player.gstreamer
message: Repeat
mode: single
I’ve tried various different conditions, changing the entity, changing the state, switching the condition type to time, etc. I continue to get the same results - once I trigger the script (I’ve used the 'run script button from the GUI inside the script editor and in the script ‘list’), it continuously runs, even once the condition is met (in the case above, input_boolean.default_debounce_10 is ‘off’).
I have tested with variations of both the repeat until loop and repeat while loop syntax, as described in the script syntax documentation here: Script Syntax - Home Assistant but I’m clearly doing something wrong.
Does anyone have any suggestions or ideas on what is causing the script to continue repeating even after the condition is met, and how I might fix it?
Thanks so much!