Sonos TTS announcement

Hi!

We have a couple of Sonos Ones spread throughout our house. I would like to use them to output short TTS messages. I want them to play the announcements

  • synchronized on all Sonos speakers
  • using the “announcement” feature
  • increase the volume by 10 or 20 % of the current baseline
  • set certain language

I tried tts.speak:

action: tts.speak
data:
  cache: true
  message: Test
  media_player_entity_id: all
  language: de
target:
  entity_id: tts.google_translate_en_com

This works, but is not synchronized and does not let me increase the volume.

I also tried media_player.play_media as suggested by the Sonos documentation:

action: media_player.play_media
target:
  entity_id: media_player.arbeitszimmer
data:
  announce: true
  media_content_id: |
    media-source://tts/google_translate_en_com?message="I am very loud"
  media_content_type: music
  extra:
    volume: 80

This does not work (“Provider google_translate_en_com not found”).

Question: What is the best/recommended way to play synchronized announcements with increased volume simultaneously on all Sonos speakers?

Thx a lot!

Tom

I think I need to clarify my question a bit. I can’t figure out how to make

media-source://tts/google_translate_en_com

to work. What’s the correct media source syntax for Google Translate? How do I declare the language to use?

Thx a lot!

Tom

Have you tried:

media-source://tts/tts.google_translate_en_com
1 Like

Yes! Thank you! This was the right hint. For the record, here is a summary of what I figured out so far:

The easiest way to make a TTS announcement with Google Translate is to use tts.speak:

action: tts.speak
data:
  cache: true
  message: Test
  media_player_entity_id: all
  language: de
target:
  entity_id: tts.google_translate_en_com

But you can not set the volume with this approach. If you want to set the volume and the language, you still have to use media_player.play_media like this:

action: media_player.play_media
target:
  entity_id: all
data:
  announce: true
  media_content_id: >
    media-source://tts/tts.google_translate_en_com?language=de&message="Test"
  media_content_type: music
  extra:
    volume: 30

What I did not figure out so far is how to first play a notification sound and directly after the TTS message.

Maybe it helps others…

Have a nice weekend!

Tom

1 Like