-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsonos_say.yaml
47 lines (38 loc) · 1.09 KB
/
sonos_say.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
---
alias: Sonos TTS
icon: mdi:speaker-message
description: >-
Sonos text to speech (TTS) on all speakers unless it's during business
hours on a weekday (Mon-Fri, 8-5) then the office speaker will be omitted.
Will play a chime before the TTS recording.
mode: queued
variables:
base_url: !secret internal_url
sonos_group: >-
{% if now().weekday() < 5 and 8 <= now().hour < 17 %}
group.sonos_all_but_office
{% else %}
group.sonos_all
{% endif %}
sequence:
- action: media_player.play_media
target:
entity_id: "{{ sonos_group }}"
data_template:
media_content_id: "{{ base_url }}/local/audio/chime01.mp3"
media_content_type: music
announce: true
extra:
volume: 15
- delay:
seconds: 2
- action: media_player.play_media
target:
entity_id: "{{ sonos_group }}"
data_template:
# yamllint disable-line rule:line-length
media_content_id: media-source://tts/tts.elevenlabs?message="{{ message }}"&voice=Valentino
media_content_type: music
announce: true
extra:
volume: 20