Problems with google home

I am getting too often these errors when calling a service tts.google_say:

2018-11-29 11:38:11 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall tts.google_say (c:cc8c2d3cc785468ab32607776debe0b5): message=saluti, entity_id=['media_player.googlehome5670']>
Traceback (most recent call last):
  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/components/tts/__init__.py", line 137, in async_say_handle
    options=options
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tts/__init__.py", line 306, in async_get_url
    engine, key, message, use_cache, language, options)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tts/__init__.py", line 318, in async_get_tts_audio
    message, language, options)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tts/google.py", line 83, in async_get_tts_audio
    token.calculate_token, part)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
    seed = self._get_token_key()
  File "/srv/homeassistant/lib/python3.5/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'

Can someone help me to understand how to solve this?

it seems it borked recently, have a look here for a temp fix,

I must save that in the custom_component folder?

yeah download the zip file, unzip it, there will be two folder, gtts_token and tts save those folders into the custom_compents folder, then go into the gtts_token folder, and edit the gtts_token.py file, copy the code exactly from https://raw.githubusercontent.com/doruchan/gTTS-token/fix_token/gtts_token/gtts_token.py into it, save the file, and restart home assistant, and you should be back working again.

This worked for me anyway just now.

1 Like

Hmmm, i see only the raw file not the zip

zip file is here, its all linked in the first post I made,

https://github.com/home-assistant/home-assistant/files/2406996/gtts_token.zip

1 Like

hi,
I appericate this too
do I need to change anything under the TTS component in my config file too?

Shouldn’t have to no, should just work after adding the custom component and doing a restart.

1 Like