Android APP "Unable to connect to Home Assistant"

it will always be an issue for some at different times, most if not all of these are for the user to solve as the server setup is not something the app has control over. The best the app can do is notify you of the error and to follow troubleshooting steps such as clearing data like you did to solve the issue (other times its been a valid certificate etc…). There are somethings proxy/dns related that get stored in places of WebView that won’t get cleared out until data is cleared. Browsers will behave differently than the app in this regard but knowing it can connect in a browser should be a clue as to where the issue may be as you saw clearing data helped.

Thanks for the reply. It was fine after the other nights fix, but I get home tonight and can’t use the app, same steps refused to work tonight.
Tried accessing on a browser and can’t access there either, tried on 2 different browsers on pc and on chrome on my phone. I’m only 1 week in with my new HA Yellow set up, and know Very Little about it all. Total newbie.
One hell of a learning curve!

1 Like

Hi, I’ve been having this issue of the connection not working from both the HA app and via browser, but only via one tablet (the one mounted to my wall…). All other devices (pc/iPhone etc) work fine. Weirdly, restarting my router seems to fix the issue for a random amount of time (could be an hour? Could be a week). Any ideas?

Same issue here.
I’ve have had one tablet working for 3 months with no issues and this started a few days ago.
It runs 14h a day, and happens about 10 times a day.
There is no connection problem because I have a new tablet (exact same model, same configuration, same OS version, etc.) and side by side one has the error and the other presents no errors.

Could be something reaching its limits? Loop, logs, any memory allocation or counter?

Also, if you inmediatly click retry it works properly.
Could some correct this connection error dialog and be removed automatically when the connection “comes back” instead of staying there for hours?

solved it for this noob on his first foray into home assistant, thank you!

Hey there so I’ve been using HA(and companion app on 3 Android phones) for over an year now. Since the last update I am no longer able to reach the HA with the companion app on all the phones from outside of local network.
I am using Duckdns for outside access and nothing apart from an update is changed.

At first no issue was reported anywhere but after a reinstall on one of the devices I started seeing the following error

Error Code: -6 
"net::ERR_CONNECTION_REFUSED"

I trying some of the “fixes” that I managed to see but none of them worked.
Has anyone experienced the same and perhaps has a solution?

1 Like

interesting read, i cant connect through vpn too.
i thought i was the only one or my vpn connection (wireshark on router or as haos addin) was faulty.

i also having issue with connection on android app. i also using duckdns to access HA at home.
what i found out that
on mobile phone

  1. on mobile phone web browser, after i disable all security and privacy setting on the web browser, i able to connect directly to homeassistant.local:8123, that after ignoring to all the warning
  2. but on HA companion app. connection to HA can only be done thru duckdns only. any attemp to by adding connection thru internal local network either by adding the wifi ssd or or together with the address homeassistant.local:8123, i will no able to connect at all.

i believe it is issue with the companion app.

so even when i am at home, i have to connect to duckdns.org instead of connecting to homeassistant.local.

Remember not to use https locally as that will not work. The companion app expects a valid certificate and does not bypass certificate errors.

i tried both still doesn’t work.

what is the actual error message in the pop-up it should be somewaht descriptive? If it generic click on Settings on the popup go to Troubleshooting > Logs and look at the failure

the error is
“unable to connect to yome assistant
server or proxy hostname lookup failed.
please check that the url is a valid
home assistant url”

regardless whether i use https or http

but if i connect direct from web browser. i do not face this problem.

if i try to connect thru https://192.168.0.151:8123/ ,thru HA app. i got certificate missmatch. if with http, i got error code -1

i found this error under network tab

" invalid local network url
you have configured an https certificate in home assistant . this means that your internal ural need to be set to a domain convered by the certificate"

but this error only in ha companion app. no issue to connect thru web browser

what URL are you using? are you trying homeassistant.local? If so then try the IP address directly, not all android devices translate the DNS name properly there.

https is never valid on a local IP address.

so why with http i got -1 error

thats a question only you can answer, its all based on your networking setup. The error should also be descriptive and not just a -1 but will also say something like host name look up or something else.

where to look at this setup? what are the thing i need to check?

last time I had this problem the issue was IP ban stuff, but that was not the case this time, and the Android companion app reinstall fix worked for me. I should have tried deleting the cache first but hey, its working now.

Changing the ip address of the phone did the trick for me. I was unable to access it locally but was able to access remotely through dynu.

Had the same issue this morning when I wake up and I tried everything… delete app, delete integrationss, delete cache, data, token… nothing helped until, I changed the phone wifi to 2.4ghz service line. BAM worked like a charm! WTH?

edit - Error occured again, but I find the problem. I setup a home assistant at my friends house and nabucasa thinks I tried to connect it, so two servers collide when app tries to connect local server. Disabled the cloud connection on the other one and works like a real charm this time!