Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force Refresh for Android Auto #3830

Open
GSzabados opened this issue Aug 29, 2023 · 8 comments · May be fixed by #4845
Open

Force Refresh for Android Auto #3830

GSzabados opened this issue Aug 29, 2023 · 8 comments · May be fixed by #4845
Labels
Android Auto enhancement New feature or request

Comments

@GSzabados
Copy link

Is your feature request related to a problem? Please describe.

It has happened with me multiple times that the HA app couldn't connect to the server when the phone is connected to Android Auto. When this happens during opening the Android Auto HA app the only icon loaded is the Navigation one and nothing can be accessed. Leaving from the AA HA app and entering again changes nothing, the same screen stays on with only the Navigation icon. Even if trying to enter the Navigation it does nothing.
Unfortunately the only solution for me is to unplug the phone from AA and plug it back.

Describe the solution you'd like

It would make sense to add a last default icon to refresh the AA HA app, like the Android app offers a refresh option when cannot connect to the server.

Describe alternatives you've considered, if any

I don't have any alternative solution, how a refresh could be forced from the AA screen.

Additional context

@GSzabados GSzabados added the enhancement New feature or request label Aug 29, 2023
@dshokouhi
Copy link
Member

A refresh button wont work here as we are creating a subscription to get state updates. Maybe a good fix here is to move the lifecycle over to RESUMED instead of STARTED? 🤔

https://github.com/home-assistant/android/blob/master/app/src/main/java/io/homeassistant/companion/android/vehicle/MainVehicleScreen.kt#L62

https://github.com/home-assistant/android/blob/master/app/src/main/java/io/homeassistant/companion/android/vehicle/EntityGridVehicleScreen.kt#L78

@GSzabados
Copy link
Author

When exited an entered on AA all the listed entities are "refreshed" regarding last state change, etc.

But in this case when none of them listed, it does not load any, so your idea sounds good to me, but would that not put too much load on the solution as every time entering would do a new subscription?

The idea of doing this purposefully by a "force refresh" button would keep things simple, but as I understand the logic here is list according to the subscriptions which happens when entering to AA HA. Right? If, so, then your suggestion is good for me.

@dshokouhi
Copy link
Member

But in this case when none of them listed, it does not load any, so your idea sounds good to me, but would that not put too much load on the solution as every time entering would do a new subscription?

the subscription is attached to the screens lifecycle so it will stop when the app is not open, we need to make sure subscriptions stop appropriately otherwise they can run forever in teh background.

For reference our widgets that also update based on a state change have similar issue. Those subscriptions are managed by the screen turning on and off.

@dshokouhi
Copy link
Member

So it seems the lifecycle state is not completely what we need to do here. Reloading the entities also needs to happen so we need to rethink things a bit more and also consider the state the user is left in too. A refresh/retry button may be suitable and more expected as we cannot auto update as the subscription is not valid and we dont have any entities.

In the meantime you dont have to disconnect from thar car, force stopping HA from your phone and opening the app again is good enough to retrigger the process. Also switching servers can also help restart things if thats available to you.

@GSzabados
Copy link
Author

In the meantime you dont have to disconnect from thar car, force stopping HA from your phone and opening the app again is good enough to retrigger the process.

Actually that is what I am trying to avoid. Taking the phone and doing anything on it.

@mgbarton
Copy link

My Volvo XC40 has AAOS, and the HA app now appears in the Play store. I believe it suffers from this problem as well.

When the HA app is first launched it successfully loads all entities and their state. However if the infotainment system goes to sleep (i.e. I run into the grocery store), upon re-awakening HA does not refresh the state. The only solution I've found is to Force Quit the HA app. Upon re-launch it successfully loads all the current entities and their state.

A Refresh button is welcome, but HA should also refresh automatically whenever returning to the foreground - either from a dormant state or from other loss of connectivity.

@ingenika

This comment was marked as off-topic.

@dgomes
Copy link

dgomes commented Apr 29, 2024

I believe the issue is related to lost connectivity, it happens predictably in my car whenever it's in an underground garage and loses connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Auto enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants