A little new to all this…I usually use the visual editor. So does that mean I call the service to set the volume and then call the service again to send the tts?
Is there a reason why you added the additional complexity of creating a snapshot only if the media_player is playing/paused (as opposed to simply creating a snapshot regardless of the media_player’s current state)?
Hahaa! Glad to know I’m not going mad, and it seems I’m not alone here, my friend. I recently added the Sonos Roam 2 to my network, which is how I ended up on this thread. I already have the Move 2, but the Roam 2 is behaving differently and has brought up two issues:
1. It plays this sharp “PING” sound before the announcement.
2. I can’t seem to lower the volume, so the announcements are blasting at 100%.
My neighbours really don’t need to know that my jocks and socks are ready to be hung out on the washing line!
FYI this is my speech engine script, which handles TTS’s to single devices, multiple devices and a mix of smart speakers (Nest, AirPod, Move, Roam)
speech_engine:
sequence:
- repeat:
for_each: "{{ who | list }}" # Ensure 'who' is treated as a list
sequence:
- choose:
- conditions:
# Check if the current item is move_2 or roam_2
- condition: template
value_template: >
{{ repeat.item in [
'media_player.move_2',
'media_player.roam_2'
] }}
sequence:
- service: media_player.play_media
target:
entity_id: "{{ repeat.item }}"
data:
announce: true
media_content_id: >
media-source://tts/amazon_polly?message=<speak><break time="0.1s"/><prosody rate="125%">{{ message }}</prosody></speak>
media_content_type: "music"
extra:
volume: 50
default:
- service: media_player.volume_set
data:
entity_id: "{{ repeat.item }}"
volume_level: 0.7
- service: tts.amazon_polly_say
data:
entity_id: "{{ repeat.item }}"
message: >
<speak>
<break time="0.1s"/>
<prosody rate="125%">
{{ message }}
</prosody>
</speak>
cache: true