home-assistant/core

Google Cast stopped working within the last couple of weeks

Closed this issue · 121 comments

The problem

I am no longer able to cast to my Google Hub. The following Blueprint worked for months, but no longer does.

https://community.home-assistant.io/t/cast-and-re-cast-a-lovelace-view-to-a-google-hub/259631/50

I'm also unable to cast from https://cast.home-assistant.io/

What is version of Home Assistant Core has the issue?

core-2021.7.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

cast

Link to integration documentation on our website

https://www.home-assistant.io/integrations/cast/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Nothing obvious

Additional information

No response

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!
(message by CodeOwnersMention)

I am having a similar (related?) issue. If I cast youtube, it just opens the app on the media_player i selected, but doesn't play the specified video. Furthermore, this seems to crash the Cast integration itself, because from that point on I am unable to use HA to cast local media to, or even just changing the volume of sometimes that specific media_player or sometimes even all my media_players
I have reverted back to core 7.3 but that did not change anything.

Someone mentioned that it might be some update by Google, but I've no idea how to test that. Cast works elsewhere for me...

Just tested https://cast.home-assistant.io/ using 2021.8.0 and casting still appears broken.

Oh, but it does look like I got an error this time!

Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py:652
First occurred: 1:27:02 PM (1 occurrences)
Last logged: 1:27:02 PM

[Kitchen Hub(192.168.1.105):8009] Error communicating with socket, resetting connection

Same problem here .. it's due to the fuchsia upgrade..

I guess that makes sense. But why would they break functionality?

Is this the same issue #53215 if so this seems to be update to the Cast integration that has this bug

Hi had the same google cast problem particualy when casting YouTube videos using the media player to the chromecast. I solved it by rolling back the HA core to a more stable version.

typed this in the terminal

ha core update --version 2021.6.1

Hope it helps

Don't think it's the same as the YouTube bug. Seems more like the chome browser crashes after a few seconds when casting a webpage.

The 'crash' only seems to happen from HA though. I can cast a normal tab to my hub without issue.

same problem

Same here, I have two Nests. One with Cast firmware version 1.52.260996 which is failing, the other Nest seems to be in some kind of stuck state from the app, but it is still functional. Edit: I checked the version, and is not Fuchsia yet, so I don't want to reboot it. This explains that Fuchsia is the issue.

Knowing Google, this will not revert back to the previous 10 minute 'freedom' we had. My hub is useless to me.

Hey @emontnemery ! Have you had any time yet to look at this?

Do all of you who see this issue see it on devices which have been updated to Fuchsia?

Yes, is there a way to downgrade ?
What I noticed is that casting a tab from chrome or using camera.play_stream work. After using cast.show_lovelace_view tho, casting does not work anymore on the hub and needs to be restarted.

cast.show_lovelace_view is using Home Assistant's own app, maybe that needs to be mended to play nice with Fuchsia

Except for cast.show_lovelace_view not working, what else is broken?
@IsaacSante you mention casting of youtube is not working, can you explain how you do that?

Do all of you who see this issue see it on devices which have been updated to Fuchsia?

How do I even check?

How do I even check?

Google Home app - your hub - gear icon - device info - Cast firmware version
If it is 1.52.xxxxx or higher, its f**kedsia

From the gear icon, I just get a blank screen. Even tried to reboot. Thanks Google.

Same issue here since update to Fuchsia, only on Fuchsia updated devices. One of my devices hasn't updated yet and it still works as intended there.

Apparently 1.52.x may be on both Fuchsia and non-Fuchsia devices, to check if it's really fuchsia you could perhaps follow this guide: https://9to5google.com/2021/06/11/how-to-know-fuchsia-os-nest-hub-update/

To get some insight here, it would be helpful with logs showing when doing cast.show_lovelace_view, both on a working and non-working device.

Logs:

logger:
  default: info
  logs:
    homeassistant.core: debug
    homeassistant.components.cast: debug
    homeassistant.components.cast.media_player: debug
    pychromecast: debug
    pychromecast.discovery: debug
    pychromecast.socket_client: debug

It doesn't seem like all Fuchsia devices fail, as tested by @frenck:

It doesn't seem like all Fuchsia devices fail, as tested by @frenck:

Mine has the same versions but does not work. I'll try a reset to defaults, maybe it will help.

Nope, did not help. The dashboad shows up for a few seconds (when it does not throw the 'path not found' thingie) then it reverts to ambient, altho all other devices on the network report that it's still casting something.

Nope, did not help. The dashboad shows up for a few seconds (when it does not throw the 'path not found' thingie) then it reverts to ambient, altho all other devices on the network report that it's still casting something.

Same thing here with the same version

Google Nest HUB First Generation

Same problem here. I have a Ver1 and also a Ver2 hub. After the update on Ver1 hub I could no longer use CATT as it would display about 30 seconds or less then jump back to the picture frame.
Let me know if I can help.

Apparently 1.52.x may be on both Fuchsia and non-Fuchsia devices, to check if it's really fuchsia you could perhaps follow this guide: https://9to5google.com/2021/06/11/how-to-know-fuchsia-os-nest-hub-update/

To get some insight here, it would be helpful with logs showing when doing cast.show_lovelace_view, both on a working and non-working device.

Logs:

logger:
  default: info
  logs:
    homeassistant.core: debug
    homeassistant.components.cast: debug
    homeassistant.components.cast.media_player: debug
    pychromecast: debug
    pychromecast.discovery: debug
    pychromecast.socket_client: debug

Excuse my ignorance, but is it safe to post debug logs publicly? Also, I only have one hub (that doesn't work), so I can only post logs from a broken one - which is probably the most helpful anyway...

i had the same issue google nest hub ver1 (Fuchsia installed) but since today its working again. I am curious what cause this and if works for others also

I'll be damned, it is!

edit: Well, it was. Seemed it worked once, but now it isn't. Will troubleshoot further.

Here is still not working. Can you please check if you received a Google nest update? Thanks

No idea. My cast firmware ends in 0996.

The problem with Google Cast devices started from the July version, since then the problem continues, what worked for me to be able to use my Google devices is to download HA version 6.6 and put the integration "cast" of said version in "custom_components", and problem solved, I have been like this for 2 months, and I have not had a problem, until they fix this problem in a next version this is a good temporary solution.

@gajosu cheers for that! It works now, damn it! I had problems casting videos on my Chromecast Ultra (think YouTube etc). I thought I'll be stuck on 6.6 for a long time because of the problem but the temporary solution worked 👌

I'm running home assistant core so all I had to do is copy the "cast" component folder from the virtual environment into custom_components and modify the manifest.json to add "version".

The problem with Google Cast devices started from the July version, since then the problem continues, what worked for me to be able to use my Google devices is to download HA version 6.6 and put the integration "cast" of said version in "custom_components", and problem solved, I have been like this for 2 months, and I have not had a problem, until they fix this problem in a next version this is a good temporary solution.

So these files must exist in Github somehow. Anyone know how to download them, so I can stuff them into custom_components?

edit: I'm dumb. Found the link.
https://github.com/home-assistant/core/archive/refs/tags/2021.6.6.zip

update: Adding /cast to /custom_components did not seem to work for me.

The problem with Google Cast devices started from the July version, since then the problem continues, what worked for me to be able to use my Google devices is to download HA version 6.6 and put the integration "cast" of said version in "custom_components", and problem solved, I have been like this for 2 months, and I have not had a problem, until they fix this problem in a next version this is a good temporary solution.

So these files must exist in Github somehow. Anyone know how to download them, so I can stuff them into custom_components?

edit: I'm dumb. Found the link.
https://github.com/home-assistant/core/archive/refs/tags/2021.6.6.zip

update: Adding /cast to /custom_components did not seem to work for me.
you have to edit the manifest.json file and add "version": "1.0.0"
{ "domain": "cast", "name": "Google Cast", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/cast", "requirements": ["pychromecast==9.1.2"], "after_dependencies": [ "cloud", "http", "media_source", "plex", "tts", "zeroconf" ], "zeroconf": ["_googlecast._tcp.local."], "codeowners": ["@emontnemery"], "iot_class": "local_polling", "version" : "1.0.0" }

Thanks for the tip, but even with editing the manifest, it did not work for me. Just to be sure, I rebooted both HA and the hub after making the change.

Same for me. Updated and rebooted. First try I got a "connected" followed by "view could not be found" (view path is correct, works on Chromecast). When I went with view path "0", it connected but before showing a screen the hub went back to the slideshow and would not accept other cast attempts until restarted

On Mon, Sep 13, 2021, 20:21 flyize @.***> wrote: Thanks for the tip, but even with editing the manifest, it did not work for me. Just to be sure, I rebooted both HA and the hub after making the change. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#53882 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJJCNGR3DKXJ2H5ZHE6ERE3UBY6KZANCNFSM5BNLMD7Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Try to remove the devices before putting the cast integration in custom_components, reboot and after that add the devices back to HA

I removed cast from HA Integrations, rebooted, it found the devices again - but still can't cast. :(

@gajosu Is it a Fuchsia device that starts working when you downgrade the cast integration to 2021.6.6?

There are no intentional functional changes in the cast integration between 2021.6.6 and 2021.6.6, the changes are only some minor code cleanup.
There are however changes in pychromecast (the supporting library).

Could you try with the version from 2021.9.x as a custom component, only downgrading the library:

diff --git a/homeassistant/components/cast/manifest.json b/homeassistant/components/cast/manifest.json
index c104ff7a12..78f7bcf485 100644
--- a/homeassistant/components/cast/manifest.json
+++ b/homeassistant/components/cast/manifest.json
@@ -3,7 +3,7 @@
   "name": "Google Cast",
   "config_flow": true,
   "documentation": "https://www.home-assistant.io/integrations/cast",
-  "requirements": ["pychromecast==9.2.0"],
+  "requirements": ["pychromecast==9.1.2"],
   "after_dependencies": [
     "cloud",
     "http",

Edit: There are also no intentional functional changes in pychromecast in features used by Home Assistant.
Edit2: The problem is due to this change: home-assistant-libs/pychromecast@3a05645#diff-89055e63f0849c40b8395ee401d0a94bc38bbb0bab291c94b7997a0bdf5ff881L67-R78

Thanks a lot @gajosu for helping to pinpoint the issue.

This is the root cause for casting of youtube not working as expected, but it will not fix the problems with displaying a Home Assistant Lovelace view on Fuchsia devices.

For those of you who have downgraded the cast integration to the 2021.6.6. version, can you confirm if there are any differences except that casting of youtube videos now work?

I was trying to cast a Lovelace view after downgrading on 6.6 and that did not work. Since @gajosu said it worked, I can assume he was using it to cast YouTube videos.

Yeah, reverting to 2021.6.6 fixes a deadlock when playing youtube videos, it's properly fixed here: #56296
The problem when casting Lovelace views is not related.

hello all,
since a few days i have the same problem. my google cast from ha is no longer displayed on my hub 1.gen.
I have already downgraded to 6.6.
is there already a solution for the problem or an alternative in ha that you can use instead of google cast to get my Lovelance on the hub.
Thank you for your help and best regards from the allgäu region.

Diver

Youtube on chromecast is working again in release 2021.9.7

@diver77 I expect reverting the cast integration to 2121.6.6 only fixes a problem with casting Youtube videos.
Problems with casting of lovelace to a gen 1 hub is related to the Fuchsia upgrade.

Another phenomenon i have to notice is that my hub constantly loses the wifi connection since the new software update. It also doesn't help to restart the hub, i have to restart my router, then with luck my hub connects to the wifi again. But after a few hours, it again gives the message that it can't connect to the wifi. Have you noticed this too?
every few minutes the hub also makes a ping, where it usually starts the cast again. earlier there was not the ping. the totally annoying. does anyone know what to do about it?
Thank you for your help and best regards from the allgäu region.

Diver

does the gen. 2 have the same problem with the new firmware and cast or does the cast working without problems with the hub 2.0????

The problem with the hub 1.0 started with it being upgraded to Fuchsia (Google's new OS), I've not seen any reports that the hub 2.0 is receiving such upgrades.

hello emontnemery,
thanks for your anwere. means that, if i buy a hub 2.0 i can cast my ha without problems or does cast not work on the hub 2.0 anyway?

As far as I know, the hub 2.0 currently works.
However, no one knows what Google's plans are, maybe they decide to also migrate that device to Fuchsia.

We've reached out to Google who confirm they can reproduce the problem we see with Home Assistant's app.
The reason for the Home Assistant cast app being suspended after 10s is that it's not playing any media, which is of course intentional from our side when we use it to show a Lovelace view.
It's not clear if this is considered a bug in Fuchsia, or if there's something that needs to be adjusted in the Home Assistant cast app.

It's not clear if this is considered a bug in Fuchsia, or if there's something that needs to be adjusted in the Home Assistant cast app.

As you mentioned the Fuchsia OS seems to be disregarding the disableIdleTimeout flag, what as the name suggest should disable the function to be flagged as idle casted "media".

As you reached out to Google and they managed to reproduce the issue, maybe they should dig into their implementation and make the flags working. The whole cast/pychromecast code is full of comments since the beginning, that what flags are NOT working.

https://github.com/home-assistant/frontend/blob/49494c572b1f235070cf43a0243ba50cdd810c28/cast/src/receiver/entrypoint.ts#L66-L78

The reason for the Home Assistant cast app being suspended after 10s is that it's not playing any media, which is of course intentional from our side when we use it to show a Lovelace view.

It's odd that if I ask google to open a specific webpage "Hey google, open wikipedia.org" which has no 'media', it opens the page and does not timeout. I assume that is something in the inbuilt browser to always stay up in case it's playing media?

I have been unable to get it to open a local HA page or even duckdns HA page with voice command or routine.

FYI. There are reports that casting other webpages (not the home assistant app), also timeout when using CATT.

@emontnemery I understand you confirmed it not to be an issue with CATT or pychromecast, but does this narrow it down to Google rather than Home Assistant?

Why does the home assistant not develop such a virtual camera in which you can switch sources, either it is a screen broadcast, or a stream from another camera, or an .Avi file or something else. Until the stream is selected - let it be a screensaver, as on old TVs setup screensaver.

Would adding silent looping audio avoid the timeout? For example, the audio from here https://github.com/anars/blank-audio

that sounds logical, but my solution for the moment. i bought a nest Hub Gen.2 and it works as before. The old one goes to the greandparents :-)

@Kore-Development I looped a random audio file and it did not prevent the time out. Even more odd it continued to play the audio in the background during picture frame mode so the connection to the cast never stops it just gets moved to the background.

I also tried casting a youtube page, once you're playing the video the page won't timeout. You can watch the whole video without going back to picture frame mode.

I tried to replicate that by embedding a youtube video as an iframe card but that did not work.

I tried use javascript to create a fake video tag and loop that indefinitely and that did not work either. It definitely prevented a screen sleep/timeout on my cellphone but no luck on a google hub.

Has anyone tried this on a Lenovo smart display or a Nests and Lenovos one and the same in the OS????

Lenovo smart display

Those are running Android Things, an OS what Google axed about a year ago.

Can anyone confirm that the Nest Hub (Gen 2) works? They are on sale (about everywhere currently) for $49 bucks. For that price I might bite the bullet.

Hello Jetenginesupreme,
I switched from Gen1 to Gen2 and it works perfekt since I use the Gen2 Hub.

@diver77 Thank you for the information. I wonder if the Gen 2 devices are running Fuchsia out of the box. Hopefully it won't be updated later and break it. Would it be possible for you to post your firmware version?

@bramkragten has made some progress on the issue: home-assistant/frontend#10531

Awesome work @bramkragten! When might we see this fix in an update?

@ jetenginesupreme
Sorry for answering so late.
that’s what my hub running
IMG_2067
Sorry now you can see the foto.
But since yesterday i have a problem with the Gen2 Hub.
After 15sec of cast i see the clock vor 5 sec.

The new version of the Lovelace app is now live, the 10s timeout should now be fixed.
You may need to reboot your Google Nest hub to make it refresh the app.

I just restarted my hub and had a go using CATT. It still timed out after 10s.
Tried with Home Assistant Cast and it seemed to work fine, but it's full of "custom element doesn’t exist" errors, so can't really test usability.

How do I find out what version of lovelace is being used?

System firmware is 1.20210119.2.1390079
Cast firmware 1.52.272481

I just restarted my hub and had a go using CATT. It still timed out after 10s.

CATT will not be fixed by this change, but the same workaround can probably be implemented in CATT if they have a custom app for displaying web pages.

Tried with Home Assistant Cast and it seemed to work fine

That means the 10s timeout seems to be solved?

it's full of "custom element doesn’t exist"

Do you mean the lovelace view is not rendered correctly?

This #59360 should fix the custom card errors (and a few others)

That means the 10s timeout seems to be solved?

Yes, appears to be through Home Assistant Cast. It stayed up for 10mins before timing out.

Do you mean the lovelace view is not rendered correctly?

Yes, seems to be related to this issue. Any custom cards I have (installed through HACS) don't work. They work fine in standard browsers though.

CATT will not be fixed by this change, but the same workaround can probably be implemented in CATT if they have a custom app for displaying web pages.

Great! @GSzabados might know how this might be done.

It stayed up for 10mins before timing out.

Is it now also possible to restart the casting after the 10 minute timeout?

Is it now also possible to restart the casting after the 10 minute timeout?

Just tried again. And it seems to go off the main hub screen, but it's still there in the background. If you swipe over to the media screen you can press to open it up again.
Otherwise, you need to stop the cast and restart to get it to appear again.

Great! @GSzabados might know how this might be done.

@jonaseymour, unfortunately I am not an expert in the subject, but as catt uses cast_site, what is calling dashcast, and that is part of pychromecast, then the issue in catt is not resolved.

But looking at the code they should roll their own controller and presumably implement there the dummy media as @bramkragten did for the Lovelace.

Unfortunately it is a dirty solution from that perspective that Google broke the Hubs and a workaround had to be provided by inserting the dummy media to keep the Hub awake.
In a real world Google should fix the issue in the firmware, but obviously they haven't and there are no signs that they intend to.

Safe to assume this only works for https://cast.home-assistant.io/ right now? I had an HA automation that cast and then recast every 10 minutes. It doesn't seem to work, but the cast site does.

The 10 minute timeout should be fixed now too on Nest hub.

The 10 minute timeout should be fixed now too on Nest hub.

Do you have any reference or firmware number where it is fixed?

The 10 minute timeout should be fixed now too on Nest hub.

Do you have any reference or firmware number where it is fixed?

home-assistant/frontend#10586

The 10 minute timeout should be fixed now too on Nest hub.

Do you have any reference or firmware number where it is fixed?

home-assistant/frontend#10586

Thanks! Nice work!

Actually I misunderstood your sentence originally. I thought Google has fixed something. ;)

Not only it works, but also the 10 min re-cast automation workaround is not needed anymore.

Thanks !

hello,
can anybody tell me what can I do against this problem in the foto? Cast worked until 2 days wothout a problem
2021-11-10 07_41_10-Window

a second stupid question, how can i update my lovelace app????

Thanks for your help and sunny greatings

Diver

@diver77 the lovelace app is automatically updated.
Is the problem in your screenshot a new problem, and if so, when did it start?

hello, can anybody tell me what can I do against this problem in the foto? Cast worked until 2 days wothout a problem !

a second stupid question, how can i update my lovelace app????

Thanks for your help and sunny greatings

Diver

You mean that the state is now paused? Or what do you mean? You should probably update your automation?

I have this problem roundabout 2 or 3 days.
I mean, I see my lovelace view for about 20sec than the screen switch to the Clock from the Google Assistant for about 10 sec. After that i see this
2021-11-10 10_30_41-Window
Than it change to the lovelace view again.
This goes on in a continuous loop like this

You probably have to update your automation, what does it look like now?

It probably restarts the casting when the state of the cast devices is paused for 20 seconds, but the state of the cast device is paused now when active to prevent it from being shutdown by the Nest hub.

the automation look like this

trigger:

  • platform: state
    entity_id: media_player.nesthubaf70
    to: 'off'
    for: '00:00:20'
  • platform: state
    entity_id: media_player.nesthubaf70
    to: paused
    for: '00:00:20'
  • platform: time_pattern
    minutes: /9
  • platform: time_pattern
    minutes: '0'
    action:
  • choose:
    • conditions:
      • condition: or
        conditions:
        • condition: state
          entity_id: media_player.nesthubaf70
          state: 'off'
        • condition: state
          entity_id: media_player.nesthubaf70
          state: paused
          for: '00:00:20'
          sequence:
      • service: media_player.volume_mute
        data:
        is_volume_muted: true
        entity_id: media_player.nesthubaf70
      • service: media_player.turn_off
        data:
        entity_id: media_player.nesthubaf70
      • delay:
        seconds: 2
      • service: media_player.turn_on
        data:
        entity_id: media_player.nesthubaf70
      • service: cast.show_lovelace_view
        data:
        view_path: test-nest
        dashboard_path: lovelace
        entity_id: media_player.nesthubaf70
      • service: cast.show_lovelace_view
        data:
        view_path: test-nest
        dashboard_path: lovelace
        entity_id: media_player.nesthubaf70
      • delay:
        seconds: 10
      • service: media_player.volume_mute
        data:
        is_volume_muted: false
        entity_id: media_player.nesthubaf70
        id: 'xxxx'
        alias: Cast to Google Hub
        description: ''

Remove the trigger on paused:

platform: state
entity_id: media_player.nesthubaf70
to: paused
for: '00:00:20'

ok i will try this today after work.

thanks for your quick help.

sunny greatings from bavaria

diver

On a freshly booted hub, I ran this from HA

service: cast.show_lovelace_view data: dashboard_path: lovelace-room view_path: cast entity_id: media_player.kitchen_hub

It made a noise, then I got the 'HA <3 Nabu - Connected' message. Then it went back to the screensaver. What am I doing wrong? I'm running HA 2021.11.2, if that matters.

On a freshly booted hub, I ran this from HA

service: cast.show_lovelace_view data: dashboard_path: lovelace-room view_path: cast entity_id: media_player.kitchen_hub

It made a noise, then I got the 'HA <3 Nabu - Connected' message. Then it went back to the screensaver. What am I doing wrong? I'm running HA 2021.11.2, if that matters.

Same here… it is showing the Lovelace dashboard correctly for a short period of time and goes back into the chrome picture frame mode. It continues to try to cast, but only a black screen with volume controls showing up every minute or so.

Have you disabled automations that trigger on paused state of the device? As the Lovelace cast app will have a paused state now instead of idle.

FTR: The useless paused state updates will be removed by #59481, which will land in HA Core 2021.12

Have you disabled automations that trigger on paused state of the device? As the Lovelace cast app will have a paused state now instead of idle.

I stopped the automation and was simply trying from Dev Tools.

I stopped the automation and was simply trying from Dev Tools.

Does this work:

service: cast.show_lovelace_view     
data:
  dashboard_path: lovelace
  view_path: "0"
  entity_id: media_player.kitchen_hub

Indeed it does! But how do I make it work for the view I want?

edit: So everything works after your cast YAML. However, if I don't start with that, none of it works.

@flyize

So everything works after your cast YAML. However, if I don't start with that, none of it works.

Can you elaborate a bit on what you mean by "If I don't start with that, none of it works", maybe explain with a step-by-step description?