home-assistant / home-assistant/android

Location update is failing when coming out of high precision mode

Open
#7,349 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
3.9k
Forks
1.1k
Avg merge
1d 12h
Merged PRs (30d)
81

Description

**Home Assistant Android app version(s):**
2026.6.5-full

**Android version(s):**
17

**Device model(s):**
Pixel Pro 10

**Home Assistant version:**
2026.8.2

**Last working Home Assistant release (if known):**

**Description of problem, include YAML if issue is related to notifications:**

When the home assistant app on my phone is reporting location to home assistant, it fails to report the zone when switching from high precision mode to regular.

For example, say I'm traveling from far outside my home zone to my home. It works like this:

1. First, there are `state_changed` updates every 30 seconds because I am not in high precision area.
2. When I get into zone.home_expanded, the mobile app then sends `android.zone_entered` to home assistant.
3. Now home assistant receives `state_changed` messages much more frequently, about ever 3 seconds. They show that I am not in the home zone still.
4. Eventually, the mobile app sends `android.zone_entered` with zone `zone.home`, which is what I expect.
5. Immediately after, the mobile app send another `state_changed`. It has the same latitude and longitude as in step 4, which is good. But it **doesn't** say that I'm in the home zone! THIS IS THE BUG.
6. About 30 seconds later, the phone gets a `state_changed` that includes the new zone, `zone.home`.
7. All the future `state_changed` for location are correct.

So it seems like the very first location update after switching from high precision to regular has the wrong zone in it, even though the latitude and longitude are all correct. I'm able to reproduce this by using a GPS faker tool on my phone. I also see this problem just driving home with my phone.

I think that there is a bug in the code that is causing it to generate and send that `state_changed` with the old zone from before the `android.zone_entered`.

I will try to investigate this using some AI.

**Companion App Logs:**

```

```

**Screenshot or video of problem:**

**Additional information:**

Contributor guide

Open the contributing guide

Research direction

Reproduce the transition with a GPS faker and compare the android.zone_entered event with the immediately following state_changed update. Trace the location update flow responsible for those events and verify that the first regular-precision update uses the current zone; done means that update reports zone.home when its coordinates match the zone-entered event.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.