Google Home TTS not working DuckDNS & Lets Encrypt

It worked now! Thank you a lot @Sunonline. The problem is, I changed my default output device to hw:1,0 for user pi, not for homeassistant

Glad you got it working and have fun.

@Sunonline,

I’m so glad you posted about forwarding 8123 to 8123 on the HA as well as 443.
I’ve been wrestling with this for a couple of days! Sheesh!

Many thanks!

Your welcome.

I have noticed that the actual text I typed into ‘Text to Speak’ is saved as .mp3 in the tts folder so not sure why Google Home cannot just say it ??

I guess your problem might be that your Google Home Media Player is trying to reach those mp3-files in your Hassio’s /tts -folder with the base_url DNS-name and probably Google Home Media Player is hardcoded to use primarily Google DNS servers (as ChromeCast is).

Google DNS-servers (e.g 8.8.8.8) naturally returns the public IP (usually from Dynamic DNS service) and not the private IP that the media player device should connect to in your internal network.

My workaround was to have an internal DNS-server where I redirect DNS-traffic (UDP 53) going to 8.8.8.8. The internal DNS server then resolves the DNS name to the private IP address of the Hassio.

I’m not sure but instead of redirect you might also be able to block Google DNS (atleast 8.8.8.8, probably more) and then the device would use the DNS-server it got from DHCP.

Hope this helps someone, surely did the trick for me.

2 Likes

I have the same probelm, thw google home and chromecast doesn’t speak. I use duckdns with ssl. I correctly specify a baseurl with https but nothing. If i copy and paste the link from the ha states of media player like this: https://mydomain.duckdns.org:8123/api/tts_proxy/650710397eb17681bf3ac21c095ccc751d37d726_it_-_google.mp3 this can be played from every device in my internal network and also from external. Any idea?

1 Like

No one solved this problem?

I am also having this problem.

I believe I have successfully linked my google account/home mini to Home assistant. - I can tell the home to turn lights on and off, but whenever I try to use the TTS function from the Home assistant home screen the home just makes a dong sound.

I’m using duck dns on HTTPS.

I have just got mine working.

I stopped using SSL and removed the base_url line completely.

I seem to have a similar problem. Im on hassio 0.76.0. I am not using ssl as I have nginx set up and I removed base_url completely. TTS works well for a while but after a bit just stops working. If I restart home assistant it will start working again. The tts files are created but for some reason the google home will just beep and not play the tts audio. Anyone have any idea whats happening here?

I’m running Hassio 0.79.3 w/ SSL via DuckDNS and Lets Encrypt and I’m unable to get TTS to work. Like @josephkiser04 mentioned, I can see the files get created and stored in config/tts. I can even play the mp3 through the Home Assistant IDE plugin when loading the mp3–it just doesn’t send the file to my media players. Any thoughts? (I can get my media players to play music with HA, just the TTS isn’t sending the speech mp3’s through to them.)

I got it working! What fixed it was setting a port forwarding rule from 8123 to 8123. (Also, I don’t have :8123 on my config base_url. )Hope this helps others!

Sorry what mean

forwarding rule from 8123 to 8123

My internal IP of the raspberry is 192.168.8.200 and I have set the port forwarding from external wan :8123 to internal IP 192.168.8.200:8123. But the tts on google home doesn’t work…

@mr-varga I’m not sure about the Google Home. I got my setup working on my Sonos speakers. Try what @simbesh said in a separate thread: SOLVED: No TTS output from Google Home

I’ve been struggling with this same issue. TTS stopped sending to my Google Home and my SqueezePlayer. I’m running Hassio with the LetsEncrypt addon.

I’ve got my router port forwarding 8123->443 and 8123->8123. Loopback works on my router. My LetsEncrypt cert is up-to-date.

I’ve tried setting base_url in both HTTP component and TTS component. I’ve tried various base_url formats (https://mine.dyndns.org / mine.dyndns.org / https://mine.dyndns.org:8123).

I can copy the generated MP3 to an outside web server and my devices will play it correctly via media_player.play_media. But trying to play the generated MP3 when it’s on my HA Pi with media_player.play_media fails.

edit: I noted that the state of a device that I sent TTS to remains as “playing” regardless of the fact that it never plays the TTS MP3. It seems like aiohttp or the TTS proxy is reporting something incorrectly.

I tried copying the created MP3 file over to my config/www folder so that it could be accessed via https://192.168.1.104:8123/local/tts.mp3

media_player.play_media won’t play that either (though I can confirm that it’s reachable via a browser).

If I disable LetsEncrypt (take the ssl_certificate / ssl_key entries out of my configuration.yaml), TTS works fine.

http:
  api_password: PASS

  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

  base_url: MINE.dyndns.org
  ip_ban_enabled: True
  login_attempts_threshold: 5
  trusted_networks: 127.0.0.1

You’ll probably have to set up your own DNS server so that your certificate will remain valid. That’s what worked for me: Setting up a dns like this (i used dnsmasq) address=/my_custom_address.duckdns.org/192.168.myhass.ip

Thanks! That’s worked for me!

Old comment but wow. This worked for me. Thank you!

I still can’t get this to work. I’m using pfSense and I have DNS resolver on and the URL on the device is valid and works in chrome, it’s definitely something with the cert, worked before I did LetsEncrypt cert