Android APP "Unable to connect to Home Assistant"

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!