Long reconnection
See original GitHub issueHome Assistant Android version: 2021.4.1-full
Android version: 10
Phone model: Xiaomi Mi 9T Pro
Home Assistant version: core-2021.4.1
Last working Home Assistant release (if known): None
Description of problem: Whenever I use the HA Companion Anroid app after more than 30 minutes it takes long time to connect (around 10 seconds). When I use the app again within an about 30 minutes time frame, it only takes 1-2 seconds to connect / load. This issue is not observed in Google Chrome on the same phone and neither in the iOS Companion App on an iPad.
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
04-09 20:35:42.333 12698 14436 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"disconnected"},"id":3}
04-09 20:35:42.344 12698 14439 D SensorWorker: Updating all Sensors.
04-09 20:35:42.345 12698 14420 I WM-Processor: Moving WorkSpec (dacb3342-b466-409a-940a-c01e49d91abf) to the foreground
04-09 20:35:42.348 12698 12698 D UrlRepository: localUrl is: false and usesInternalSsid is: false
04-09 20:35:42.348 12698 12698 D UrlRepository: Using external URL
04-09 20:35:42.369 12698 12698 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
04-09 20:35:42.431 12698 21468 D UrlRepository: localUrl is: false and usesInternalSsid is: false
04-09 20:35:42.431 12698 21468 D UrlRepository: Using external URL
04-09 20:35:42.552 12698 14439 D UrlRepository: localUrl is: false and usesInternalSsid is: false
04-09 20:35:52.916 12698 14421 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=dacb3342-b466-409a-940a-c01e49d91abf, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
04-09 20:35:52.920 12698 12698 I WM-SystemFgDispatcher: Stopping foreground service
04-09 20:35:52.988 12698 14436 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":4}
04-09 20:35:52.991 12698 12698 D UrlRepository: localUrl is: false and usesInternalSsid is: false
2021-04-09 20:35:43 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [547233181856] Connected from 79.195.76.244
2021-04-09 20:35:43 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [547233181856] Sending {"type": "auth_required", "ha_version": "2021.4.1"}
...
2021-04-09 20:35:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [547233181856] Received {'type': 'auth', 'access_token':
Screenshot of problem:
Additional information: Also tried force stopping the application and relaunching it as well as the deleting all data / cache.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
The cannot connect pop-up only shows up when the frontend tells the app the connection was disconnected. It also disappears when the frontend tells the app the connection restored. This doesn’t appear to be an issue with the app. I suggest opening a frontend issue for this. If the app doesnt get a response from your server in 10 seconds it will also show the pop-up. Closing unless we can find an actual error from the app suggesting the issue is with the app.
I actually get a cannot connect pop-up. It pops up at the end of the loading process (so after around 10 seconds) and usually disappears immidiately / in an instant. Caputered it now with screen recording, the error message is: Unable to connect to Home Assistant - There was an error loading Home Assistant, please review the connection settings and try again.
Also was following the following thread since some of the error behaviour descriptions where similiar but couldn’t figure out a solution for me (e.g. I’m not using Nginx): https://community.home-assistant.io/t/android-app-unable-to-connect-to-home-assistant/158322/11