Cant connect to Home Assistant

Hope someone can help with a problem I am having.

I am trying to add the Home Assistant intergration but it causes an Error.
I receive the following " Internal server error, please try later"

All I am doing is -

  1. creating a Long Lived Access Token on Home Assistant
  2. copy and paste the key into the box within the configurator
  3. click next
  4. Receive a pop-up stating “Internal server error, please try later”

Could someone please explain what I may be doing wrong?

Is it a Remote problem or Home Assistant problem?
Would there be something in the settings of Home Assistant that would be blocking the WebSocket API URL - ws://homeassistant.local:8123/api/websocket?

Any help would be much appreciated.

I had the same issue at the beginning, normally i would use my external DNS for that topic, but this also doesn’t solved it.

Therefore i have now switch to the static IP directly ws://<>:8123/api/websocket

Thanks Freshhat

I will give that a try tonight once I have the remote to hand.

Still no joy connecting to the Home Assistant intergration.
I am still getting the error message " Internal server error, please try later"

These are the URL’s I have tried and none seem to connect to my Home Assistant.

ws://homeassistant.local:8123/api/websocket
ws://:8123/api/websocket

wss://homeassistant.local:8123/api/websocket
wss://:8123/api/websocket

http://homeassistant.local:8123/api/websocket
http://:8123/api/websocket

https://homeassistant.local:8123/api/websocket
https://:8123/api/websocket

If i put any of these into a web browser the only ones that bring back a message on screen are the https:// addresses.
So I assume the “homeassistant.local” is working OK but there is something blocking the connection to my Home Assistant.

I remember a while back I had a problem connecting an old tablet to my Home Assistant using the Local address.

At that time I installed Nginx Proxy Manager add-on to try and connect the tablet and had a little bit of success but it still didn’t work properly connecting.
Unfortunately I don’t know much about networking, but would this be the problem?
or could it be a problem with the port forwarding on my router?
I tried turning off Nginx Proxy Manager add-on within Home Assistant but that didnt seem to help.

As I say, if I use https:// in the browser it does seem to have some success throwing up a message Re: websocket (sorry, didn’t make a note of the exact wording)

I was pulling my hair out yesterday trying every combination I could think of to try and install the Home Assistant intergration.

I have now exhausted the extent of my knowledge, which isn’t much!, and would appreciate any help.

I’m I going to have to completely uninstall Home Assistant and start from scratch? I hope not!!

For sure the ws:// will not give you any result in the browser as it’s used for the WebSocket Connection

Did you tried it also with the local IP Address where your HomeAssistant installation is running? Something like

ws://192.168.172.5:8123/api/websocket

Yes, sorry Freshhat.

All those on the list below the homeassistant.local are supposed to show that I used the IP.

ws://192.168.0.xxx:8123/api/websocket
wss://192.168.0.xxx:8123/api/websocket
http://192.168.0.xxx:8123/api/websocket
https://192.168.0.xxx:8123/api/websocket

All to no avail.

If I put https://192.168.0.xxx:8123/api/websocket or https://homeassistant.local:8123/api/websocket into a browser I do get a message appear that mentions websocket (sorry, didn’t make a note of message) but at least it returns something.

All other URL’s I put into a browser return a 404 not connected.

I can get to the log in page for HA if I type…

https://192.168.0.xxx:8123 or https://homeassistant.local:8123

So I know https should work even though ws:// doesn’t seem too.

Just seems to be the /api/websocket part that has problems connecting to HA

Unfortunately I don’t know that much about these things and hope that you understand what I am trying to express.

You could first of all try to check if it’s an issue with the Remote Integration or if it’s a general Homeassistant issue.

There are Browser Extensions available for Chrome & Firefox in order to test a Websocket connection.

Chrome: WebSocket Test Client - Chrome Web Store
Firefox: Simple WebSocket Client – Get this Extension for 🦊 Firefox (en-US)

And then you can use ws://<>:8123/api/websocket in order to get something like this:

image

Thanks Freshhat

I will give that a try tonight and see if that works.
I will let you know how I get on.

Used the websocket test client and seems to be open but still unable to connect :frowning:

Tried so many ways to get into HA I am at the end of my tether!

Don’t know if its the Remote, Network or Home Assistant set up that seems to be blocking it?

I guess without providing logs your final question cannot be answered. Maybe worth to open a new bug report here Issues · unfoldedcircle/bug-reports · GitHub

Sorry but i also don‘t have more ideas on that

But you did connect, at least according to that screenshot. You send it a web socket request, and HA properly responded that you need to authenticate to use that function. It’s an important distinction. The troubleshooting for “I can’t connect” is different than the troubleshooting for “I can’t authenticate.”

I don’t have a remote yet, so I can’t tell you why you can’t authenticate because I have no idea how the remote sets up the authentication. But that’s the problem you’re trying to solve.

hello everyone

I start messing around with the remote, but I can’t connect to the home assistant, the link that comes standard doesn’t work, and I have duck dns, that is, “8123” doesn’t work for me, can someone help me please?

Thank you

The default connection method to communicate with a Home Assistant server in the same network is through its local address.
The default address of HA is homeassistant.local on port 8123.
Usually your remote and the HA server are in the same network within your home and no public DNS address is required.

Please provide more information about your setup.

The screenshot of the WebSocket test client shows a successful connection to your Home Assistant server.
The next step is to authenticate: WebSocket API | Home Assistant Developer Docs
After sending the long lived access token, the WS connection is authenticated and requests can be sent to HA:

{
  "type": "auth",
  "access_token": "ABCDEFGH"
}

That’s exactly how the HA integration on the remote works. Two things are essential:

  1. Correct WebSocket API URL of the HA server. Default: ws://homeassistant.local:8123/api/websocket
  2. A long lived access token

Both requirements can be tested with a WebSocket test client.
Important: use ws:// instead of wss:// whenever possible. Especially if you have a standard setup and both the remote and the HA server are in the same network. By default, Home Assistant doesn’t provide a wss:// endpoint. This needs to be configured manually with a reverse proxy (at least to my knowledge, maybe that changed “recently”).
If you use wss://: only official certificates are supported. If you use a self signed certificate, the Remote Two integration can’t connect.

Another issue might be mDNS name resolution. Some access points or routers are buggy, sometimes a restart helps…
Also in custom network setups with different subnets or vlans, mDNS doesn’t work out of the box.
To rule out mDNS resolver issues: try with the IP address of the HA server, instead of homeassistant.local.

Hope this helps.

Just to mention that if you have two or more instances of HomeAssistant on your network they, by default, will both advertise as homeassistant.local via mDNS. You can configure the names to be different but using IP address avoids the issue.

I’m having the exact same issues with Home Assistant.
I currently use Home Assistant Yellow, and it has SSL / external DNS setup which works fine on my internal and external network acces, on both computers and my phone.
In other words I use https://mydomain:8123 to access HA.

When attempting to setup the Unfolded HA integration I have tried the IP (192.168.50.193), DNS, homeassistant.local; and none of them work.

“Internal server error, please try later”

OK…I tried wss…and that worked.

This reassures me in a way, I am not alone in this situation. It’s a little frustrating to have the remote and not be able to use it.

Where are you stuck?

I finally found my problem, my problem came from my duckdns settings