home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.07k stars 587 forks source link

Geocoded Location 'unknown' #4356

Closed kisjeth closed 3 weeks ago

kisjeth commented 3 weeks ago

Home Assistant Android app version(s): 2024.4.full Android version(s): 12 Device model(s): Poco X3 NFC Home Assistant version: 2024.4.3 Last working Home Assistant release (if known): 2024.4.3 Description of problem, include YAML if issue is related to notifications: When I am under the mobile data network, the geolocation is not updated, thus reporting an 'unknown' value, but if I connect the mobile phone to any wifi network, the sensor updates immediately. All necessary permits have been verified. On another Android device everything works normally.

Companion App Logs:

Screenshot or video of problem: Screenshot_2024-04-21-00-39-18-330_io homeassistant companion android

Additional information: As you can see from the attached photo, the positions update correctly even if on the data network, but the sensor does not report the right information. Screenshot_2024-04-20-18-05-44-257-edit_io homeassistant companion android

dshokouhi commented 3 weeks ago

the geocoded sensor is not linked to the device tracker, it uses a completely different API and you should not expect the same results. Please get us the companion app logs when the issue occurs, that might be of help. Also are there any attributes for the geocoded sensor when this issue occurs?

kisjeth commented 3 weeks ago

So: I searched the log for anything that could even vaguely refer to the problem, but I couldn't find anything.I searched for keywords like 'tracker', 'location', 'api', 'geocoded', but nothing came of it.All I had to do was move away from home without WiFi to see the location disappear. I do not know what to think.

kisjeth commented 3 weeks ago

Ok, This is quite strange: I returned home without having reactivated my wifi, yet now it marks my geolocation correctly.I'm starting to understand even less.

dshokouhi commented 3 weeks ago

More than likely it's working as expected. Unknown is a valid state.

https://github.com/home-assistant/android/blob/master/app/src/full/java/io/homeassistant/companion/android/sensors/GeocodeSensorManager.kt#L147

kisjeth commented 3 weeks ago

So how do you explain that my wife's phone shows the address correctly when mine, next to hers, shows the status 'unknown'. It had never happened before a few days ago

dshokouhi commented 3 weeks ago

So how do you explain that my wife's phone shows the address correctly when mine, next to hers, shows the status 'unknown'. It had never happened before a few days ago

different data will show up for different devices, you still did not provide logs nor answer if the sensor has other attributes. The data comes from the API which uses a Google service. Many reasons what the data it provides can be.

kisjeth commented 3 weeks ago

Undoubtedly different devices generate different data, but why until a week ago it generated data, while now it only generates a large sequence of 'unknown'?

dshokouhi commented 3 weeks ago

Undoubtedly different devices generate different data, but why until a week ago it generated data, while now it only generates a large sequence of 'unknown'?

we cant answer that until you get us the requested information

kisjeth commented 3 weeks ago

I think I figured out what the problem was: my phone. I did a factory reset and everything works now.

dshokouhi commented 3 weeks ago

Closing as per above comment, if you still encounter the issue please get us the companion app logs and also a screenshot of the sensor detail page showing the attributes and state of the sensor.