Android APP "Unable to connect to Home Assistant"

 homeassistant:
   external_url: "https://my-domain.duckdns.org:xxxx"
   internal_url: "https://192.168.xxx.xxx:xxx"

I wanted the above change to work also but it didn’t.

I agree with everyone who says this has something to do with SSL. I previously allowed external access but decided it wasn’t worth it and disabled it. I started getting this message immediately after removing the “http:” portion of configuration.yaml. The behavior persists across multiple devices.

For what it’s worth Home Assistant still works. I can just click away from the message and use HA without issue, including receiving notifications. But I still would love to fix it if anyone has any ideas!

I was able to solve this problem after turning DNS from automatic to OFF on Android

To turn Private DNS on or off, or change its settings:

  1. Open your phone’s Settings app.
  2. Tap Network & internet Advanced. Private DNS . If you can’t find it, search for " Private DNS ." If you still can’t find it, get help from your device manufacturer.
  3. Pick your option: Off. Automatic. Private DNS provider hostname.
4 Likes

Mine has been off. Doesn’t work.

I managed to fix a similar issue. Maybe it could help somebody else.
So one of my devices (android phone) lost the ability to connect to the HA host. It turned out I can’t even ping this device (raspberry pi 3b). So I fixed it with the following:

  • connect via ssh from a PC
  • run arp -e. i realized there is no ip-mac mapping for my phone in the raspberry arp table.
  • ping my phone from the HA host

Suddenly my phone now can connect to the HA host. and there is a record in arp table.

I’m not a linux expert so maybe somebody can explain what exactly happened, what i exactly did and why it helped :slight_smile:

I have run into the same issue, however in my configuration Home Assistant is being proxied by Nginx using HTTPS. The Android application reports “Cannot connect” if the only TLS protocol enabled in Nginx is TLSv1.3. Enabling TLSv1.2 allows the application to connect.

Issue: https://github.com/home-assistant/android/issues/1477

1 Like

Hi Steve,
Thanks for the info. I cleared the Cache and Data, updated HA and my Android phone is now available in Intergrations.

Bob

For anyone still having the issue, clearing the files and cache, THEN uninstalling and reinstalling Home Assistant app did it for me on a brand new Pixel 5. Not sure why it didn’t work the first time, maybe the play store saved my cached files or something and reinstalled them, but it should have been completely fresh the first time. Weird, but works now.

Hi everyone, I’m a newbie with HASS, my English could not be perfect, I apologize.
I have the same issue with my Android phone and with my wife’s Iphone.
I did test all solutions proposed here above without any results. The HA app has worked, on both machines, few days just after the first installation. Strange situation, isn’t it?
Thanks for help

Denis

I am having an issue connecting to HASS from my android phone app, but only if I am using a VPN to connect to my Home Network. If I connect to HASS from chrome on my phone with my VPN connected, no issues connecting.

HASS is setup with SSL using Let’s encrypt. NGINX cost other connection issues, so using port forwarding. VPN works for all other services I am running on my home network.

Same problem to me.
Since I installed duckdns+let’sencrypt no more connections with the ha android app.
net::ERR_CONNECTION_REFUSED

Opera/ chrome- browser works well, on W10 too, but in local network only.
Strange behaviour.
Anyone a good idea :bulb:? Help appreciated.

2 Likes

I’m now running into this issue on android. I’ve even done a full factory reset of my phone and tested this with an older phone where HA was setup on it did a wipe of the cache/storage and I can now reproduce this error. Starting to wonder if its something in HA itself. Doesn’t matter which method I use to connect to my HA instance they all return the same error.

Ran into the same problem, only on IOS. Got send on a red herring quest, as i just changed my router. As it happened it wasn’t the router that sparked the issue.

I’m using a Synology NAS with docker to run HA, and i’m using the Synology reverse proxy to make it SSL. After reading this topic, I remembered i set the SSL profile level to “modern compatibility”. After setting it back to “normal compatibility” the app started working again.

1 Like

I’m one step further now and get the message my ssl- certificate is not valid.
But only if I use Wireguard, without no connection at all.

Hi everyone,
I have read through the thread and tried some of the steps but I do not see anything recently for this. I am on HA version :core-2021.7.2

I have now noticed that I am unable to connect to HA from the Android Companion app when I am not on my local network. I am using DuckDNS and NGINX installed add ons are on the latest release.

I now have to enter my local IP address “http://192.168.xx.xxx:8123/” into the companion app on my phone and it works when I am connected to my local wifi but when I put the DuckDNS address, which I had setup before I am unable to connect. I get the following error - “400:Bad Request”

Does anyone know the steps involved in me getting this to work externally outside my wifi network?

This is how I had it before with DuckDNS

https://xxxx.duckdns.org:8123/

I have found this in my log.

Logger: homeassistant.components.http.forwarded
Source: components/http/forwarded.py:91
Integration: HTTP (documentation, issues)
First occurred: 1:32:22 PM (2 occurrences)
Last logged: 1:32:27 PM

A request from a reverse proxy was received from 172.30.33.2, but your HTTP integration is not set-up for reverse proxies.

I found a thread that assisted in resolving my issue.

been dealing with this for a few weeks. Will allow me to setup the app and get notifications, but i cant connect when i try in the app.

Had issues too; selecting a Lovelace View did the trick for me. Hope it helps you too.

http://192.168.1.136:8123/lovelace/lights
1 Like

I keep getting “Unable to connect to Home Assistant.” in the app and “Your Internet access is blocked” in my mobile web browser (which has no trouble loading other sites). Everything works fine in my desktop’s web browser.

Local traffic should not be routed through my V.P.N. but I have not confirmed it yet. I tried setting the Internal Connection URL but that didn’t help either.

I noticed that the app shows “Web page not available” with the url sometimes showing just the protocol, address, and port and other times also trailing “?external_auth=1”. Including that parameter in my desktop’s web browser returns 404. Not sure if that’s supposed to work.

This may or may not be related but the app behaviour is very eratic. Sometimes it takes a few seconds to detect the error, sometimes is doesn’t. Sometimes I can open the settings menu, sometimes it doesn’t open. I often get “Home Assistant isn’t responding” messages, but the app seems to work fine if I choose to “wait” for it to respond. There is usually (but not always) an option to refresh with either the external or internal address, but never both. It seemed to change once when I set the internal address but it never changed again even after I removed that address.

UPDATE: The issue was that Android’s setting to “Block connections without VPN” was enabled. I assumed that my V.P.N. app’s feature to bypass for local traffic and/or not secure specific apps would also bypass this block, but apparently not. Hopefully this is useful to others.

It seems that this may be an issue specific with my device. It is working fine on a Samsung Note 8 I have, but not on the OnePlus7T I am using as my phone.

I have to imagine there is a setting I am not seeing that is causing this issue on the phone. Still able to receive notifications but not access the dashboards

best advice i can give is to make sure android system webview is up to date and check that chrome is up to date as well. If you are on a custom ROM make sure to switch to googles version of webview as any other version is incompatible.