sonos_tts: alias: "Sonos TTS" sequence: - service: media_player.sonos_snapshot data_template: entity_id: "{{ sonos_entity|default('media_player.den') }}" - service: media_player.sonos_unjoin data_template: entity_id: "{{ sonos_entity|default('media_player.den') }}" - service: media_player.volume_set data_template: entity_id: "{{ sonos_entity|default('media_player.den') }}" volume_level: "{{ volume|default(0.5) }}" - service: media_player.play_media data: entity_id: media_player.den media_content_id: https://hass.phoenixinquis.is-a-geek.org/local/chime.ogg media_content_type: music - delay: '00:00:03' - service: tts.amazon_polly_say data_template: entity_id: "{{ sonos_entity|default('media_player.den') }}" message: "{{ message }}" - delay: "{{ delay|default('00:00:00') }}" - wait_template: "{{ is_state(sonos_entity|default('media_player.den'), 'playing') }}" timeout: '00:00:05' - wait_template: "{{ not is_state(sonos_entity|default('media_player.den'), 'playing') }}" timeout: '00:02:00' - service: media_player.sonos_restore data_template: entity_id: "{{ sonos_entity|default('media_player.den') }}"