Google Translate TTS entity not working

Hi,

My HA has Google Translate TTS available as tts.speak entity configured.

However this does not produce any sound:

service: tts.speak
data:
  cache: false
  media_player_entity_id: media_player.sonos_living_room
  message: Hello World! Hello World! Hello World! Hello World! Hello World!
  language: en
target:
  entity_id: tts.speak

Any idea why?

Entity_id is wrong.
This is an example that works for me:

          - service: tts.speak
            data:
              media_player_entity_id: group.googletts
              message: Ventana de {{ area_name(trigger.entity_id) }} abierta
            target:
              entity_id: tts.google_es_es

Change to your language.

Try using the example in the Home Assistant Sonos documentation.

Hi @mcarty ,

Thanks for taking the time.
I could have indeed use
entity_id: tts.google_en_fr or entity_id: tts.google_en_com

But check my first screenshot, I renamed google translate tts to tts_speak to make sure the problem did not come from the entity id.

This is not solving the issue…

Screenshot:

Yaml:

service: tts.speak
target:
  entity_id: tts.google_en_fr
data:
  cache: false
  media_player_entity_id: media_player.sonos_living_room
  message: Hello World!

Hi @PeteRage ,

Thanks for taking the time :pray:

I don’t see a HA Sonos doc mentioning TTS
Though I found a HA google translate TTS here which mentions

service: tts.speak
target:
  entity_id: tts.google_en_com
data:
  media_player_entity_id: media_player.giant_tv
  message: Hello, can you hear me now?

Here is my code:

service: tts.speak
target:
  entity_id: tts.google_en_fr
data:
  cache: false
  media_player_entity_id: media_player.sonos_living_room
  message: Hello World!

Seems similar, isn’t it?

When I am confused or something doesn’t work, I found that the better option is to go to → Developer Tools → Services, and try there.

There you can go to UI mode and choose entities and all. When you find something that works, copy the yaml from there.

Edit: also take a look at the logs. Usually there is a suggestion for the malfunction.

Wow, when I go to developer mode, this is working:

service: tts.speak
target:
  entity_id: tts.google_en_fr
data:
  cache: false
  media_player_entity_id: media_player.sonos_living_room
  message: Home main door open

I really don’t get WTH is this not working in my automation?

Post the whole automation. Maybe it wasn’t triggered, or the condition.

I am pressing “play” so normally trigger and conditions are skipped.
I am hearing the “gap” in my audio (plays before and after) when pressing play.

alias: Ring Doors
description: ""
trigger:
  - type: opened
    platform: device
    device_id: a9fd66655ffb6683c93260d7b8b60a29
    entity_id: 5946a19aa98733dafd1b80922398d271
    domain: binary_sensor
  - type: opened
    platform: device
    device_id: 4a02f79f099f8684a5916ac56f65a9d4
    entity_id: 870fcf832cd9d994616ba72446125161
    domain: binary_sensor
condition: []
action:
  - service: sonos.snapshot
    metadata: {}
    data:
      with_group: true
      entity_id: media_player.sonos_living_room
    enabled: true
  - service: tts.speak
    target:
      entity_id: tts.google_en_fr
    data:
      media_player_entity_id: media_player.sonos_living_room
      message: Home main door open
  - service: sonos.restore
    metadata: {}
    data:
      with_group: true
      entity_id: media_player.sonos_living_room
    enabled: true
max: 10

Go to automations, select that one and take a look at ‘traces’.

You may find some clue there.

Thanks, IMO everything looks “as it should” there

I am considering a backup, reinstalling a clean install of HAOS and restoring backup…

I doubt restoring a backup is the solution. I think I replied in another trhread before: try removing the restore after it to make sure that does not abort the speach.

Do something like this. If there is music already playing, this announces over it, and then the music continues.

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