Can't add Cast integration via front-end, enabling via Yaml prevents UI running

Since upgrading to 0.92.X, my Google Home devices no longer show in the front end.

The first time I upgraded, the UI would not load - systemctl status [email protected] showed that HA was running. One by one I disabled all components, until I discovered that cast: was faulty and preventing the UI from loading.

To debug, I have tried:

  • deleting all cast related entries from core.entity_registry, core.config_entries
  • commenting out cast: from my yaml, and enabling Cast via Discovery and the Front End, however when I click ‘add Cast’ in the front end, I simply get a spinning blue wheel and can’t go further
  • multiple restarts
  • ensuring pychromecast is updated to the latest version
  • using cast: in combination with host ip of the devices

And so now I’m a bit stuck - any help would be appreciated!

When I run systemctl status [email protected], I can see the following message, which makes me think there is a bug with pychromecast:

   CGroup: /system.slice/system-home\x2dassistant.slice/[email protected]
           ├─25686 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass
           ├─26059 /srv/homeassistant/bin/python3 -m pip install --quiet pychromecast==3.2.1 --upgrade --constraint /srv/homeassistant/lib/python3.5/site-packages/homeassistant/package_constraints.txt
           ├─26102 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass
           └─26191 /srv/homeassistant/bin/python3 -m pip install --quiet pychromecast==3.2.1 --upgrade --constraint /srv/homeassistant/lib/python3.5/site-packages/homeassistant/package_constraints.txt

For what it’s worth, it happened to me as well. My cast devices are marked as unavailable since a recent update.

Well at least I know I’m not the only one! I wonder if this is a known bug, or has affected anyone else. Have you taken any steps to diagnose?

OK - success! I’ve fixed the issue tonight. For info, I’m running in a virtual environment rather than hassio. These are the steps I took:

sudo su -s/bin/bash homeassistant
source /srv/homeassistant/bin/activate
pip install pychromecast==3.2.1 --upgrade -vvv --no-cache-dir

After some more Google-fu, it turned out that the install / upgrade of pychromecast that hass was trying to do on startup was stalling. I ran the upgrade in the terminal with -vvv to show more information which showed that the install was hanging on ‘Caching due to etag’. Back to Google and suggestion to run with --no-cache-dir. And this has now brought the UI, and my devices back online.

I haven’t done any diagnosing yet. I’m running hass.io on an rpi.