Move sonos tts script into the sonos package
This commit is contained in:
parent
606cb47fb8
commit
a18bb79322
3 changed files with 37 additions and 32 deletions
|
@ -82,5 +82,4 @@ device_tracker:
|
|||
|
||||
zone: !include zones.yaml
|
||||
group: !include groups.yaml
|
||||
script: !include scripts.yaml
|
||||
scene: !include scenes.yaml
|
||||
|
|
|
@ -18,6 +18,38 @@ binary_sensor:
|
|||
friendly_name: Sonos Den Night Mode
|
||||
value_template: >-
|
||||
{{ state_attr('media_player.den', 'night_sound') }}
|
||||
script:
|
||||
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') }}"
|
||||
|
||||
group:
|
||||
Sonos:
|
||||
|
@ -27,6 +59,7 @@ group:
|
|||
- binary_sensor.den_night_mode
|
||||
- group.sonos_players
|
||||
- group.sonos_automations
|
||||
- group.sonos_scripts
|
||||
sonos_players:
|
||||
name: Sonos
|
||||
entities:
|
||||
|
@ -35,3 +68,7 @@ group:
|
|||
name: Automations
|
||||
entities:
|
||||
- automation.toggle_sonos_night_mode
|
||||
sonos_scripts:
|
||||
name: Scripts
|
||||
entities:
|
||||
- script.sonos_tts
|
||||
|
|
31
scripts.yaml
31
scripts.yaml
|
@ -1,31 +0,0 @@
|
|||
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') }}"
|
Loading…
Reference in a new issue