Google TTS - wont talk

What am I missing for my setup??
When testing my google mini will “beep” but then not say anything. If I look in the cache folder the mp3 is there and if I play it on my PC it plays fine. Just nothing comes out of the mini.

http:
  base_url: https://mybase.duckdns.org
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

tts:
  - platform: google_translate
    service_name: google_say
    cache: true
    cache_dir: /config/www/tts
    time_memory: 300
    base_url: https://mybase.duckdns.org

Try putting your HA server’s local IP address for the base_url: , including the port. Thats how I have mine setup and it works.

eg:

tts:
  - platform: google_translate
    service_name: google_say
    cache: true
    cache_dir: /config/www/tts
    time_memory: 300
    base_url: http://192.168.0.14:8123

Also, I only have the base_url: in my config, none of the other stuff

@sparkydave is correct. The TTS service is just telling a cast device to play whatever is in the cache folder, which is under the base_url. There’s a very good chance that the google home can’t get to your external address from inside your router, at least that’s my case.

I see that you have your http config set up for SSL. This actually ends up being to your detriment because unless you can hit your DNS name from inside your network, you can’t access the site due to the certificates matching your domain and not your IP.

I recommend setting up a reverse proxy like NGINX, and having that handle the SSL for you, while redirecting to your un-encrypted HA instance. This way you get the best of both worlds, from the outside, you can hit your NGINX proxy, and still get to HA, and from the internal network, you can use http://your_ip:8123, and have all your cast devices be able to access the website for serving up TTS files.

Mine died in 0.98 and never spoke again.
I’ve been relying on Node Red TTS since…
I tried many things and am at the point of creating a new VM for HA to get it working again…

Hope it’s not my issue you’re seeing…

@SteveDinn this sounds like it is exactly my issue. Do you know of a guide for setting this up?

not much of a guide, but simply use this:

tts:
  - platform: google_translate
    service_name: google_say

nothing else… Tts always works…

fwiw, these are my http: settings

base_url: !secret base_url
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
ip_ban_enabled: true
login_attempts_threshold: 10

with secret base_url in the form of:

base_url: https:/mydomain.duckdns.org:portnumber

The HA NGINX guide is here:

Depending on your set up, you can install NGINX in a number of ways, so I’d recommend googling and reading up. After that, remove the certificate stuff from your Home Assistant config. If you’re still having trouble, my NGINX config is here:

Son of a …
I have the Nginx Proxy Manager addon installed and just forgot to configured it for HA. I have it configured for other links.
Using this add on setting up Nginx is just a few clicks.
Once I did that TTS works as expected.

Thanks

1 Like

I spent the afternoon working on this. It was less than intuitive. The default behavior created the mp3 files in the /config/tts directory, which is not accessible to the speakers. So moving it to the /confg/www director seemed to help.

I’m running v101.3 on Hassio/HassOS with a Pi3 broadcasting to Sonos. It took a while to find the right cache directory setting and base URL to make things work. But now I can use the tts.google_translate_say as well as the ‘Text to speak’ option on the Sonos media play panels in the UI.

For the tts.google_translate_say service, I was also able to send a string directly to the speaker.

entity_id: media_player.kitchen
message: 'I want ice cream!'

Here is the relevant section from my configuration.yaml file:

tts:
  - platform: google_translate
    base_url: https://my-ha-hostname.duckdns.org:my-external-port
    cache_dir: /config/www
1 Like

Making it public in the www folder works great.

dap35’s solution worked well for me (a few other nginx solutions looked too complicated, and another suggestion about disabling the cache just didn’t work). Interestingly, I didn’t need the cache_dir change, and I’ve ommited a port on my base_url (https points to 443 which I have port forwarded from my router to 8123 on the internal address).

tts:
  - platform: google_translate
    base_url: https://my.domain

Works for me!

i’m using nginx as reverse proxy and hass.io on default port (http). I solved all tts problem by adding:

tts:
  - platform: google_translate
    base_url: http://my_internal_ip:8123

I cannot seem to get my tts working. I want to send a message from home assistant to Xiaomi gateway running OpenWRT. I have succesfully mananged to get mpd working and can control it from home assistant but cannot send tts…

How can I install this ultimate tts inside home assistant? (even though I have setup node-red I haven’t used node red ever, but was hoping to get on with it)

I don’t know anything about these two things.
Getting Google Home speakers to TTS just magically started working again one day, and it has since.

So after a lot of trouble I have managed to get it working, there were couple of problems, for anyone that will need to do it (some of these observations are maybe specific to the Xioami Gateway…)

config now looks like this

# Google
tts:
  - platform: google_translate
    language: en
    cache: true
    cache_dir: /config/www # use folder that is accesible to everyone on the network
    time_memory: 300
    # base_url: http://192.168.1.25:8123 # this one didn't work even though everyone recommended....
    base_url: https://<your-public-ip>.duckdns.org # use base url without port

In Xiaomi Gateway I had installed mpd and mpd-mini so I deleted both and reinstalled only mpd and configured like this:

music_directory		"/www/music"
playlist_directory		"/www/playlists"
db_file			"/www/music/database"
log_file			"/www/music/log"
pid_file			"/www/music/pid"
state_file			"/www/music/state"
sticker_file			"/www/music/sticker.sql"

bind_to_address  "0.0.0.0"
##  bind_to_address  "192.168.1.42"
##  bind_to_address  "192.168.1.25"
port   "6600"
user "root"
auto_update    "yes"
auto_update_depth "3"
audio_output {
    type "alsa"
    name "ALSA_MPD"
##    device "dmix"
##    device "CARD=tfa9882audio"
    mixer_type  "software"
##    buffer_time "100000"
}
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"

Note however that in mpd www folders are local (i.e on gateway!). I run home assistant on another RPi4 machine.

I hope it helps someone,
Cheers

Thank you, configuring base_url was the solution for me. Do you know if it is possible to setup the base_url for local media as well? I think that, for the same reason that you describe, my local media is not working on my chromecast audio.