home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.65k stars 30.41k forks source link

Casting HA dashboard to NEST hub not working since 2024.10 #128374

Open vhamburger opened 5 days ago

vhamburger commented 5 days ago

The problem

Since upgrading to 2024.10 my dashboard casting is not longer working with my NEST home. I checked all network settings - nothing changed. Checked NGINX, external and internal URL. I get the following error message in logs:

Source: util/logging.py:95
First occurred: 5:57:42 PM (1 occurrences)
Last logged: 5:57:42 PM

Exception in _handle_signal_show_view when dispatching 'cast_show_view': ({'hass_url': 'https://<redacted>', 'hass_uuid': '<redacted>', 'client_id': None, 'refresh_token': '<redacted>'}, 'media_player.<redacted>', 'nestoffice', 'dashboard-nestbuero') Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/cast/media_player.py", line 1031, in _handle_signal_show_view self._hass_cast_controller.show_lovelace_view(view_path, url_path) File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/homeassistant.py", line 195, in show_lovelace_view self._send_connected_message( File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/homeassistant.py", line 221, in _send_connected_message self._connect_hass( File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/homeassistant.py", line 166, in _connect_hass raise PyChromecastError() # pylint: disable=broad-exception-raised ^^^^^^^^^^^^^^^^^^^^^^^^^ pychromecast.error.PyChromecastError

What version of Home Assistant Core has the issue?

core-2024.10.2

What was the last working version of Home Assistant Core?

core-2024.9.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

HA Cast

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 5:57:42 PM (1 occurrences)
Last logged: 5:57:42 PM

Exception in _handle_signal_show_view when dispatching 'cast_show_view': ({'hass_url': 'https://<redacted>', 'hass_uuid': '<redacted>', 'client_id': None, 'refresh_token': '<redacted>'}, 'media_player.<redacted>', 'nestoffice', 'dashboard-nestbuero') Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/cast/media_player.py", line 1031, in _handle_signal_show_view self._hass_cast_controller.show_lovelace_view(view_path, url_path) File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/homeassistant.py", line 195, in show_lovelace_view self._send_connected_message( File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/homeassistant.py", line 221, in _send_connected_message self._connect_hass( File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/homeassistant.py", line 166, in _connect_hass raise PyChromecastError() # pylint: disable=broad-exception-raised ^^^^^^^^^^^^^^^^^^^^^^^^^ pychromecast.error.PyChromecastError

Additional information

No response

home-assistant[bot] commented 5 days ago

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!

Code owner commands Code owners of `cast` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign cast` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


cast documentation cast source (message by IssueLinks)

vhamburger commented 2 days ago

Ok - so nothing changed - I did not update anything - I did not change anything in my network. But since today 11:00 it started working again. There is no error anymore about the web socket API. However - Dashboards are super sluggish and slow. It takes about 20-30 seconds to flick a button after touching it....

vhamburger commented 2 days ago

Ok - so I am happy to share my error with the community in the hopes it helps someone else (kind of like in the aviation community - blameless culture improves security, here - stupid config sharing improves home assistant ;) I noticed today that one of my laptop IPs got banned by home assistant. When opening the ip_bans.yaml file I saw three entries - two from my main VLAN and one from my IoT VLAN (yes - IoT is a separate VLAN and that is highly recommended). Anyhow, the banned IP from the IoT VLAN was indeed my NEST device!! That is why it could not connect to the web socket API. However, I did not get any "blocked IP" error in Home Assistant, I just got the web socket error.

I wonder how the IP got banned in the first place - that seems to be a different story...

So if any one of you has this "Cannot connect to WebSocket API" error - double check your ip_bans.yaml just in case your device is on there ;D I am happy it works but also feel a bit stupid that I did not realize this earlier.

So I hope this helps others who may have a similar issue in the future!

sts098 commented 4 hours ago

I was running in the past, but have not used in a while. Went to use it again today and had issues. Cast connects with the device.
2024-10-19 11 39 10 and shows the home assistant screen. From the device, I can turn it on or off. From Brows media, I can open and play a radio station. But when I try top launch a dashboard, it says not connected, followed by Unable to connect to Home Assistant Web socket API.

I am trying to launch a dashboard which used to use in the past.

Not sure what my issue is.