Google TTS with Sonos

Hi

I tried to configure TTS with my Sonos speakers but unfortunately I failed:

http:
  ssl_certificate: /config/keys/fullchain.pem
  ssl_key: /config/keys/privkey.pem
  server_port: 8123
  login_attempts_threshold: 5

tts:
  - platform: google_translate

Web GUI External URL configuration: https://hass.mydomain.tld:8123
Web GUI Internal URL configuration: empty or https://192.168.205.2:8123

If I try to play a text, the MP3 file is created within the config/tts folder. I can play the file by entering the URL https://hass.mydomain.tld:8123/api/tts_proxy/03de6c570bfe24bfc328ccd7ca46b76eadaf4334_en_-_google_translate.mp3 in any browser. But still the Sonos speaker does not play the file. I can’t see anything in the logs?! :thinking:

What else could I try? I’ve read a lot of posts in this forum but still found no answer…

Thx a lot!

Thorsten

Still did not find a solution… :thinking:

image

Is this supposed to work? Because it does not work and produces this error in the log:

2020-12-28 13:48:07 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140577615322560] extra keys not allowed @ data['data']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1399, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['data']

Using the Sonos service / calls, the use of “all” works for the entity_id. You are using the tts service so you must provide actual entity_id (s) in the data field. Alternatively, you could create a group (in your groups.yaml file), restart HA, and then pass the group name in the entity_id field instead.

OK. But this example from the docs does also not work?!

service: tts.google_translate_say
entity_id: media_player.thorsten
data:
  message: 'May the Force be with you.'

I also tried:

data:
  entity_id: media_player.thorsten
  message: "May the Force be with you."

Do you have a working example?

To all the honored developers out there: do you think it’s a bug worth writing a bug report? Or am I making a mistake, which is more likely… :smirk: