I have a script that iterates over an array and does something to each instance.
Right now an iteration starts after the previous iteration finishes.
How can I make it so each iteration runs in parallel?
Essentially I want to “set volume AND THEN speak text” on all the matched speakers at the same time. Not sure if that makes sense?
repeat:
for_each: "{{ idle_matched_speakers }}"
sequence:
- action: media_player.volume_set
metadata: {}
data:
volume_level: 0.6
target:
entity_id: "{{ repeat.item }}"
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: "{{ repeat.item }}"
message: "{{ tts_message }}"
target:
entity_id: tts.google_en_com
enabled: true
enabled: true