Confirmed that app has same issue, connecting to the websocket via the recommended Logcat.
I will need to reconfigure the setup to see what changed, because on HA version 2021.12.7 it worked just days ago. Something changed in HA core that is refusing now the proxied wss connection. but there are no logs. Can I see some debug on HA side why the conneciton was refused ? Cause nginx only has what the host respond.
Also the phone is on local network and for some reason is not using the local URL but the public one. That is a bug on Applicaiton side. If I reset the app and keep just lcoal URL it all works. It should not connect to public url in first place. (Even though I have DNS controlled via router to point to local IP since mine does not support NAT loopback)
This behavior also prompts the Android to redirect to Google Chrome browser upon app being opened. Weird. And yes I tried starting fresh it always works on local if I completely clear the app data, until I want to log outside of network on public domain. Then nothing works app can never detect local IP url any more.
Here is a dumb of app logs just for information:
2022-01-06 12:11:15.385 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.430 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.520 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.553 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.559 3343-3513/? E/SensorReceiver: Issue registering sensor: audio_sensor
2022-01-06 12:11:15.569 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.594 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.608 3343-3513/? E/SensorReceiver: Issue registering sensor: audio_mode
2022-01-06 12:11:15.670 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.698 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.704 3343-3513/? E/SensorReceiver: Issue registering sensor: battery_level
2022-01-06 12:11:15.718 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.748 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.761 3343-3513/? E/SensorReceiver: Issue registering sensor: battery_state
2022-01-06 12:11:15.772 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.801 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.811 3343-3513/? E/SensorReceiver: Issue registering sensor: is_charging
2022-01-06 12:11:15.826 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.871 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.884 3343-3513/? E/SensorReceiver: Issue registering sensor: charger_type
2022-01-06 12:11:15.897 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:15.941 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:15.954 3343-3513/? E/SensorReceiver: Issue registering sensor: battery_temperature
2022-01-06 12:11:16.020 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:16.093 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:16.106 3343-3513/? E/SensorReceiver: Issue registering sensor: dnd_sensor
2022-01-06 12:11:16.131 3343-19625/? E/WebSocketRepository: Websocket: onFailure
2022-01-06 12:11:16.165 3343-3513/? E/IntegrationRepository: Issue getting new version from core.
io.homeassistant.companion.android.common.data.authentication.AuthorizationException
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:181)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:19)
at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2022-01-06 12:11:16.173 3343-3513/? E/SensorReceiver: Issue registering sensor: geocoded_location