I’ve just installed a wifi mesh network in my house (Tenda MW6 3pack) and I have some problem with the companion app updating a wrong location.
When I am connected to the main access point, I am located in France (where I live). When I am connected to the second access point, I am located in Russia…
I guess that the companion app retrieves the BSSID and looks in a public database to determine my location. What can I do to make the app understand that I’m home ?
The companion app uses google play services which uses a combination of wifi and cell towers along with GPS. If you check the device logs you will see the location decision making process. All location updates are provided by google and we just process them and send the latest data. If google sends us realistic data that is incorrect then its possible. I would check the device logs to see whats going on:
Thanks @dshokouhi. The location process is clearer now.
Some people encountered the same problem while moving their router to a new home. The only solution seems to be playing with GPS and Wifi until Google Play Services correct themselves.
If I were you I would actually start with the device logs in the first link after step 6 and look at the reported accuracy when you are at home compared to Russia and see if you can adjust your accuracy setting for it. You might be able to find a way to get rid of them if the accuracy is no where near the same as at home.
I am using Logcat Reader as advised in the docs, I granted permissions with adb shell pm grant com.dp.logcatapp android.permission.READ_LOGS
but I can’t get more details.
Now you need to add a filter in logcat reader for the Tag you use LocBroadcastReceiver and that will show all the location requests and when we send them. This info is part of the location troubleshooting section just above the section you linked to
Thanks @dshokouhi ! You will find above some logs.
I replaced my reals cords by XX, YY.
[03-27 06:20:32.625 11016:11016 D/LocBroadcastReceiver]
Last Location:
Coords:(XX, YY)
Accuracy: 200.0
Bearing: 0.0
[03-27 06:20:32.625 11016:11016 D/LocBroadcastReceiver]
Begin evaluating if location update should be skipped
[03-27 06:20:32.625 11016:11016 D/LocBroadcastReceiver]
Received location that is 27 milliseconds old, 1616822432598 compared to 1616822432625 with source fused
[03-27 06:20:32.625 11016:11016 D/LocBroadcastReceiver]
Duplicate location received, not sending to HA
[03-27 07:05:06.762 11016:11016 D/LocBroadcastReceiver]
Received location update.
[03-27 07:05:06.775 11016:11016 D/LocBroadcastReceiver]
Last Location:
Coords:(51.1968757, 58.2873333)
Accuracy: 180.0
Bearing: 0.0
[03-27 07:05:06.775 11016:11016 D/LocBroadcastReceiver]
Begin evaluating if location update should be skipped
[03-27 07:05:06.775 11016:11016 D/LocBroadcastReceiver]
Received location that is 105650 milliseconds old, 1616825001125 compared to 1616825106775 with source fused
[03-27 07:05:06.849 11016:11071 D/LocBroadcastReceiver]
Location update sent successfully
[03-27 07:06:10.774 11016:11016 D/LocBroadcastReceiver]
Received location update.
[03-28 09:34:33.491 11016:11016 D/LocBroadcastReceiver]
Event sent to Home Assistant
[03-28 09:34:33.497 11016:11016 D/LocBroadcastReceiver]
Last Location:
Coords:(51.1968752, 58.2873349)
Accuracy: 20.0
Bearing: 0.0
[03-28 09:34:33.498 11016:11016 D/LocBroadcastReceiver]
Begin evaluating if location update should be skipped
[03-28 09:34:33.498 11016:11016 D/LocBroadcastReceiver]
Received location that is 19232 milliseconds old, 1616916854266 compared to 1616916873498 with source fused
[03-28 09:34:33.498 11016:11016 D/LocBroadcastReceiver]
Duplicate location received, not sending to HA
[03-28 09:36:01.540 11016:11016 D/LocBroadcastReceiver]
Received location update.
[03-28 09:36:01.550 11016:11016 D/LocBroadcastReceiver]
Last Location:
Coords:(XX, YY)
Accuracy: 68.4
Bearing: 0.0
[03-28 09:36:01.550 11016:11016 D/LocBroadcastReceiver]
Begin evaluating if location update should be skipped
[03-28 09:36:01.550 11016:11016 D/LocBroadcastReceiver]
Received location that is 1925 milliseconds old, 1616916959625 compared to 1616916961550 with source fused
[03-28 09:36:01.598 11016:12652 D/LocBroadcastReceiver]
Location update sent successfully
I can be localized in Russia with accuracies from 20 to 180. So I can’t use “Minimum Accuracy” setting to avoid errors.