I’m having an odd issue where I can’t connect to my Home Assistant instance externally from the Home Assistant Companion app, but I can access the cloud instance (nabu casa url) through my browser on the same device.
I can access Home Assistant fine through the app on my home network as well, just not externally.
Screenshots attached and logs below:
Login attempt or request with invalid authentication from localhost (127.0.0.1). Requested URL: '/auth/token'. (Home Assistant/2023.8.2-10992 (Android 13; M2102J20SG))
Login attempt or request with invalid authentication from localhost (127.0.0.1). Requested URL: '/api/websocket'. (Mozilla/5.0 (Linux; Android 13; M2102J20SG Build/TQ3A.230705.001.B4; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 Home Assistant/2023.8.2-10992 (Android 13; M2102J20SG))
Hmm… I had tried that and still had the same issue before posting. But maybe because I logged back in while on the home network?
Logged out and then logged in while on mobile data this time and was initially told unable to login due to untrusted network (as you’d expect), but used home assistant local login with user credentials and got in fine, and seems to be working okay when off home wifi.
I don’t think you can login and get the proper token if using trusted network when logging into the mobile app. The token is probably only valid in the given circumstance.
I am also dealing with these symptoms. In my setup, I have a local DNS server for requests from within my network pointing to a local IP (192.168.1.9), and a cloudflare tunnel for requests from outside the network. It seems that the app somehow remembers the IP from the local DNS, even when connecting remotely, which will obviously fail. The relevant line in my logs is:
01-24 18:47:19.520 25202 31987 E SensorReceiver: Error while getting core config to sync sensor status
01-24 18:47:19.520 25202 31987 E SensorReceiver: io.homeassistant.companion.android.common.data.integration.IntegrationException: java.net.SocketTimeoutException: failed to connect to homeassistant.ssenhorst.nl/192.168.1.9 (port 443) from /10.66.42.219 (port 38480) after 10000ms
Does the android app keep some local DNS cache somewhere?
Given the logs provided by @jonaseymour, I think we are likely dealing with a different issue which does share the same symptoms.
PS: @jonaseymour, be aware that there is personally identifiable location information in the logs you shared. It might be worth redacting some sensitive info…