core icon indicating copy to clipboard operation
core copied to clipboard

Google Cast devices not detected and show up as unavailable

Open DOSirl opened this issue 1 year ago • 17 comments

The problem

All of my Google Cast devices were coming up as unavailable, so I decided to remove the Integration and add it again. Now it didn't discover any of them and even though I've added them to the list as I configure, none of them are appearing in the list. Apologies, but I don't know how to gather some of the information requested below, I'm a complete newbie to Home Assistant. It's a Raspberry Pi 3: Home Assistant 2022.11.4 Supervisor 2022.11.2 Operating System 9.3 Frontend 20221108.0 - latest

What version of Home Assistant Core has the issue?

Home Assistant 2022.11.4

What was the last working version of Home Assistant Core?

Home Assistant 2022.11.3

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Google Cast

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

DOSirl avatar Nov 24 '22 15:11 DOSirl

Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (cast) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of cast can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign cast Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


cast documentation cast source (message by IssueLinks)

home-assistant[bot] avatar Nov 24 '22 15:11 home-assistant[bot]

This seems to be intermittent. They seem to be back again today.

I'm not sure how to demonstrate.

DOSirl avatar Nov 25 '22 09:11 DOSirl

I realized the very same today. Among my other configuration polishings I realized that all my Cast devices turned unavialable. I deleted the integration, restarted my Docker based HA - Core, tried to reconfigure Cast devices but not found any. For second try I defined the IP address of one of them, and configured the integration with it. Again nothing. After that point I tried to check everything here and there, not found any problems, but when I checked back to the integration it found all my Cast devices, not just the one I configured by discretet IP address.

For first it seems something network related problem, but I had not changed anyting on it nowadays.

Interesting...

Tamas-Toth-ebola avatar Nov 25 '22 11:11 Tamas-Toth-ebola

Yes, it seems quite random, but I think it seems to be after restarting Home Assistant that all Google Cast devices become unavailable for hours. It's quite strange that they come and go. I read something about Plex integration affecting Google Cast. I even tried restoring to 11.2 and now back to 11.4. Doesn't seem to have made much difference. I think I even uninstalled Plex to see if it'll help, but it didn't at the time.

I'm now reluctant to restart HA because everything will become unavailable again for hours.

DOSirl avatar Nov 25 '22 11:11 DOSirl

Yes, it seems quite random, but I think it seems to be after restarting Home Assistant that all Google Cast devices become unavailable for hours. It's quite strange that they come and go. I read something about Plex integration affecting Google Cast. I even tried restoring to 11.2 and now back to 11.4. Doesn't seem to have made much difference. I think I even uninstalled Plex to see if it'll help, but it didn't at the time.

I'm now reluctant to restart HA because everything will become unavailable again for hours.

FYI: I have no Plex...

Tamas-Toth-ebola avatar Nov 25 '22 11:11 Tamas-Toth-ebola

I had to restart HA, but before I did, I added all my Google Cast devices to a dashboard, just to see the availability. I restarted and all were unavailable after restart, so I waited some time, but I decided that 3 of them were important, so I dropped the IP addresses into the configuration, those 3 then became available. I'm now going to give all of them static IP addresses, so this unavailable issue is reduced. I've had to give my Tapo plugs and bulbs static IP addresses, so this is not a big issue, but it's a pity that we have to do this.

They are all now available again instantly, instead of having to wait.

DOSirl avatar Nov 25 '22 15:11 DOSirl

Currently I do not have again my cast devices. Relying to my uptime value, I restarted my HA container 3 hours before, when I made some maintainance about my Zigbee coordinator. Yes, I can confirm, that cast devices could become unavailable after HA restart, and also can confirm that 3 hours is more than 'cumbersome'.

Will check them linked with their discrete IP addresses, as all of them are already on fixed IP, but sadly have no more time now....

Tamas-Toth-ebola avatar Nov 25 '22 15:11 Tamas-Toth-ebola

I also seem to have trouble with the cast devices becoming unresponsive / unavailable. Only partly though. The media player is playing and I can change the volume: image It does not show spotify is running though. I also can't switch tracks obviously. The spotcast integration also has trouble casting to the device. It worked fine about 2 days ago.

spwtit avatar Nov 27 '22 09:11 spwtit

On my system the chromecast integration is using the internal_url when it should be using the external_url

from home

[baggypants@pod-vm _data]$ tail home-assistant.log -n 2
KeyError: 'view_path'
2022-11-30 22:10:33.981 ERROR (Thread-8) [homeassistant.components.cast.media_player] Failed to cast media http://pod-vm.clarkconnect.lan:8123/api/hls/6c37c7dc89be9747a872d20660acb265debc6c640c62335ef32efaee9eae2dbe/master_playlist.m3u8?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMzY2MzYyZTdkZTc0YTc0YjQyNzY2M2E1NGFkMmZhNCIsInBhdGgiOiIvYXBpL2hscy82YzM3YzdkYzg5YmU5NzQ3YTg3MmQyMDY2MGFjYjI2NWRlYmM2YzY0MGM2MjMzNWVmMzJlZmFlZTllYWUyZGJlL21hc3Rlcl9wbGF5bGlzdC5tM3U4IiwicGFyYW1zIjp7fSwiaWF0IjoxNjY5ODQ2MjI5LCJleHAiOjE2Njk5MzI2Mjl9.iEamPcXa7Jgpr93mILBtAehwZTYD0Tcf0zUaqhwLqpo from internal_url (http://pod-vm.clarkconnect.lan:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

from configuration.yaml

homeassistant:
  external_url: "https://homeauto.<redacted>.net"
  internal_url: "http://pod-vm.clarkconnect.lan:8123"

create an automation and alter the above url then I can chromecast the media

service: media_player.play_media
target:
  entity_id: media_player.buck_denver
data:
  media_content_id: https://homeauto.<redacted>.net/api/hls/6c37c7dc89be9747a872d20660acb265debc6c640c62335ef32efaee9eae2dbe/master_playlist.m3u8?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMzY2MzYyZTdkZTc0YTc0YjQyNzY2M2E1NGFkMmZhNCIsInBhdGgiOiIvYXBpL2hscy82YzM3YzdkYzg5YmU5NzQ3YTg3MmQyMDY2MGFjYjI2NWRlYmM2YzY0MGM2MjMzNWVmMzJlZmFlZTllYWUyZGJlL21hc3Rlcl9wbGF5bGlzdC5tM3U4IiwicGFyYW1zIjp7fSwiaWF0IjoxNjY5ODQ2MjI5LCJleHAiOjE2Njk5MzI2Mjl9.iEamPcXa7Jgpr93mILBtAehwZTYD0Tcf0zUaqhwLqpo
  media_content_type: application/vnd.apple.mpegurl
metadata:
  title: Camera Front
  thumbnail: /api/camera_proxy/camera.camera_front
  media_class: video
  children_media_class: null
  navigateIds:
    - {}
    - media_content_type: app
      media_content_id: media-source://camera

Baggypants avatar Nov 30 '22 22:11 Baggypants

@Baggypants the internal_url vs external_url does not influence detection of cast devices which this issue is about 👍

emontnemery avatar Dec 09 '22 09:12 emontnemery

I've done many attempts, deleted and re-added the Cast integration, rebooted the devices, rebooted the HA and the container. The result is always the same, after a few hours, almost all Google devices (Chromecast and Nest Hub/Mini) are disconnected.

The devices work great, I can continue to use them via Google Home on my smartphone or directly from the devices.

All have static IP.

Only 1 device is always connected and functioning via HA, and it is one of the two Google Nest Hubs, precisely the 1st generation one. I have another 2nd generation but it disconnects.

The problem has been happening for about 1 week, but I haven't changed anything.

On Google there are many results relating to this problem, even from years past, but ironically, in the dozens of topics I've read, no one has found or proposed a solution. Google devices seem to reboot once a day to check for updates and have been logged out ever since. This is just one of the hypothetical reasons I found on the net.

This is the current status of my devices which yesterday were all connected and working:

2023-02-01 21:25:43.216 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 403
2023-02-01 21:39:44.699 WARNING (Thread-6) [pychromecast.socket_client] [(192.168.178.26):8009] Heartbeat timeout, resetting connection
2023-02-01 21:40:14.731 ERROR (Thread-6) [pychromecast.socket_client] [(192.168.178.26):8009] Failed to connect to service ServiceInfo(type='host', data=('192.168.178.26', 8009)), retrying in 5.0s
2023-02-02 03:20:55.753 ERROR (Thread-9) [pychromecast.socket_client] [Nest(192.168.178.42):8009] Error reading from socket.
2023-02-02 03:20:55.753 ERROR (Thread-7) [pychromecast.socket_client] [Gruppo(192.168.178.42):32210] Error reading from socket.
2023-02-02 03:20:55.755 WARNING (Thread-9) [pychromecast.socket_client] [Nest(192.168.178.42):8009] Error communicating with socket, resetting connection
2023-02-02 03:20:55.756 WARNING (Thread-7) [pychromecast.socket_client] [Gruppo(192.168.178.42):32210] Error communicating with socket, resetting connection
2023-02-02 03:20:55.760 ERROR (Thread-9) [pychromecast.socket_client] [Nest(192.168.178.42):8009] Failed to connect to service ServiceInfo(type='host', data=('192.168.178.42', 8009)), retrying in 5.0s
2023-02-02 03:20:55.761 ERROR (Thread-7) [pychromecast.socket_client] [Gruppo(192.168.178.42):32210] Failed to connect to service ServiceInfo(type='host', data=('192.168.178.42', 32210)), retrying in 5.0s
2023-02-02 05:10:48.250 WARNING (Thread-6) [pychromecast.socket_client] [(192.168.178.26):8009] Heartbeat timeout, resetting connection
2023-02-02 05:11:18.283 ERROR (Thread-6) [pychromecast.socket_client] [(192.168.178.26):8009] Failed to connect to service ServiceInfo(type='host', data=('192.168.178.26', 8009)), retrying in 5.0s

H4Z4RD-H42 avatar Feb 02 '23 20:02 H4Z4RD-H42

Any progress on the issue? I don't use cast often so I'm not sure when the problem started but the cast integration can no longer find any of my devices. Other than regularly updating HA I don't think there have been any changes with my cast-enabled devices or network settings.

nirnachmani avatar Feb 07 '23 21:02 nirnachmani

Any progress on the issue? I don't use cast often so I'm not sure when the problem started but the cast integration can no longer find any of my devices. Other than regularly updating HA I don't think there have been any changes with my cast-enabled devices or network settings.

Unfortunately no, I did other tests but the result is always the same, I can't find anything else on the net. I give up... For me it's a big mess because many of my automations use the media_player as a voice notification system, for example when the washing machine finishes.. From all the tests I've done, I still can't figure out even if the problem is on the network side, or HA side or Google side.

I forgot to mention that I'm using Home Assistant Core 2023.2.1 installed via docker container on my QNAP NAS.

H4Z4RD-H42 avatar Feb 07 '23 21:02 H4Z4RD-H42

Sorry to hear that. I was actually too quick to point the finger at HA and just discovered that the problem is with my network - I recently installed a managed switch which has been blocking multicast messages, hence HA not picking up the devices. As I said I don't often use casting and didn't connect it not working to the switch I installed a while ago.

nirnachmani avatar Feb 08 '23 06:02 nirnachmani

I experience the same. Speakers become unavailable and they come back randomly, but it's hard to get them back manually. Even if I disable the Google Cast addon in HA, delete all speakers, delete the addon, restart HA and set up Google Cast all over again, after they are automatically discovered and added but they are STILL unavailable. They work fine in Google Home but only 3 speakers work in HA. What sometimes helps is rebooting the speaker.

Personally (and based on the above) I don't really think it's HA's fault. In my experience Google's cast devices and groups are extremely unreliable themselves - for example I have to factory reset my Nest Audio speaker from time to time because it disappears from groups in Google Home. The home app sometimes force closes when I go into the setting of that speaker. And I frequently have issues casting to the groups that speakers have disappeared from. There many confusing scenarios which make working with speaker groups a nightmare.

There are some threads online that suggest mesh wifi networks could be the issue, but I haven't tried changing that in my setup.

marcinwasilewski avatar Mar 20 '23 10:03 marcinwasilewski

I don't know what to think anymore because after dozens of trials and tests months ago, I gave up and had the devices offline for 2 months. In the meantime various HA updates came out, for this reason I tried again about 2 weeks ago and this time everything works. Even after several HA reboots, speaker reboots, and a couple of times even house power failures, they no longer went offline. I check every day and are always online. I'm happy but also confused... I really don't know how to explain all this.

H4Z4RD-H42 avatar Mar 20 '23 15:03 H4Z4RD-H42

Well, I wouldn't think much. Some people here say their speakers/groups work OK inside Google Home but I haven't experienced that to be the case and that's not what I think based on online reports. Even something as simple as casting from spotify is hit or miss (let alone when you involve google assistant). When the dependency itself isn't very reliable - and you can find countless reports of that online - troubleshooting this extension will be hard 😞

marcinwasilewski avatar Mar 20 '23 16:03 marcinwasilewski

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I am still seeing this in 2023.8 docker container.

nabber00 avatar Aug 20 '23 21:08 nabber00

also having this issue, all my cast devices are unavailable

Lite5h4dow avatar Aug 24 '23 22:08 Lite5h4dow

cast does automatically detect the devices, and google home plugin also seems to connect!

Lite5h4dow avatar Aug 24 '23 22:08 Lite5h4dow

In my case, Google Cast only finds a Chrome Cast, but neither my 2 google minis, nor 2 google hubs.

dum-skywalker avatar Oct 14 '23 15:10 dum-skywalker

I think most if not all of my problems went away after I assigned separate SSIDs to both of my wifi routers. I don't have mesh network routers and my google devices were sometimes connecting to the wrong router because they all had the same SSID, and this was causing all sorts of issues. Now it is always connected to the same router (which is the closest).

marcinwasilewski avatar Oct 15 '23 19:10 marcinwasilewski

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.