in my alarm automations, I use this repeat-until sequence:
repeat:
sequence:
- service: tts.google_say #tts.cloud_say
data:
language: >
{{states('input_select.intercom_language')|lower}}
entity_id: *alarm_players
message: >
{% set language = states('input_select.intercom_language') %}
{% if language == 'En' %} {{message_en}}
{% elif language == 'Nl' %} {{message_nl}}
{% else %} {{message_en}}
{% endif %}
- delay:
seconds: 7
- service: script.play_alarm_sound
data:
player: *alarm_players
- delay: 10
until: >
{{is_state('alarm_control_panel.ha_rpi4_alarm','disarmed')}}
the first delay of 7 seconds, suffices in testing the config, but might be too short, when the message gets longer because of the triggering offenders Anyways, it is a bit too long already, and I would wish the alarm sound to really attach to the notification. Scaring their socks off so to say.
Was thinking of wait_templating this for the alarm_players to be ‘idle’, but that might be too complex, since they are
- service: media_player.volume_set
data:
entity_id: &alarm_players
- media_player.googlehome_library
- media_player.googlehome_hub
- media_player.googlehome_hall
- media_player.googlehome_master_bedroom
and I don’t think we can easily template that into the wait_template? Of course I could hack that to 1 of the alarm_players and use
{{is_state('media_player.googlehome_hall','idle')}}
odd thing is, when playing the tts.google_say service, the media_player isnt changing its state, and the
next service script.play_alarm_sound
starts playing too soon for the google_say to even begin.
Forcing me to fall back to the hard_coded delay.
Anyone with a golden suggestion?
thanks for having a look!