My google tts is not working

Hi. My HASS.IO Google tts is not working.

My Hass.Io is running on Docker on Raspberry pi 3 model B and installed DuckDNS addon.

My configuration is as follows

http:
  base_url: https://mydomain.duckdns.org:12345
  ssl_certificate: /.../fullchain.pem
  ssl_key: /.../privkey.pem

tts:
  - platform: google_translate
    service_name: google_say
    language: ja
    cache: true
    cache_dir: /.../tts
    base_url: http://192.168.10.100:8123

The ISP I use has limited ports that can be opened and cannot access 80, 443 and 8123 ports from outside.
Access from the outside is forwarded port 12345 to the 8123 by the router.

My voice mp3 files are cached and will play properly in Japanese when played with an audio player.

What’s wrong with my configuration?

I’m sorry for my poor English

1 Like

If you trigger a sound on the media player, you should be able to grab the full URL from the attributes in the states list on that device. Take that and plug it into your browser. If you get sound, you’re on your way to success. If you don’t, then you have an issue with your base_url, most likely.

1 Like

Thank you arretx for your reply.

The base_url in tts, even if the local IP or DuckDNS url is written, even if “https” is changed to “http” or nothing is written, there is no improvement, and it will silence after the beep .
And no matter what I do, the following error occurs.

“Error 404 on load URL https://translate.google.com/translate_tts?ie=UTF-8&tl=ja&q=&tk=97985.514719&total=1&idx=0&client=tw-ob&textlen=0”

"Error on init TTS: No TTS from google_translate for "

I don’t understand the cause of these error

Hi arretx.

I checked the media player “media_content_id” from the developer tool STATES. I found that the URL refers to the Duckdns domain of base_url. I think it will work if I can redirect media_content_id to a local IP address.

Is my perception correct?

I understand you are trying to play an MP3 sound with TTS? Yes
I’m not sure if this is the same problem that I had, but I was trying to get Google TTS to play an MP3 sound as a door chime. It would’t work and after 4hrs I realised that the location of the file and the filename it self is case sensitive. My file name was “Classic-doorbell-sound.mp3” and it wouldn’t work because my file name didn’t have a capital C at the start, as soon as I changed it to make it match the file system it worked.

Your setup all looks correct though, it’s the same as mine.
Here is my yaml for the automation that calls the sound:

- id: '1558173150098'
  alias: Garage Door Bell Chime
  trigger:
  - event_data: {}
    event_type: doorbird_door_bell_doorbell_1
    platform: event
  condition: []
  action:
  - data:
      media_content_id: http://192.168.1.39:8123/local/sounds/Classic-doorbell-sound.mp3 # the capital is required because linux is case sensitive and my file name has a capital
      media_content_type: music
    entity_id: media_player.garage_speaker
    service: media_player.play_media

The only other difference is in
tts:
I have 1 extra thing

tts:
  .......
  time_memory: 300
  ........

But I don’t think that is affecting you at all.

Hi Egglec.
Thank you for your reply.

I changed tts componet configuration as follows

tts:
  platform: google_translate
  language: 'ja'
  base_url: https://192.168.1.145:8123

Then a media_content_id was created on media player and the content was the URL of a voice mp3 file as follows, but my Google home is silens.

{"media_content_id":"https://192.168.1.145:8123/api/tts_proxy/d051c5edcd7ba4441883aa200241003b1a4c6ab0_ja_-_google_translate.mp3"}

{"media_content_id":"https://192.168.1.145:8123/api/tts_proxy/7f5f5acd48cd19eb9b96a2789d0d9bec5e416fff_ja_-_google_translate.mp3"} 

The media_content_id is changing every time tts on media player.
I tried copy url and paste to chrome browser then it’s can play voice.
Why can play on browser but can’t play on google home?

I’m sorry for my poor English.
Does my English make sense?

Hi
I think likely a this problem cause is SELF-SIGNED CERTIFICATE .

Maybe, DuckDNS is create self-signed certificate and establish SSL for local network, but Google tts is reject self-signed certificate.

How do I solve this problem?

I solved the problem!
I installed NGINX Home Assistant SSL proxy add-on. As a result, the local network is no longer SSL with a self-signed certificate. So now Google tts is working properly.
thank you all.

tts:
  - platform: google_translate
    service_name: google_say
    language: 'ja'
    cache: true
    cache_dir: /.../tts
    base_url:  http://192.168.10.100:8123

3 Likes

Check out 3 solutions to My google tts is not working on this thread

Thanks a lot for this suggestion!!! It solved so many issues I was having internally !!! Just installed the proxy add-on and everything started to work automagically !

1 Like

Thank you for sharing your solution. Had the same problem and could fix it :-).