core: Google Cast integration doesn't probe devices

The problem

The Google Cast integration no longer seems able to scan for Google Chromecast devices on my network, which in turn means it can’t use them.

More specifically, I never see it send the mdns discovery packets to my network, so the devices never reply to it. Existing Chromecast devices/entities stay unavailable, and new Chromecast devices aren’t seen. If I trace the hass process, I can see it writing plausible looking mdns packets to the right socket. However, if I run tcpdump looking for those packets I don’t see them end up on the wire.

I can trick hass into seeing devices if I run a scan withcatt (Cast All The Things). When I did that, the new device was discovered, and the existing devices woke up in my dashboard and I was able to see what they were doing and control them. catt is installed in the same venv as hass and uses pretty much the same set of dependencies which makes me think this is a problem with the integration and not the underlying python modules.

The Cast integration was working before

What is version of Home Assistant Core has the issue?

core-2021.4.5

What was the last working version of Home Assistant Core?

core-2021.2.ish

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Google 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?

No response

Additional information

System Health

version core-2021.4.5
installation_type Home Assistant Core
dev false
hassio false
docker false
virtualenv true
python_version 3.8.6
os_name OpenBSD
os_version 6.8
arch amd64
timezone Australia/Brisbane
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 1
resources 0
views 3
mode storage

Python modules

(hass) apathy$ pip freeze
acme==1.12.0
aiodiscover==1.3.4
aiohttp==3.7.4.post0
aiohttp-cors==0.7.0
astral==1.10.1
async-dns==1.1.9
async-timeout==3.0.1
async-upnp-client==0.16.0
atomicwrites==1.4.0
attrs==20.3.0
awesomeversion==21.2.3
bcrypt==3.1.7
boto3==1.16.25
botocore==1.19.25
casttube==0.2.1
catt==0.12.1
certifi==2020.12.5
cffi==1.14.4
chardet==4.0.0
ciso8601==2.1.3
click==7.1.2
colorlog==4.8.0
cryptography==3.3.2
deepmerge==0.1.1
defusedxml==0.6.0
distro==1.5.0
ecdsa==0.14.1
emoji==1.2.0
envs==1.3
h11==0.11.0
hass-nabucasa==0.42.0
home-assistant-frontend==20210407.3
homeassistant==2021.4.5
httpcore==0.12.2
httpx==0.17.1
idna==2.10
ifaddr==0.1.7
Jinja2==2.11.3
jmespath==0.10.0
josepy==1.5.0
jsonrpc-async==2.0.0
jsonrpc-base==2.0.0
jsonrpc-websocket==3.0.0
MarkupSafe==1.1.1
multidict==5.0.2
mutagen==1.45.1
netdisco==2.8.2
paho-mqtt==1.5.1
Pillow==8.1.2
PlexAPI==4.5.1
plexauth==0.0.6
plexwebsocket==0.0.13
protobuf==3.14.0
pyasn1==0.4.8
PyChromecast==9.1.2
pycognito==0.1.5
pycparser==2.20
pyipp==0.11.0
PyJWT==1.7.1
pykodi==0.2.5
PyMetno==0.8.1
PyNaCl==1.3.0
pyOpenSSL==19.1.0
pyotp==2.3.0
PyQRCode==1.2.1
pyRFC3339==1.1
pyroute2==0.5.18
pysonos==0.0.37
python-dateutil==2.8.1
python-didl-lite==1.2.6
python-jose==3.2.0
python-slugify==4.0.1
pytz==2021.1
PyYAML==5.4.1
requests==2.25.1
requests-toolbelt==0.9.1
rfc3986==1.4.0
rsa==4.6
ruamel.yaml==0.15.100
s3transfer==0.3.3
scapy==2.4.4
six==1.15.0
sniffio==1.2.0
snitun==0.20
SQLAlchemy==1.3.23
ssdp==1.0.1
text-unidecode==1.3
typing-extensions==3.7.4.3
urllib3==1.26.2
voluptuous==0.12.1
voluptuous-serialize==2.4.0
xmltodict==0.12.0
yarl==1.6.3
youtube-dl==2021.4.17
zeroconf==0.29.0

catt scan

(hass) apathy$ catt scan      
Scanning Chromecasts...
192.168.0.127 - Attic speaker - Google Inc. Chromecast Audio
192.168.0.199 - Bedroom - Google Inc. Chromecast
192.168.0.192 - Kitchen Mini - Google Inc. Google Home Mini
192.168.0.193 - Lounge - Google Inc. Eureka Dongle

Standalone catt Python Modules

(catt) dlg@apathy catt$ pip freeze
casttube==0.2.1
catt==0.12.1
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
idna==2.10
ifaddr==0.1.7
protobuf==3.15.8
PyChromecast==9.1.2
requests==2.25.1
six==1.15.0
urllib3==1.26.4
youtube-dl==2021.4.17
zeroconf==0.29.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

FYI, I’ve tweaked my network config like this:

--- /tmp/hostname.em0.orig	Thu Apr 22 09:49:09 2021
+++ /etc/hostname.em0	Thu Apr 22 09:48:51 2021
@@ -1 +1,2 @@
 inet 192.168.0.15 255.255.255.0
+!route -qn add 224.0.0.251 -interface 192.168.0.15

Now I can discover chromecasts without needing explicit config for zeroconf.

I see the diffs for autodetection, which I makes sense and should help generally. The zeroconf doco update is great too. I’d still suggest referencing zeroconf from the google cast page too though. When this lands in a release, I’ll flip my system configuration around again and see how autodetection works. If there’s problems I’ll put another issue in.

Cheers, dlg

However, I’m betting it’s passing 0.0.0.0 as the interface address to ask for the “default” interface, which would hit this code in the kernel:

Its passing ‘0.0.0.0’ or if ipv6 is on result.append((('', 0, 0), 0)) (aka default)

https://github.com/jstasiak/python-zeroconf/blob/master/zeroconf/__init__.py#L2164 https://github.com/jstasiak/python-zeroconf/blob/master/zeroconf/__init__.py#L2272