Skip to content

Commit ba75fed

Browse files
authored
Announcements over Sonos while music is playing (#56)
1 parent a919330 commit ba75fed

File tree

3 files changed

+18
-52
lines changed

3 files changed

+18
-52
lines changed

components/packages/tts.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

scripts/sonos_play_file.yaml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,13 @@ variables:
2020
{% endif %}
2121
2222
sequence:
23-
- action: sonos.snapshot
24-
data:
25-
entity_id: "{{ sonos_group }}"
26-
27-
- action: media_player.volume_set
28-
data:
29-
entity_id: "{{ sonos_group }}"
30-
volume_level: "0.3"
31-
3223
- action: media_player.play_media
33-
data:
24+
target:
3425
entity_id: "{{ sonos_group }}"
26+
data_template:
3527
media_content_id: "{{ base_url }}/local/{{ audio_url }}"
3628
media_content_type: music
37-
38-
- delay: "{{ delay }}"
39-
40-
- action: sonos.restore
41-
data:
42-
entity_id: "{{ sonos_group }}"
29+
announce: true
30+
extra:
31+
volume: 15
4332

scripts/sonos_say.yaml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,27 @@ variables:
2121
{% endif %}
2222
2323
sequence:
24-
- action: sonos.snapshot
25-
data_template:
26-
entity_id: "{{ sonos_group }}"
27-
28-
- action: media_player.volume_set
29-
data_template:
30-
entity_id: "{{ sonos_group }}"
31-
volume_level: "0.3"
32-
3324
- action: media_player.play_media
34-
data_template:
25+
target:
3526
entity_id: "{{ sonos_group }}"
27+
data_template:
3628
media_content_id: "{{ base_url }}/local/audio/chime01.mp3"
3729
media_content_type: music
30+
announce: true
31+
extra:
32+
volume: 15
3833

3934
- delay:
40-
seconds: 3
41-
42-
- action: tts.speak
43-
data:
44-
cache: true
45-
media_player_entity_id: "{{ sonos_group }}"
46-
message: "{{ message }}"
47-
target:
48-
entity_id: tts.elevenlabs
49-
50-
- delay: "{{ delay }}"
35+
seconds: 2
5136

52-
- action: media_player.media_stop
37+
- action: media_player.play_media
5338
target:
5439
entity_id: "{{ sonos_group }}"
55-
56-
- action: sonos.restore
5740
data_template:
58-
entity_id: "{{ sonos_group }}"
41+
# yamllint disable-line rule:line-length
42+
media_content_id: media-source://tts/tts.elevenlabs?message="{{ message }}"&voice=Valentino
43+
media_content_type: music
44+
announce: true
45+
extra:
46+
volume: 20
5947

0 commit comments

Comments
 (0)