Google home TTS stopped working

I have exactly the same issue, feels like something happened to tts and google home after upgrade to 0.78. In 0.78.1 it stopped working completely.
However it works from the Google Home card.

I am still on 76.2 and TTS has also just stopped working for me

Mine worked yesterday (20 Sept) at 8:15 UK time (13 hours ago from posting this) but didn’t work at 8:15 this morning (1 hour ago).

I am on 0.76.1 (hassio) so don’t think it is related to the HA version.

Same here HA 78.1

I can confirm that the fix from here works. The process I followed on Hassbian to fix this was;

cd /srv/homeassistant
sudo python3 -m venv .
source bin/activate
sudo nano /srv/homeassistant/lib/python3.5/site-packages/gtts_token/gtts_token.py

Delete and add in the new text as shown in the link provided, reboot you Pi, fixed.

I manage to fix it using @TheFuzz4

Google TTS Problems

Sorry @kanga_who I would of done your fix but I don’t have HA running on a PI.

1 Like

Had the exact same issue and solved by following benproiii’s fix by editing it in actions.py.

Can confirm that 0.78.3 update fixes tts

1 Like

Well, I’m still facing issues after updating to 78.3. However, this time the errors are different. Please see the errors I get every time when I call TTS. On this regard, I did some search and it looks like several folks have been facing this issue. I tried few of the resolutions suggested such as remove https:// , port number and both at base_url. However, none saved me!

Platform cast not ready yet. Retrying in 120 seconds.

> Error doing job: SSL handshake failed
> Traceback (most recent call last):
>   File "uvloop/handles/stream.pyx", line 609, in uvloop.loop.UVStream._on_eof
>   File "uvloop/sslproto.pyx", line 171, in uvloop.loop._SSLPipe.feed_ssldata
>   File "/usr/local/lib/python3.6/ssl.py", line 689, in do_handshake
>     self._sslobj.do_handshake()
> ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:841)

> Error doing job: SSL error errno:1 reason: HTTP_REQUEST
> Traceback (most recent call last):
>   File "uvloop/sslproto.pyx", line 504, in uvloop.loop.SSLProtocol.data_received
>   File "uvloop/sslproto.pyx", line 204, in uvloop.loop._SSLPipe.feed_ssldata
>   File "uvloop/sslproto.pyx", line 171, in uvloop.loop._SSLPipe.feed_ssldata
>   File "/usr/local/lib/python3.6/ssl.py", line 689, in do_handshake
>     self._sslobj.do_handshake()
> ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:841)

I would suggest removing the component, rebooting and re-configuring.

Thank you for the reply Kanga_who! It was my mistake. When we had this TTS issue, I was editing the configuration for TTS and forgot to remove the base_url under TTS. After I removed the base_url, it worked like a charm! Thank you once again!

1 Like

Looks like something has changed on TTS from Google end. I’m unable to get TTS working. I do not recall on anything that had changed recently! Does anyone have this issue with the errors like below?

Thank you

2018-11-28 20:37:26 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall tts.google_say (c:eada5bf6158447c2972acd063767fb8c): entity_id=['media_player.officeroom_speaker'], message=hello>

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/core.py”, line 1177, in _event_to_service_call
await service_handler.func(service_call)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/init.py”, line 137, in async_say_handle
options=options
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/init.py”, line 306, in async_get_url
engine, key, message, use_cache, language, options)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/init.py”, line 318, in async_get_tts_audio
message, language, options)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/google.py”, line 83, in async_get_tts_audio
token.calculate_token, part)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py”, line 28, in calculate_token
seed = self._get_token_key()
File “/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py”, line 57, in _get_token_key
tkk_expr = re.search(".
?(TKK=.?;)W.?", line).group(1)

Yeah, this problem started for me today too. I had not made any changes of updated for several days. My log is almost exactly the same:

Error executing service <ServiceCall tts.google_say (c:00197ddfd299469dad9da3e9a883b88e): entity_id=['media_player.bedroom'], message=bananas>
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/src/app/homeassistant/components/tts/__init__.py", line 137, in async_say_handle
    options=options
  File "/usr/src/app/homeassistant/components/tts/__init__.py", line 306, in async_get_url
    engine, key, message, use_cache, language, options)
  File "/usr/src/app/homeassistant/components/tts/__init__.py", line 318, in async_get_tts_audio
    message, language, options)
  File "/usr/src/app/homeassistant/components/tts/google.py", line 83, in async_get_tts_audio
    token.calculate_token, part)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
    seed = self._get_token_key()
  File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 57, in _get_token_key
    tkk_expr = re.search(".*?(TKK=.*?;)W.*?", line).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Looks like Google changed something again - others are reporting the issue on the gTTS repo: https://github.com/pndurette/gTTS/issues/151
https://github.com/pndurette/gTTS/issues/150

Hopefully they’ll find and get a fix published soon.

Same here
Version .82 was working fine two days ago

2018-11-29 06:56:14 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall tts.google_say (c:47d0ff95c00746a7b07bdca9e84d6b41): entity_id=['media_player.main_speaker'], message=Please remember At 17:00 you have Greys Kate - pat kate train money ..>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 137, in async_say_handle
    options=options
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 306, in async_get_url
    engine, key, message, use_cache, language, options)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 318, in async_get_tts_audio
    message, language, options)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/google.py", line 83, in async_get_tts_audio
    token.calculate_token, part)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
    seed = self._get_token_key()
  File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 57, in _get_token_key
    tkk_expr = re.search(".*?(TKK=.*?;)W.*?", line).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
2018-11-29 06:56:26 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall tts.google_say (c:47d0ff95c00746a7b07bdca9e84d6b41): entity_id=['media_player.main_speaker'], message=Today in Derby it will be Light rain later this morning and windy until this afternoon, with highs of 14 degrees.>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 137, in async_say_handle
    options=options
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 306, in async_get_url
    engine, key, message, use_cache, language, options)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 318, in async_get_tts_audio
    message, language, options)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/google.py", line 83, in async_get_tts_audio
    token.calculate_token, part)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
    seed = self._get_token_key()
  File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 57, in _get_token_key
    tkk_expr = re.search(".*?(TKK=.*?;)W.*?", line).group(1)
AttributeError: 'NoneType' object has no attribute 'group

Same problem here. Running 82.1. Just updated pip uninstall gTTS-token ; pip install gTTS-token

2018-11-29 00:23:12 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall tts.google_say (c:d823bf9a64f248c8b8a8a2c9f4915bff): entity_id=['media_player.phoenix_kitchen_display'], message=test message>
Traceback (most recent call last):
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 137, in async_say_handle
    options=options
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 306, in async_get_url
    engine, key, message, use_cache, language, options)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 318, in async_get_tts_audio
    message, language, options)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/homeassistant/components/tts/google.py", line 83, in async_get_tts_audio
    token.calculate_token, part)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/root/.homeassistant/deps/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
    seed = self._get_token_key()
  File "/root/.homeassistant/deps/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 57, in _get_token_key
    tkk_expr = re.search(".*?(TKK=.*?;)W.*?", line).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
^C

Hi all,

Google translate token has changed again…
I’ve submitted a pull request with the fix to the gtts_token developer, but in the meanwhile this version works:

cheers,

Dora

2 Likes

Thank you doruchan,
I can confirm this is now fixed for me.

how do we modify this on a docker image?

  1. Download the updated gtts_token.py file from @doruchan 's post: doruchan/gTTS-token/blob/fix_token/gtts_token/gtts_token.py
  2. Open a terminal session on your docker host computer and navigate to the folder containing the gtts_token.py file you just downloaded and run the following command:

docker cp gtts_token.py home-assistant:/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py

  1. Restart your home-assistant docker container.
1 Like

Its fixed in the 83.2 update