Google home TTS stopped working

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

an even easier solution! :laughing: thanks!

Same here,

after updating few hours ago to Version: 0.83.2 google home TTS not working…

by
kikan

File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1177, in _event_to_service_call
await service_handler.func(service_call)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 177, in handle_service
self._platforms.values(), func, call
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/service.py”, line 250, in entity_service_call
permission=POLICY_CONTROL
homeassistant.exceptions.Unauthorized: Unauthorized

hi,
i did change gtts_token.py, but no help

by kikan

my TTS stopped working and I noticed it last week, not sure exactly when it broke.

I can confirm that upgrading to the 0.83.2 docker image resolved the issue. It’s working again now.

Mine stopped working again.

I too, can confirm that also latest Hass.io with 0.83.2 fixed the issue.

hi,
today i did clean installation and still not working…
i did install python 3.6 and still same problem…
im using hassbian and virtual env…
description.xml on port 80 is working.
.
any news regarding this problem?
here is the output when i executing service .

thanks
by
kikan

018-12-03 21:59:07 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall switch.turn_on (c:d07c0cb0b5d04df681929083295bcf64): entity_id=[‘switch.led_kitchen’]>
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1177, in _event_to_service_call
await service_handler.func(service_call)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 177, in handle_service
self._platforms.values(), func, call
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 250, in entity_service_call
permission=POLICY_CONTROL
homeassistant.exceptions.Unauthorized: Unauthorized

Did you ever fix your issue?