home-assistant/scripts.yaml

32 lines
1.3 KiB
YAML
Raw Normal View History

2018-03-23 01:01:46 +00:00
sonos_tts:
2018-03-25 02:46:03 +00:00
alias: "Sonos TTS"
2018-03-23 01:01:46 +00:00
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') }}"