Tts volume sonos

Hi,

I’m trying to adjust the volume of my tts message on my sonos but I keep getting the error: “extra keys not allowed @ data[‘extra’]. Got None”

does anyone know a solution?

service: tts.speak
metadata: {}
data:
  cache: true
  media_player_entity_id: media_player.kantoor
  language: nl
  message: De deurbel gaat.
  extra:
    volume: 40    
target:
  entity_id: tts.google_en_com

You can’t use the volume parameter with tts.speak.

From the documentation for the Sonos integration:

You can use volume with media_player.play_media. Ensure the URL for media_content_id uses the correct TTS service. In the documentation’s example, it uses “cloud” which is Nabu Casa’s TTS service.

i tried that already but it does not give anny sound.

service: media_player.play_media
target:
  entity_id: media_player.kantoor
data:
  announce: true
  media_content_id: >
    media-source://tts/cloud?message="I am very loud"
  media_content_type: "music"
  extra:
    volume: 80

Do you have a Nabu Casa account and is your Home Assistant system connected to it?

Because, as explained in my previous post, this URL uses Nabu Casa’s TTS service.

media-source://tts/cloud?message="I am very loud"
                   ^^^^^
         Nabu Casa's TTS service 

If you are using Google Translate for TTS, then you would specify it like this:

media-source://tts/google_translate?message="I am very loud"
                   ^^^^^^^^^^^^^^^^
            Google Translate TTS service 

Which TTS service are you using? If it’s Google Translate, replace cloud with google_translate in the URL (I tested it and confirmed it works on my system).

ah, I missed that part. No, I don’t have that, so I’m looking for another solution or putting the doorbell back in. thanks for the help.

You also might want to check out Chime TTS which you can use to generate a combined sound file and TTS audio

Then simply install the Google Translate integration and then the example I posted will work. It’s as simple as that.

Thnx Nimrod, i tried this one. Alredy better but:

When tts is ready, the music volume will first increase and then return to the original level. Can I also go to the original level immediately after the TTS? Or turn the volume up for tts only.

service: chime_tts.say
metadata: {}
data:
  tts_speed: 100
  tts_pitch: 0
  message: Dit is een test!
  tts_platform: tts.google_nl_nl
  language: nl
  gender: female
  volume_level: 0.2
  announce: true
target:
  entity_id: media_player.kantoor