pychromecast icon indicating copy to clipboard operation
pychromecast copied to clipboard

Recent versions fail to find my chromecast

Open caco3 opened this issue 3 years ago • 4 comments

I had a script working fine by connecting directly by IP:

import pychromecast
pychromecast.Chromecast("192.168.1.108")
# => Chromecast('192.168.1.108', port=8009, device=DeviceStatus(friendly_name='myChromecast', model_name='Eureka Dongle', manufacturer='Google Inc.', uuid=UUID('78c41f7a-7370-bdd1-99cf-515532fc4a81'), cast_type='cast'))

This work fine with pychromecast 7.7.1.

Now I tried to update to update to the latest version (11.0.0). I learned that I need to connect differently, but it doesn't find the chromecast anymore:

import pychromecast
chromecasts, browser = pychromecast.get_listed_chromecasts(known_hosts="192.168.1.108")
print(chromecasts) # <= Chromecast no longer found!

So am I doing something wrong or is it broken?

I tested the discovery_example.py example and it works fine:

Found cast device with UUID 78c41f7a-7370-bdd1-99cf-515532fc4a81
Currently known cast devices:
  78c41f7a-7370-bdd1-99cf-515532fc4a81 CastInfo(services={ServiceInfo(type='mdns', data='Chromecast-78c41f7a7370bdd199cf515532fc4a81._googlecast._tcp.local.')}, uuid=UUID('78c41f7a-7370-bdd1-99cf-515532fc4a81'), model_name='Chromecast', friendly_name='Wohnzimmer', host='192.168.1.108', port=8009, cast_type=None, manufacturer=None)

How ever I do NOT want to rely on mDNS!

Notes:

  • I am aware of https://github.com/home-assistant-libs/pychromecast/issues/442 and https://github.com/home-assistant-libs/pychromecast/issues/577 !
  • One reason of wanting to use an IP is because i want to run it in docker and was not able to get mDNS discovery working (I tried -net=host already).

caco3 avatar Apr 05 '22 20:04 caco3

@caco3 I'm in the same boat, the API definitely changed as a CastInfo is required. Unfortunately due to issue #290 client side code can't determine which API to use other than by using requirements file.

See the examples directory, I believe I saw a search demo that has ip/hostname filtering - but I suspect that may not work with your network setup as it appears to be a filter rather than a pointer to go check this address.

You might be able to create a dummy CastInfo object?

clach04 avatar Jul 02 '22 17:07 clach04

This just started happening to me today on 1st gen chromecasts. I have two and neither are found by pychromecast. The pychromecast system hasn't changed, seems something changed on the chromecast.

EDIT: Just as suddenly as it stopped, it started working again.

soreau avatar Oct 04 '22 23:10 soreau

Today again, it has stopped working. I've rebooted the system, tried pychromecast on other machines, nothing has been working. The network is working fine as far as I know. I would really like to know what is causing this intermittent behavior.

soreau avatar Oct 08 '22 12:10 soreau