Google TTS has stopped working (Hassio)

I haven’t changed anything recently and Google TTS stopped working. I’ve tried aiming TTS at a Google Home, a Google Mini and my Logitech Media Server - all of which have worked in the past. The LMS was confirmed working several hours ago.

I can see in the states dev tool that the device is trying to play a URL from my Hassio installation. Ala:

https://WORLD_REACHABLE_ADDRESS/api/tts_proxy/6890986ffabc460e51126d559082d124cfa546f3_en_-_google.mp3

The state for the Google Home, LMS, etc, becomes “playing”. I can see the URL for the TTS-generated MP3 change when I send new text. I can load this URL into a browser and hear the TTS. But none of the devices will play the file. They just stay permanently in a state of “playing” with no sound.

I’ve also confirmed that my Let’s Encrypt certificate is up-to-date.

I’ve restarted Hassio. I’ve shut-down, unplugged, and restarted the entire Raspberry Pi.

Any suggestions?

Whats your base_url set to under the http configuration?
If the mp3 manages to download it almost certain that the issue is the base_url value. I battled with this last night.
The following settings work for me:

  1. base_url: ExternalDNSNameOfHASS ---- Don’t put https:// or specify a port
  2. Router - Port forward 443 to 8123 on the HASS internal IP

If all else fails, I’ve been reading here on the forums that it may have to do with NAT Loopback. Try enable it if you have the setting in your Router.

Thanks. I’ve got my base_url and router configured the same way as you. For the base_url, I’ve got just the hostname - no https or slashes.

My router supports NAS loopback (I’ve got a Netgear R7800). I’ve been using TTS for a while - it just recently stopped.

I can get the TTS file to play back through a browser. Or a media player (like Windows media player).

But if I use media_player.play_media to try to play the (working) TTS mp3 on a device (Google home, Logitech Media Server) it fails. If I use Logitech Media Server’s “tune in to URL”, still no luck. Both devices go to a state of “playing”, but they stay that way forever. As if they’re playing back a long MP3.

Just to be sure, I checked ip_bans.yaml and my devices aren’t blocked there.

Just as a test, I copied the MP3 to another web server inside my local network. I forwarded a port to it so that I could test whether the issue was loopback. The MP3 played fine from the other web server. I wonder if there’s a weird header issue or similar with AIOHTTP?

Geez, that is bizarre!
I was in your shoes, the only other thing I did was enable NAT PPPOE, bounced the Router, HASS and the GH. Also cleared everything in the TTS folder and stone the crows it worked again!

Remove the base_url from your config and the TTS will play.

Removing base_url didn’t correct the problem.

So, today I rebuilt my Hassio RPi. Installed fresh and moved-over my yaml. I even switched over to using ethernet instead of wifi.

I’m having the same exact issue. TTS files are being created correctly, but will not play on any of my devices.

I also tried copying one of the created TTS files over to my WWW (local) folder. No luck playing it via a media_player.play_media. I could play from the www/local folder over HTTP to a browser. Just not on any media devices controlled by Hassio (Kodi, Google Home, Squeeze Player).

This worked great up until mid-May.

Im not running hassio. but have the same problem.
It was working until about a week ago.

What does your log show?

No errors in home_assistant.log. None in Squeeze Player’s log.

Out of curiosity, I signed up for a key for Microsoft’s TTS. It works fine. I think that something is broken with Google TTS specifically.

Seems to be something specific with Hass.io I’d report it on GitHub

Coming back to this. I’m still having this problem. I can’t get Google or Polly TTS to work on Hassio. I’m wondering if there’s perhaps an issue with TTS_PROXY.

HTTP component is:

http:
  api_password: PASSWORD
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  base_url: SUBDOMAIN.dyndns.org
  ip_ban_enabled: True
  login_attempts_threshold: 5
  trusted_networks: 127.0.0.1

for the base_url, I’ve also tried:

I’m using LetsEncrypt and my cert is up-to-date and valid (and I can access my HA from outside my local network). Loopback works on my router and I have ports 443 and 8123 forwarded to HA.

I’ve tried specifying the base_url paramater for each of the TTS platforms, too. I’ve tried playing to Chromecast, Google Home and Squeezeplay.

On Squeezeplay, I can see that the file is being created and the correct URL is sent to the device. I can play the created MP3 back in a browser by copy/pasting the URL from Squeezeplay’s playlist.

On Google devices, I never hear the alert tone that sounds before playback begins.

No errors in the HA log.

1 Like

Did you ever find a solution to it. I am in the same boat after trying the most common troubleshooting steps.

Just for my understanding, I understand google TTS is not a free service (even Amazon and Microsoft is not). Do I need to activate it with my google account and get this account setting setup somewhere in HA configuration.

Below is my config

http:
base_url: 192.168.10.24

# Text to speech
tts:
  - platform: google
    cache: true
    cache_dir: /config/tts
    time_memory: 120

Any clues to make it work

For me, it’s an issue with Let’s Encrypt. If I turn off encryption, everything works. I can’t send TTS to anything - Squeezeplayer (on another RPi and on a Windows machine), Google Home, etc.

My current workaround is that I installed HA on a spare RPi with just enough to do TTS. My main system triggers TTS via API calls. Klunky, but it’s been working for a while.

As far as I understand , SSL is disabled on my setup. (just for confirmation can you please inform how/where to confirm whether SSL is activated or not). Is it the http component configuration, for me I have only given IP address without any protocol (http/https).

I have tried most of the tips, however to no avail. I can see that google_tts say service called, probably with the text I have input in the field to be spoken, however no file gets created in the specified folder (/config/tts or /tmp).

Plus as i understand that google TTS is a free and paid tiers based service, but apparenlty looks like it needs cloud API account and login to be able to use API.

https://cloud.google.com/text-to-speech/pricing#pricing_table

So how and what approach HassIO google tts say service takes to send the text to the cloud to be converted in speech. Is it using a free tier account. Pardon if my queries make no sense based on my limited knowledge.

I guess I feel either the text is not passed on to the TTS service, or if it does, the file never gets created in the TMP folder to be played via Google Mini Speaker.

Any guidance to troubleshoot further would be nice.

Thanks.

That sounds like a different issue altogether. My files are being created just fine - they just can’t be read by any device.

Ok,

So any further troubleshooting tips which you are suggest.

Thanks,.