Chromecast will never connect, even though it is discovered

Hi all,

I searched around, but I haven’t been able to find an answer to this issue I am having. I’ve found similar, but they seem to all be related to the Chromecast turning off and not being recognized. I can’t get mine to be recognized at all. I would think that since they are being discovered that I could connect to at least one of the casts manually too.

Problem:
Chromecast will never be discovered by HA’s discovery, regardless of the fact that HA does recognize my chromecasts. It does not display in the dashboard or in any of the discovered
Chromecast cannot be added manually via configuration.yaml, or HA will not start at all. This method provides the exact same error. The only difference is that HA does not start.
Chromecast will not be visible at all in the HA dashboard (or services, and whatnot)

HA Logs:
INFO:pychromecast:Querying device status
INFO:pychromecast:Querying device status
INFO:pychromecast:Querying device status
INFO:pychromecast:Querying device status
ERROR:pychromecast.socket_client:Failed to connect, retrying in 5.000000s
Traceback (most recent call last):
File “/home/homeassistant/.homeassistant/deps/pychromecast/socket_client.py”, line 239, in initialize_connection
self.socket.connect((self.host, self.port))
File “/usr/lib/python3.4/ssl.py”, line 840, in connect
self._real_connect(addr, False)
File “/usr/lib/python3.4/ssl.py”, line 831, in _real_connect
self.do_handshake()
File “/usr/lib/python3.4/ssl.py”, line 804, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
ERROR:pychromecast.socket_client:Failed to connect, retrying in 5.000000s
Traceback (most recent call last):
File “/home/homeassistant/.homeassistant/deps/pychromecast/socket_client.py”, line 239, in initialize_connection
self.socket.connect((self.host, self.port))
File “/usr/lib/python3.4/ssl.py”, line 840, in connect
self._real_connect(addr, False)
File “/usr/lib/python3.4/ssl.py”, line 831, in _real_connect
self.do_handshake()
File “/usr/lib/python3.4/ssl.py”, line 804, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

BUT

It does discover them:
16-12-29 19:33:49 INFO (Thread-13) [homeassistant.components.discovery] Found new service: google_cast (‘192.168.1.18’, 8009)
16-12-29 19:33:49 INFO (Thread-13) [homeassistant.components.discovery] Found new service: google_cast (‘192.168.1.6’, 8009)

Netdisco Output:
Tried this to get the info on connected devices, and make sure that they are at least being discovered.
homeassistant@raspberrypi:~/.homeassistant/deps$ python3 -m netdisco
Discovered devices:
Error fetching description at http://192.168.1.1:8200/rootDesc.xml
google_cast [(‘192.168.1.18’, 8009), (‘192.168.1.6’, 8009)]
netgear_router [(‘R6400’, ‘192.168.1.1’)]
DLNA [‘http://192.168.1.4:64321/bdv-ej-ms.xml’, ‘http://192.168.1.1:8200/rootDesc.xml’]

HASS Setup:
Raspberry PI 2
32GB MicroSD
Wired or wireless connection (have done both. Wireless is 2.4ghz only.)
Fresh install of rasbian
Fresh install of HASS (have tried both manual install and all in one install)
Running HASS in virtual environment

Network:
Netgear R6400
2.4GHz network - Broadcasting SSID, password protected, WPA2-PSK
5GHz network - Broadcasting SSID, password protected, WPA2-PSK
All devices on same subnet (double checked that)
Otherwise, default configurations

Chromecasts:
One classic Chromecast running on my 5ghz wireless network
One Vizio TV with built in smartcast, wired/running on my 5ghz wireless network

Things I have tried:
Reboot Pi
Restart HASS
Configure cast manually (causes HASS to not start at all)
Reinstall/upgrade netdisco
Reinstall/upgrade pychromecast
Reinstall/upgrade HASS
Check configuration to see if the chromecasts are even showing (they are)
Review IPs for both Chromecasts (on the router and on the Pi)
Restart Chromecast
Update Chromecast
Move Chromecast to another display in the house

If you need more info, please let me know! I was really hoping to use this to see my cast devices :frowning:

I get the same error but I do see my Chromecasts. I have them manually defined in my configuration.yaml like this:

media_player 2:
  platform: cast
  host: 192.168.1.158
#
media_player 3:
  platform: cast
  host: 192.168.1.157
#

I will also see my Vizio TV, but only if it is on and I am actually casting to it. I haven’t yet tried casting anything from HA to it, but would assume it works.

It may well be the reason for the errors as I think HA not connecting unless it’s actually on, unlike the hardware Chromecasts. There may have been some updates to the library that HA is using to connect that haven’t been updated in HA yet. Just a guess.

Yeah. Unfortunately, I’ve tried to manually configure the cast. For whatever reason, then HA doesn’t even start, even though I’ve verified the yaml.

No matter what, nothing shows up in the dashboard.

I’m going to try to manually configure them again, for sure, and I appreciate the response.

Having the exact same problem today with the latest update…