Call-service API error. Error Message: Chromecast 10.x.x.x:8009 is connecting

I am constantly getting issues with my Chromecast devices in HA… has been happening for a long time and I can’t find a solution. Only thing that works is a restart of HA (which is a huge pain!).

I can use my Chromecast (google Home) device just fine… then I start getting on a random device:

“Call-service API error. Error Message: Chromecast 10.x.x.x:8009 is connecting”

I get the same error if trying from the HA GUI directly as well :frowning:

2019-09-12 07:54:04 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140249954493664] Chromecast 10.x:8009 is connecting...
Traceback (most recent call last):
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1235, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1260, in _execute_service
    await handler.func(service_call)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 210, in handle_service
    self._platforms.values(), func, call, service_name, required_features
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 349, in entity_service_call
    future.result()  # pop exception if have
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 371, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/homeassistant/components/cast/media_player.py", line 1005, in turn_on
    self._chromecast.play_media(CAST_SPLASH, pychromecast.STREAM_TYPE_BUFFERED)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/pychromecast/controllers/media.py", line 523, in play_media
    callback_function=app_launched_callback)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/pychromecast/socket_client.py", line 935, in launch_app
    self.update_status(lambda response:
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/pychromecast/socket_client.py", line 926, in update_status
    callback_function=callback_function_param)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/pychromecast/controllers/__init__.py", line 84, in send_message
    self.namespace, data, inc_session_id, callback_function)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/pychromecast/socket_client.py", line 725, in send_platform_message
    inc_session_id, callback_function_param)
  File "/home/vmware/homeassistant/lib/python3.6/site-packages/pychromecast/socket_client.py", line 719, in send_message
    str(self.port) + " is connecting...")
pychromecast.error.NotConnected: Chromecast 10.x:8009 is connecting...

There must be a “clean” way to reset a single Chrome device rather than reboot HA?

Maybe they access another access point in your house? Maybe that small interruption could make ha connection issues?

I also had issues with my cast devices, untill I locked them to a fixed access point with a static IP address

They have static IPs… i’ll look into AP (but doubt they move around, as signals are super good).
Either way, HA should not through an exception that it can’t catch and handle. There needs to be an easy way (or ideally automatic way) that it catches this error and resets the connection.

Static IP by Mac reservation?
In past, when they dropped, they never came back online in HA , dont know error anymore…
Maybe your issue is indeed different…

Do a constant ping command ,when you have an error, have a look at your ping if you see some drop-off

tried something similar… the GoogleHome works fine from NodeRed, Google App, Spotify, etc… but HA will throw that error until I restart HA :frowning:

Yes, but maybe HA cant handle the dropoff, while nodered maybe can … You need to know the root cause…
Start by testing wifi issues… just an idea :wink:

thanks for the idea’s; however, the root cause is HA… all other methods/programs handle whatever alleged “drop off” maybe happening; only HA gets stuck in some kind of infinite loop.
I guess I should go file a bug report and hope that whoever maintains that code can create some recovery or gracefully shutdown and restart code for the module.

Checking my Unifi logs for past 14 days; none of the google home devices I have show drops (disconnects and reconnects, nor show any roaming (moving from one AP to another)).

ok, then i dont know, i had probably another error log, this was more then a year ago, issue was indeed dropoffs, and didnt come back online in HA

Did you ever solve the problem? I have a similar problem

no :frowning: not sure they are working on this issue. Seems a bit more stable with latest release, but that could just be coincidence.

I have exactly the same issue. After my Nest Hub has been switched off for whatever reason. I get:

Call-service API error. Error Message: Chromecast 192.168.xxx.yyy:8009 is connecting...

IP address of Nest is static and correct. After a HA reboot, everything works fine again.

1 Like

I’m affected to, a Chromecast gen1, wired to ethernet via ugreen adapter, unify switch, hassio on top of ubuntu 18.04.4

Restarting homeassistant via options-> server-> restart home assistant didn’t work.
Restarting all HA related docker containers did fix it… (overkill, I know…)

But other than that, my symptoms are identical.

Anyhoo, thanks for the advice for (brute) mending!

I’m having this issue pretty often now. Did anyone ever figure out how to fix it?