I randomly get the message that I am “Unable to connect to Home Assistant” on mobile app. It appears mostly when connecting to Wi-Fi outside of my home network. If I switch over to data only on my cell it works. When I switch back to Wi-Fi I get the same error. It works most of the time on Wi-Fi outside of my network. I just can’t figure out how to get it to work consistently. Any suggestions ?
How did you configure your remote access?
How did you configure the connection in your app?
Is the SSID of the WiFi(s) the same as the one in your home network?
Remote access is via duckdns.
Connection is my https://xxxxxx.duckdns.org:8123
Wifi SSID is the same as home network.
Like I said, this is intermittent. Even when it works, I still get the “Unable to connect to Home Assistant”
click on Settings in that popi-up and go to Logs to look at the failure, that should hopefully give you a clue what happened so you can fix it.
From my understanding the app looks at the SSID and if it’s the same as your local network it will try to connect locally. Since you are not at home this is not possible.
Change the SSID or always connect via the external URL. Maybe this will fix the issue.
Correct, the app reads the SSID as a string. It does not look at the BSSID, as that needs to be provided by the user but the app currently does not look for that. Will be quite the breaking change to properly add that
The logs I mentioned above will print what URL is being used to make it easier to troubleshoot
There is a lot in there. The one that stands out for me is…
02-17 11:51:10.848 14692 14837 E chromium: [ERROR:ssl_client_socket_impl.cc(995)] handshake failed; returned -1, SSL error code 1, net_error -200
02-17 11:51:10.861 14692 14692 E WebviewActivity: onReceivedHttpError: primary error: 2 certificate: Issued to: CN=mydomain.duckdns.org;
DuckDNS works perfect for me. I can access HA remotely by typing https://mydomain.duckdns.org:8123 on a browser, it’s only the Companion app that gives this “Unable to connect to Home Assistant” error. I keep having to select Refresh External URL and Wait to get it to work, but after a minutes the “Unable to connect to Home Assistant” error appears again.
while the certificate may work in a browser, there seems to be some issue with the certificate on android. Android itself can be pickier about it, you may need to regenerate your certificate. Certificate errors are not ones the app can solve. There may be more errors in the logs about the certificate if the webview is failing.
I have regenerated the cert, rebooted HA, reinstalled the companion app. Same issue…
02-17 15:06:26.206 12738 12859 E chromium: [ERROR:ssl_client_socket_impl.cc(995)] handshake failed; returned -1, SSL error code 1, net_error -200
02-17 15:06:26.210 12738 12738 E WebviewActivity: onReceivedHttpError: primary error: 2 certificate: Issued to: CN=mydomain.duckdns.org;
02-17 15:06:26.210 12738 12738 E WebviewActivity: Issued by: CN=R3,O=Let’s Encrypt,C=US;
02-17 15:06:26.210 12738 12738 E WebviewActivity: on URL: https://192.168.0.3:8123/config/zha/visualization?config_entry=b1660e14df188721525c1c8c0586c944
02-17 15:06:26.217 12738 12738 D UrlRepository: localUrl is: false and usesInternalSsid is: false
looks like something in the webview is still trying to connect to your local URL however your local URL will never work because https
is not valid with the local IP like it is listed
I appreciate any advice. What do you suggest ?
BTW, This only is an issue on my Samsung devices (phone & tablets ). It works perfect on iPhone.
I have the exact same problem. If I connect to a wifi that’s not my home, I see the same error.
I’ve also re-issued my certificate and nothing. I’m using an Android device.
If I turn off my wifi, I can access the app using the cell connection.
The logs also showed an error with the certificate:
ERROR:ssl_client_socket_impl.cc(999)] handshake failed; returned -1, SSL error code 1, net_error -202
I’m also using duckdns with letsencrypt certificate
this does not look to be an error from the Companion App Logs so hard to tell what the failure. Check the companion app logs instead of HA core logs for actual error.
That log line was copied from the companion app logs directly from my phone. I never accessed the HA core logs to check what the issue was, I assumed that the core will not have any relevant information. I was never able to access my server (and hence check the core logs) while on wifi anyway. In any case, my error is exactly the same as the one originally reported.
I can’t share a new log at this moment since I need to connect to a different wifi than my home, but I will once I have the chance.
Hello
Just wondering if this has been resolved, as I experience the same issue. I use DuckDNS with my HA at home. I can access it fine over home wifi and mobile data, but not using work wifi, using the android app. PC browsers on both wifi systems work fine. Phone is a Samsung Galaxy Note20. This all used to work perfectly fine before. Everything is updated to the latest.
Interesting is if I use the phone browsers (both Samsung and Chrome), I get “…might be temporarily down or it may have moved permanently to a new web address.”
EDIT: My issue has been resolved - totally unrelated. DNS lookup problems…
Thanks!
Greetings,
I am experiencing the same issue since I started using Duckdns but my situation includes my mesh wifi nodes, meaning I can only access HA mobile app when connected to the first mesh node the app initially connected to and when I hop to any of the other mesh nodes I get the “Unable to connect…” error. If I move/roam back to the first node the app reconnects automatically.
I can confirm that this is the same behaviour with Android 12 and HA Companion (v. 2022.10.2) and iOS 15.7.1 and HA Companion (v. 2022.10.1 - 2022.424).
It’s obviously not an issue with the SSID name and it looks to me like the handshake is also looking at the MAC of the AP/Nodes.
Cheers.
I have the same issue, I have a WiFi 6 mesh network and it appears the issue shows up when I’m not connected to the main router mesh to which my Home assistant yellow box is physically connected to.
Did you find any solution? What could be the cause?
I am experiencung the exact same problem.