core: Cast Unable to connect to the Home Assistant websocket API
Home Assistant release with the issue: version: 0.99.2
Last working Home Assistant release (if known): None
Operating environment (Hass.io/Docker/Windows/etc.): Hass.io
arch: amd64
boot: true
custom: false
image: homeassistant/qemux86-64-homeassistant
machine: qemux86-64
Component/platform: Cast
Description of problem:
When using the cast website interactively - casting lovelace cards works.
When using cast.show_lovelace_view the chromecasts display the HA logo ❤️Nabu Casa Logo with an error below reading:
Not Connected
Error: Unable to connect to the Home Assistant websocket API.
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
websocket_api:
Working when called via gui

Not working when called via cast.show_lovelace_view

About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 70 (10 by maintainers)
There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I resolved this by setting the private IP on my public DNS for the domain (as I use a subdomain for local stuff)
Really we do need the ability to override the URL used for Casting though
Bump. Still having issues with this on latest version
Well, the issue has not gone away.
I had the “unable to connect to Websocket API” issue when I was trying to cast lovelace to my Nest Hub. I use NGINX Proxy Manager and DuckDNS (Let’s Crypt).
What got it working for me was removing base_url from configuration.yaml (as I did when I set up NGNIX) and adding:
Why I started thinking about this was because I’ve had other integrations that has referencing an old duckdns.org-account and I couldn’t really figure out why. My current duckdns.org-account has never used base_url. Maybe it is something there?
There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Hi @BenWoodford , I’ve your same problem. For TTS setting I’ve used base_url config to solve the issue, but for casting this option not exists. I don’t really understand your workaround, please can you explain me? Thanks.
Interesting, I’m going to test this theory by forcing my Google devices to use my local DNS. I’ve been meaning repoint those through my pihole anyway. I’ll report back. (Blocking outbound udp/tcp port 53 to Google DNS servers forces them to use your local DNS servers)
I am also getting this, and when I try to cast from the cast website to my nest hub, I receive the “Cast Unable to connect to the Home Assistant websocket API”.
I think the cause is, in my router, I have specified the 192.168.1.1 as a default DNS server to be able to access to my home assistant instance from local network using the external domain (if I don’t do that, I can only access from local network by local IP, and this is needed due to some issues in my router model)
If I access from a device with default system DNS, they work, but if I change them to google ones (8.8.8.8 and 8.8.4.4), they don’t work
I have researched, and looks like Nest Hub have their own DNS pointing to google ones, and this can’t be changed, so, can be this the issue?
Also I have tryied all the combinations above in the
http:, and still no success.I described this issue here https://github.com/home-assistant/home-assistant-polymer/issues/3778 as I thought it’s more some bug of polymer/Lovelace
OK specifying the port, I can then use it. BUT it doesn’t recognise the path - it works if I set the path to 0 and it displays only my states - not view 0. If I select anything else I get an error `Unable to find a view with path x’