Force updates for app sensors

if you still have a need to force updates please submit a feature request on github and we can make it a notification command.

Xiaomi Mi 9T with stock MIUI 12 (Android 11).

Here the logs with the update from the sensor worker. It took 20 minutes to update.

It doesn’t seem to get the intent.

What sensors do you have enabled?

1 Like

Battery, loading, Bluetooth connections, WiFi BSSID, position, background position, zone
(freely translated)

Try to enable all the wifi sensors then turn wifi on and off let’s see if that works. On my pixel it works well and even detects bssid changes.

1 Like

No luck.
I suppose Pixels don’t have major issues with limiting background processes…

Try these steps let’s make sure it’s not bad data or anything.

no need for feature request, here is the PR: Add notification command to update sensors by dshokouhi · Pull Request #2194 · home-assistant/android · GitHub

1 Like

Did a fresh start - didn’t help. Also tried tons of other things, it won’t work.
Thanks a lot for trying to help me, I really appreciate it.
Looking forward to get the PR on my phone, I bet there are also use cases for a lot of other people.
SInce I’m having other issues as well, I’ll probably flash it with a custom ROM.

Can you do me a favor and check that the following Developer Option on your phone is enabled? It may help here. Its called “Mobile data always active” see if that helps when you enable it (assuming its disabled)

Unfortunately it doesn’t help.
I also did a factory reset meanwhile - also no luck.

The latest beta on GitHub has additional logging to print the intent as the app receives it. If you could get the logs when that happens it should tell us if the app is getting the intent or not.

It isn’t getting the intent. I only see SCREEN_OFF and SCREEN_ON intents in the logs.

Good news: The new command_update_sensors works perfectly. Thanks.

strange, this intent has been around since API level 1…why would they change that :confused:

We can try adding this intent and linking it to the Wifi State sensor to see if that helps the situation

PR adding this intent, doubtful it works but who knows :slight_smile: Add an intent for the wifi state sensor by dshokouhi · Pull Request #2219 · home-assistant/android · GitHub

1 Like

Tested the new release - unfortunately same result :frowning:
I also did some further testing with several sensors. It seems everything is working including Bluetooth (intents are being logged), just not the WiFi sensors.

Thank you so much for your support.
For my use case the new update command is working fine :+1:

And this is why I only use pixels, works as expected according to the documentation lol

May I ask where to add “command_update_sensors”

1 Like

In the notification message:

I’m curious about whether this same command can be added for iOS. I found this page today for exactly the same issue but on an old iPad that I’m using for my HA panel not updating sensors. I need to do some experiments to see if I can figure out a way to get it to just update more often on its own but a way to trigger it via an automation would be really helpful.