Followed the steps exactly as you mentioned, results are still the same. Did only as “Trusted networks” and then using the only user I have - legacy user.
So, when I login from the computer, the “Auth” value of the flow changes, here are the request for .148:
2022-01-22 13:04:46 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/providers to 192.168.1.148 (auth: False)
2022-01-22 13:04:46 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow to 192.168.1.148 (auth: False)
2022-01-22 13:04:48 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow/07a93f27d6e5428da4172b217b6e2622 to 192.168.1.148 (auth: False)
2022-01-22 13:04:48 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow to 192.168.1.148 (auth: False)
2022-01-22 13:04:50 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow/10a17f352f4048b89715432cc20b5fb3 to 192.168.1.148 (auth: False)
2022-01-22 13:04:50 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.1.148 (auth: False)
2022-01-22 13:04:50 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.1.148 (auth: False)
2022-01-22 13:04:50 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 192.168.1.148 for /api/config/config_entries/entry using bearer token
2022-01-22 13:04:50 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/entry to 192.168.1.148 (auth: True)
2022-01-22 13:04:51 DEBUG (SyncWorker_1) [homeassistant.helpers.storage] Writing data for auth to /config/.storage/auth
2022-01-22 13:04:53 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 192.168.1.148 for /api/config/config_entries/entry using bearer token
2022-01-22 13:04:53 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/entry to 192.168.1.148 (auth: True)
When logging in the App, using the local IP as host with port 8124, the App never manages to get “Auth: True”, even after the “authenticated IP for …” line:
2022-01-22 13:06:00 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/providers to 192.168.1.226 (auth: False)
2022-01-22 13:06:00 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow to 192.168.1.226 (auth: False)
2022-01-22 13:06:03 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow/a3548c82d754466181f7eab12b72f32b to 192.168.1.226 (auth: False)
2022-01-22 13:06:03 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow to 192.168.1.226 (auth: False)
2022-01-22 13:06:04 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow/17d875981f8447c28cdc15966a02543e to 192.168.1.226 (auth: False)
2022-01-22 13:06:11 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.1.226 (auth: False)
2022-01-22 13:06:11 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 192.168.1.226 for /api/mobile_app/registrations using bearer token
2022-01-22 13:06:12 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.1.226 (auth: False)
2022-01-22 13:06:12 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.1.226 (auth: False)
2022-01-22 13:06:12 DEBUG (SyncWorker_3) [homeassistant.helpers.storage] Writing data for auth to /config/.storage/auth
And here are the logs of the App for the setup flow:
01-22 13:06:10.820 9572 9572 D UrlRepository: localUrl is: false and usesInternalSsid is: false
01-22 13:06:10.824 9572 9572 D UrlRepository: localUrl is: false and usesInternalSsid is: false
01-22 13:06:10.824 9572 9572 D UrlRepository: Using external URL
01-22 13:06:10.904 9572 9572 D UrlRepository: localUrl is: false and usesInternalSsid is: false
01-22 13:06:10.904 9572 9572 D UrlRepository: Using external URL
01-22 13:06:10.905 9572 9572 D UrlRepository: localUrl is: false and usesInternalSsid is: false
01-22 13:06:10.905 9572 9572 D UrlRepository: Using external URL
01-22 13:06:10.960 9572 9572 E IntegrationRepository: Unable to register device
01-22 13:06:10.960 9572 9572 E IntegrationRepository: retrofit2.HttpException: HTTP 404 Not Found
01-22 13:06:10.960 9572 9572 E IntegrationRepository: at retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)
01-22 13:06:10.960 9572 9572 E IntegrationRepository: at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
01-22 13:06:10.960 9572 9572 E IntegrationRepository: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
01-22 13:06:10.960 9572 9572 E IntegrationRepository: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-22 13:06:10.960 9572 9572 E IntegrationRepository: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-22 13:06:10.960 9572 9572 E IntegrationRepository: at java.lang.Thread.run(Thread.java:920)
01-22 13:06:11.016 9572 9572 D RenderScript HIDL Adaptation: IRenderScriptDevice::getService()
01-22 13:06:11.017 9572 9572 D RenderScript HIDL Adaptation: IRenderScriptDevice::getService() returned 0x0
01-22 13:06:11.017 9572 9572 D RenderScript HIDL Adaptation: Using Fallback Path.
01-22 13:06:11.027 9572 9572 D mpanion.androi: Successfully queried cache dir: /data/user_de/0/io.homeassistant.companion.android/code_cache
01-22 13:06:11.027 9572 9572 D RenderScript: Setting cache dir: /data/user_de/0/io.homeassistant.companion.android/code_cache
01-22 13:06:11.031 9572 9572 I System.out: recordForce value 6
01-22 13:06:11.032 9572 9572 D WebviewActivity: Current webview package com.google.android.webview and version 97.0.4692.98
01-22 13:06:11.107 9572 9613 D SensorWorker: Updating all Sensors.
01-22 13:06:11.110 9572 9637 I WM-Processor: Moving WorkSpec (63556e60-855e-4a4f-8576-a4ef7b60e772) to the foreground
01-22 13:06:11.119 9572 9613 W SensorReceiver: Device not registered, skipping sensor update/registration
This is bypassing any proxy or anything, hitting the local IP where HA runs with the Docker host network adapter.
The “Unable to register device” line logged above seems to come from this line.
The device registration attempt seems to fail, but the login works. Using the computer I can see my user has a new token from the Pixel phone:
Refresh token for Home Assistant Android - Home Assistant
Created 40 seconds ago
Last used 40 seconds ago from 192.168.1.226
At this stage I wanted to try the register device API by myself so started to look for the documentation. I found the “mobile_app” resource does not exist. Kept reading till I found this snippet
Home Assistant has a
mobile_app
component that allows applications to register themselves and interact with the instance. This is a generic component to handle most common mobile application tasks. This component is extendable with custom interactions if your app needs more types of interactions than are offered by this component.
Added mobile_app:
as a single line to HA configuration file, retried the flow and got connected. The application does not ask for the instance URL anymore, and the mobile integration appeared in HA.
Solution: ensure you have enabled the mobile_app integration in your configuration file.