-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
51 lines (49 loc) · 2.21 KB
/
scripts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
sonos_say:
alias: "Sonos TTS script"
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
with_group: yes
- service: media_player.sonos_unjoin
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
volume_level: "{{ volume|default(0.5) }}"
- service: tts.google_say
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
message: "This is a TTS test"
- delay: "{{ delay|default('00:00:00') }}"
- wait_template: "{{ is_state(sonos_entity|default('media_player.master_bathroom'), 'playing') }}"
timeout: '00:00:05'
- wait_template: "{{ not is_state(sonos_entity|default('media_player.master_bathroom'), 'playing') }}"
timeout: '00:00:20'
- service: media_player.sonos_restore
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
with_group: yes
sonos_working:
alias: "Sonos Working Script"
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
volume_level: "{{ volume|default(0.5) }}"
- service: tts.google_say
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"
message: "{{ message }}"
- delay: "{{ delay|default('00:00:00') }}"
- wait_template: "{{ is_state(sonos_entity|default('media_player.master_bathroom'), 'playing') }}"
timeout: '00:00:05'
- wait_template: "{{ not is_state(sonos_entity|default('media_player.master_bathroom'), 'playing') }}"
timeout: '00:02:00'
- service: media_player.sonos_restore
data_template:
entity_id: "{{ sonos_entity|default('media_player.master_bathroom') }}"