[io.homeassistant.companion.android] Home-Assistant cannot access location update result
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 3.2k
- Avg merge
- 12d 11h
- Merged PRs (30d)
- 4
Description
Affected app
Name: Home-Assistant
Package id: io.homeassistant.companion.android
Describe the bug
Home-Assistant uses gms libraries to handle location updates coming via indent, but the gms library seems not to be able to parse microG's intents to extract the location information
To Reproduce
Steps to reproduce the behavior:
- Install Home-Assistant Companion App, connect to instance
- Enable the "Background Location" sensor in Companion App and further allow all location permission requests
- View in Home-Assistant that location never gets updated (see screenshot)
Expected behavior
Location should be sent to Home-Assistant instance after the intent was parsed correctly.
Screenshots
Screenshot of device_tracker / sensor in Home-Assistant web ui:

System
Android Version: 11
Custom ROM: LineageOS 18.1 with microg (18.1-20211021-microG-oneplus3)
microG
microG Core version: 0.2.22.212658
microG Self-Check results: All ticked
Additional context
I debugged the app in Android Studio and used logcat to determine the buggy code lines (hopefully the correct ones):
While debugging, I found out, that LocationResult.extractResult(intent) returns null and so subsequent ?. calls default to null. So I think, that LocationResult from gms cannot parse the intent given by microG.
See my issue report there: home-assistant/android#1833
Weird Good2Know
The author of the similar issue #1273 seems to have solved this issue by re-enabling the sensor, but further has problems with the geocoded location. On my device, geocoded location works just fine, but the real location does not even after re-installing the app and re-enabling the sensor multiple times.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced LocationSensorManager.kt lines 445-471 and inspect how LocationResult.extractResult(intent) handles the microG location intent. Compare this with the related Home Assistant issue and reproduce using the listed Android 11, LineageOS 18.1 with microG setup. Done means the background location update is parsed and reaches the Home Assistant instance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100