Tts.google_translate_say problems (SOLVED)

So, first off: English is not my native language, just so you know if i get something wrong.

I’m not a very experienced user off Home assitant but im trying to play around with tts.google_translate_say and automations.

im using RP3 and hassio 0.95.4

My problem is that i cant get tts.google_translate_say to “speak”
This is the script (generated in the UI of Home assistant)

- id: '1562575938832'
  alias: tts test
  trigger:
  - entity_id: switch.magnet_1_2
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      language: sv
      message: testar lite för att se om den skapar tts filen.
    entity_id: media_player.bedroom_speaker
    service: tts.google_translate_say

I’ve tried the both
message: testar lite för att se om den skapar tts filen.
and
message: “testar lite för att se om den skapar tts filen.”

The TTS and HTTP part of my configuration.yaml:

http:
  base_url: https://[SECRET].duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

tts:
  - platform: google_translate

The thing that happens is that my speaker (google home) comes alive, i hear the chime sound, but it dont speak my messsage.

The TTS file (.mp3) is created in the tts folder of my hassio.

if i try (but with my url and filename):

it plays my tts file.

i dont get any errors in my log file.

i tried to serch both this forum and google, but i havent found a solution yet, so i need help

if something is unclear about my question or my setup please let me know

Thanks

When you fire the automation, look at the state of the entity in the states, copy the URL that was just added to the attributes. Paste that into your browser. If you hear the file, you know it’s there and connecting, but what you may need to do is set the base URL in the google translate configuration to override the base url of your HA setup.

I’m running HASS.io, have SSL setup (hopefully correctly) and my HA base_url is the entire URL (https://subdomain.mydomain.com:8123) with the port number, and the port (as well as port 443 and 80) is forwarding on my router to the HASS.io host.

It’s working over here.

3 Likes

Thanks for the reply

i tried, got an url : https://SECRET.duckdns.org:8123/api/tts_proxy/6a0efdf280bf8c79a81f7a6e193f367bb425d129_sv_-_google_translate.mp3

tried it in browser = This site can’t be reached

i tried to remove the port (:8123) from the url and then it worked.

So i tried to remove port from base_url in TTS

tts:
  - platform: google_translate
    base_url: https://SECRET.duckdns.org

And it works now, thanks for you help, i tried in all other ways to solve it, tried to se what others had done in older versions.

Thanks again :slight_smile:

6 Likes

No problem. It’s usually something dumb like that, but every time there’s a problem, I think, “Gee, I must be too stupid to figure this out.” lol. Have a great day!

Thanks again and to you too!

And i must say that you explanation was really easy to understand (since im non english speaking and not very used to home assistant)
[And yes, i feel stupid alot of times trying to figure this out]

I am having the same problem for quite a while.
I checked the media_content_id that is assigned to the smart speaker (a Google Home Mini) and I noticed that it is refering to my local IP and not to my duckdns domain.

For all due purposes, the URL with the local IP is accessible, but it will not match the SSL certificate domain. Could this be the reason for the speaker to fail playing the audio?

Thanks for the solution in this thread. I had problems with a TTS sequence in Node-RED, which had worked previously. But that was probably before I had started tinkering with SSL.

tts:
  - platform: google_translate
    base_url: https://MYDOMAIN:8123

solved the problem.

I could then both use cloud_say and google_translate_say services in Node-RED properly.

“Tack igen” :wink:

2 Likes

had the same issue, changing base url from settings to configuration.yaml worked.