-
-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HA loses connection to chrome cast and does not reconnect #19890
Comments
I also have the same problem, since a looong time ago, thats my only errors in the log. I have tried both with the integration and the media_player: in configuration.yaml.
|
Rich... Did you manually upgrade python at any point? |
I can't really remember. Maybe I have, but I can't remember upgrade it. Ignoring CEC Data cast.status.is_active_input This active input value is typically used to determine if the Chromecast is idle. PyChromecast is capable of ignoring the active input value when determining if the Chromecast is idle in the instance that the Chromecast is returning erroneous values. To ignore this CEC detection data in PyChromecast, append a Linux style wildcard formatted string to the IGNORE_CEC list in PyChromecast like in the example below. pychromecast.IGNORE_CEC.append('*') # Ignore CEC on all devices |
Those are the prints when HA can't reach the casts and is trying to reconnect, I don't think it looks too bad or strange. Are your casts not showing up in HA UI when they are turned on and visible in the Google Home app? |
All my casts are available and in the UI when these errors occur. They're just never ending. The only odd thing is they're not there on initial reboot. Can this be related to Issue#19890? |
@ttaidapos Can you give HA beta 0.88.0b2 a try? |
Much better with 0.88 without losing the chromecast group. I do have the log entries below still though.
|
Here are updated logs... Seems to be running smoother over a few days.
|
Still have the same issues with 91.1 below are updated logs:
|
@ttaidapos The errors and warnings mean home assistant lost connection to the Chromecast. |
When I see these after a reboot, hass does recover and can cast and see all devices and groups. After a few days (no more than 5 or so), casting doesn't always work for all devices/groups. A reboot fixes the problem. I've tried to align time stamps with internet and router connections to no avail. |
Small update, after about 6 running days without restarting hass, majority of the devices are showing off. :( |
What does "showing off" mean, does it mean you can no longer control the casts? When you say you reboot, do you mean you reboot home assistant or you reboot the device? |
Correct. The Google Displays and TV casts are working but not the speakers or speaker group. |
Ok, and when you say that a "A reboot fixes the problem", what is it that your reboot? |
I restart hass |
OK. I can't reproduce this issue. A complete HA log - from starting HA until connection is lost and you restart HA to restore functionality - is needed for debugging. Logger options in logger:
default: info
logs:
homeassistant.components.cast: debug
homeassistant.components.cast.media_player: debug
pychromecast: debug
pychromecast.discovery: debug
pychromecast.socket_client: debug
zeroconf: debug |
Got it, logging now. I presume it's the home-assistant.log it's writing to? Should I pastebin it? |
Yeah, but maybe double check the logging is working since I guess reproduction time is quite long also for you? Sure, pastebin or similar service. |
looks like it's working, file size doubled original after 20min. Original was running for more than a week. Hopefully it doesn't take long so it will be less garbage for you to sort through. Appreciate the help here! |
Exceeded pastebin max size. Here you go: https://drive.google.com/file/d/15PHLauY1IBqb_WnXKjNklFVdoJaIIDdb/view?usp=sharing |
Your log does not seem to match your description:
It seems everything is working fine throughout the log, although there are a couple of disconnects (see below). There is also no restart of Hass in the log, which I understood was needed to make the casts work again. For me to be able to do anything useful with the log, please help to clearly explain what issues you saw, at approximately which times, and what steps you took to recover to normal operation (if possible). About the disconnect:I can see in the log there is a global disconnect of all chromecasts around 11:33:
However, you also lose connection to the Hue bridge at the same time, so it's highly likely to be caused by network instability:
Afterwards, connection is successfully restored to all the casts:
|
I agree, looks like a network issue or hass/pi is resetting connections perhaps? I'm looking at the router and timestamps don't correlate? |
OK. |
Will do, really appreciate your help! |
@ttaidapos |
They devices disconnecting didn't always align. My Hue is hardwired into the router but the pi is on wifi. I will try to switch to hardwire to see if there's any difference. |
k upgraded to 92.2 and I don't lose connectivity to the speakers/hubs. Still see disconnects in the logs though. 2019-05-10 11:39:09 ERROR (Thread-15) [pychromecast.socket_client] [Soundbar Speaker:8009] Failed to connect to service Chromecast-Audio-d79e7a5247f2c03411d4945d28aaedbc._googlecast._tcp.local., retrying in 5.0s |
Can you provide example of your configuration yaml snippet. |
So, the reason for these prints is that pychromecast is trying to reconnect to a device or group which is offline. This is not a bug as such, the prints are intentional. I think it's reasonable to print a warning or error when the device goes offline, but the repeated heartbeat warnings are obnoxious. What do you think about decreasing the severity of the heartbeat warnings? |
I'm seeing them for devices as well, not only groups. |
Please read more above... this happens for ONLINE device as well. HA loses connection for some reason, and never bothers to reset the connection. HA needs to gracefully shutdown the connection and try again; rather than getting stuck in this loop we are seeing. |
I take back what I said. If I have the hosts manually set the group does NOT show up. If I then remove the hosts and restart, the group stays with no errors (that I saw...more below). If I re-add the hosts then the cast group sometimes stays sometimes does not. The "more below" is that I had to rebuild my entire network this afternoon because something caused my DHCP server to stop functioning. So I can't guarantee that all my results are accurate. |
@marc-gist, @FuzzyMistborn, @ttaidapos: Edit: Never mind this suggestion, then. |
Apologize if the title doesn't match the error from the OP, not sure I can understand the logs to be honest. If you have a suggestion to update the title I will be more than happy to do so. We can keep this issue open with the focus on the OP as many of us still have these issue. |
Ok, I renamed and I'm repeating my comment from April 23rd last year. A complete HA log - from starting HA until connection is lost and you restart HA to restore functionality - is needed for debugging. Logger options in logger:
default: info
logs:
homeassistant.components.cast: debug
homeassistant.components.cast.media_player: debug
pychromecast: debug
pychromecast.discovery: debug
pychromecast.socket_client: debug
zeroconf: debug |
Will give this another shot, thanks! To all others having the same problem, there's a few of you that have added to this thread, please do the same. The more information we can provide, the quicker/better the investigation. Thank you @emontnemery ! |
Ok hopefully we captured it. Noticed 3 different patterns, also including the reboot. There are definite "error connecting" for MIBOX4 Bedroom TV, these can be ignored.
|
@ttaidapos Let's keep this issue about "HA loses connection to chrome cast and does not reconnect". In patterns 1, 2 and 3 this doesn't seem to be the case. I really appreciate that you're collecting and sharing logs, please continue with that.
Note: At around time 4:28:45 AM, connection to all casts was lost, but in "Pattern 2" you only included the disconnect from and successful reconnect to "Living Room Speaker". Was connection permanently lost from one of the other casts? If so, please upload a complete log as a file attachment, instead of an incomplete snippet. |
I'm not sure which issue number it is, but HA fails to restart successfully about 75% of the time for me, failing with:
HA service startup gets stuck permanently on this error. It takes about 2 minutes to manually stop the HA service from the command line, then it can be restarted successfully on 2nd or subsequent attempts. I say subsequent attempts, because often some other random integration fails on startup, requiring multiple restarts, making this a very annoying 10 minute process (I just did this, and the Nest integration failed randomly on the 2nd restart, and the Sonoff integration failed randomly on the 3rd restart, requiring a 4th restart to have everything working). And of course it prevents remote restart if an issue occurs while away from home, so this issue has fairly serious implications. |
@DPAmes OK, please open a new issue for HA failing to restart due to chrome cast, let's keep this issue about HA failing to reconnect to chrome casts. |
Same here. I can add but when restart HA it's offline |
@ttaidapos have you been able to reproduce the problem again? |
Yes. Several times. When I updated to 0.110 Cast went down. I deletedthe integration and re-added and all back again. So something is wrong or is it only me??? |
@jazbraz Your problem is not related to this issue. Please open a new issue, and attach a log showing:
|
Has there been a fix for this issue yet? I am having the "Call-service API error. Error Message: Chromecast xxx.xxx.xx.xx:8009 is connecting..." issue quite often. The only way to fix it is to reboot. |
@rjmcfadd Do you still get this error? |
I'm closing this issue since there have been improvements in pychromecast to improve the stability and no one has been able to provide a log where the problem happens. |
I'm getting this constantly since last night now. Stuck now |
This issue was closed 9 months ago. Please open a new issue. |
Description of problem:
Several users report that HA loses connection to chrome cast and does not manage to reconnect until HA is restarted.
Unfortunately, this is not possible to debug without logs.
If you have this problem, please help by
Logger options in
configuration.yaml
a. Use the Google home app to verify that the Google home app can reach each cast to which the connection is lost, and also confirm the IP address of each disconnected cast (found at the end of the device settings menu in the Google Home App). Note the time and confirmed IP address. Please note that sharing of private IP addresses such as 192.168.x.x or 10.x.x.x is not an issues as those IPs are only accessible within your own network.
b. Restart HA to recover connection to the cast
c. Add a comment to this issue including:
configuration.yaml
or if the casts have been discovered.The text was updated successfully, but these errors were encountered: