Cast TTS to Google Home

Hi, I ran into an issue and it happens every few days… I found myself to reboot HA to get it working again. I’ve been searching around and couldn’t find any solution so I’m not sure if this problem only occurs on my configuration.

Basically, I have a notification that casts TTS to my Google Home. It works great when it’s actually working; then all of a sudden it stops working.

I checked the log and found this:
> May 02 07:54:12 raspberrypi hass[668]: 17-05-02 07:54:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=play_media, service_data=media_content_id=https://nguyenha.duckdns.org/api/tts_proxy/017db6b5753570bf87c033054e997b5f0c8235d7_en_-_google.mp3, media_content_type=music, entity_id=[‘media_player.kitchen_home’], domain=media_player, service_call_id=1978507824-71>
> May 02 07:54:12 raspberrypi hass[668]: 17-05-02 07:54:12 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
> May 02 07:54:12 raspberrypi hass[668]: Traceback (most recent call last):
> May 02 07:54:12 raspberrypi hass[668]: File “/usr/lib/python3.4/asyncio/tasks.py”, line 233, in _step
> May 02 07:54:12 raspberrypi hass[668]: result = coro.throw(exc)
> May 02 07:54:12 raspberrypi hass[668]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py”, line 1010, in _event_to_service_call
> May 02 07:54:12 raspberrypi hass[668]: yield from service_handler.func(service_call)
> May 02 07:54:12 raspberrypi hass[668]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/init.py”, line 365, in async_service_handler
> May 02 07:54:12 raspberrypi hass[668]: yield from getattr(player, method[‘method’])(**params)
> May 02 07:54:12 raspberrypi hass[668]: File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
> May 02 07:54:12 raspberrypi hass[668]: yield self # This tells Task to wait for completion.
> May 02 07:54:12 raspberrypi hass[668]: File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
> May 02 07:54:12 raspberrypi hass[668]: value = future.result()
> May 02 07:54:12 raspberrypi hass[668]: File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
> May 02 07:54:12 raspberrypi hass[668]: raise self._exception
> May 02 07:54:12 raspberrypi hass[668]: File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
> May 02 07:54:12 raspberrypi hass[668]: result = self.fn(*self.args, **self.kwargs)
> May 02 07:54:12 raspberrypi hass[668]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/cast.py”, line 307, in play_media
> May 02 07:54:12 raspberrypi hass[668]: self.cast.media_controller.play_media(media_id, media_type)
> May 02 07:54:12 raspberrypi hass[668]: File “/home/homeassistant/.homeassistant/deps/pychromecast/controllers/media.py”, line 466, in play_media
> May 02 07:54:12 raspberrypi hass[668]: callback_function=app_launched_callback)
> May 02 07:54:12 raspberrypi hass[668]: File “/home/homeassistant/.homeassistant/deps/pychromecast/socket_client.py”, line 806, in launch_app
> May 02 07:54:12 raspberrypi hass[668]: self.update_status(lambda response:
> May 02 07:54:12 raspberrypi hass[668]: File “/home/homeassistant/.homeassistant/deps/pychromecast/socket_client.py”, line 797, in update_status
> May 02 07:54:12 raspberrypi hass[668]: callback_function=callback_function_param)
> May 02 07:54:12 raspberrypi hass[668]: File “/home/homeassistant/.homeassistant/deps/pychromecast/controllers/init.py”, line 84, in send_message
> May 02 07:54:12 raspberrypi hass[668]: self.namespace, data, inc_session_id, callback_function)
> May 02 07:54:12 raspberrypi hass[668]: File “/home/homeassistant/.homeassistant/deps/pychromecast/socket_client.py”, line 603, in send_platform_message
> May 02 07:54:12 raspberrypi hass[668]: inc_session_id, callback_function_param)
> May 02 07:54:12 raspberrypi hass[668]: File “/home/homeassistant/.homeassistant/deps/pychromecast/socket_client.py”, line 590, in send_message
> May 02 07:54:12 raspberrypi hass[668]: raise NotConnected(“Chromecast is connecting…”)
> May 02 07:54:12 raspberrypi hass[668]: pychromecast.error.NotConnected: Chromecast is connecting…

Has anyone got a similar issue? I am not sure if it’s a bug or it’s a configuration issue.
Any idea that could help me out?

Thank you.

I do something similar and have notifications that cast TTS to my Google Home.

It’s stopped working for me since about a week ago, but I’m not seeing anything in the logs.

1 Like

I’m on 43.2 and TTS to Google Home works fine. Here’s one of my automation

- alias: driveway motion
  trigger:
    platform: state
    entity_id: sensor.newdriveway_sensor
    to: 'True'
  condition:
    condition: time
    after: '21:00:00'
    before: '5:55:00'
  action:
    service: tts.google_say
    entity_id: media_player.bathroom_home
    data_template:
      message: >
        Someone probably is in the driveway. Someone probably is in the driveway. Someone is probably in the driveway. Someone is probably in the driveway.

Yeah, my automation looks similar and it works great when it does work.

Once a while, it just stops working and I see that exception in the log. Only way to get it to work again is to restart home assistant.

You’re using Pi 3 too, right? I use Pi 3 with AIO install. Be sure your Pi is up to date is the only thing left i could think of.

I’ve updated my Pi and now it’s working OK again.

Maybe it’s after updating the Pi, or maybe it was just being temperamental? (Hopefully updating the Pi fixed it)

Is this still working for you?

I ask because I plugged in my HA Pi after a long time idle last weekend, did a dist-upgrade, a rpi-update, and now I’m seeing the same issue. Was using Raspbian Lite. I’m also now unable to use the onboard bluetooth when I was before, so I’m wondering if either the 4.9 upgrade doesn’t quite handle the onboard BT yet, or if the apt-get upgrade process missed something. But, AFAIK, everything is as up-to-date as it can be.

I haven’t needed the bluetooth so that isn’t a priority, but I’m definitely missing the TTS on my Chromecast. Worst case, I’ll wipe the SD card and start over. I’ve Ansibleized my Pi setup, so once the initial config is done I should be able to get HA back up quickly. But I’d rather not if I don’t have to.

what is this?

Did anything get resolved here? I too had my Home Assistant on my raspberry pi 3 working to tts say to my Google Home, It too stopped working. I did not investigate until much later, however, I did notice at one point my Google Home was assigned a new LAN side IP address. I corrected that in my router to set the fixed IP back to the IP address it had been and is specified in my configuartion.yaml

But it still fails after rebooting pi 3, home assistant, router and Google Home.
Would love to know what has been dione (what failed or what worked) or can be done.

media_player 3:

  • platform: cast
    host: 192.168.1.134
    name: Google Air Freshener

Do you have ufw? It’s a firewall, everytime I disable it then it works. I haven’t figured it out yet, it’s something I to do with ports that I haven’t figured out yet.

I ended up changing the site address in the configuration.yaml and now it works.

This issue has stopped I"m not sure when but I think ever since I updated homeassistant. Not sure from which version; but it’s no longer an issue for me.