Error every night: pychromecast: Failed to connect to service ServiceInfo

I get these two errors every night more or less at the same moment. The two devices which cause the problem are a Google Nest Hub and a Google Home speaker.

I’ve read in the past that this is due to the devices becoming unavailable once every night. Perhaps doing a restart or something. But having these errors in the logs for something which is expected to happen seems wrong to me.

Is there a way to avoid having these errors?

Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py:396
First occurred: April 22, 2022, 4:32:20 AM (15 occurrences)
Last logged: 4:48:09 AM

[Bedroom Speaker(192.168.188.104):8009] Failed to connect to service ServiceInfo(type='host', data=('192.168.188.104', 8009)), retrying in 5.0s
[Living Room display(192.168.188.43):8009] Failed to connect to service ServiceInfo(type='host', data=('192.168.188.43', 8009)), retrying in 5.0s

I think they have been programmed to reboot at night. My Chromecast audio does exactly the same thing.

I just ignore the errors. You can can turn off all error reporting for an integration, but it’s probably not wise.

That’s what I do too, but I was hoping that the integration itself could ignore these errors without reporting them. Ignoring the errors myself means actually reading them to ignore them. Or completely ignore them which means… I might be ignoring other errors which make more sense.

Yeah it’s all or nothing. If you set the log level for the integration to critical it won’t report any errors. That’s all that is available.

That’s better than turning it off. I will do that. Thx.

I wonder how this problem exists for so long though. Doesn’t it happen to everybody?

There’s nothing Home Assistant can do about it as there is no way to tell if the device is doing it’s nightly reboot or has actually fallen off the network for some other reason. They both generate the same error. So it is better to report it than suppress it.

Sure, but it could report the error only if the device is lost for more than X seconds, else report just a warning, if not just an info message. Anyway, it seems that this is the expected behaviour of these devices. They reboot once per day.

1 Like

That’s the best solution I have found so far… using logging filtering to ignore the specific messages:

logger:
  filters:
    pychromecast.socket_client:
      - ".*Failed to connect to service ServiceInfo.*"

7 Likes