Wifi mesh and wrong location from companion app

Hi,

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 ?

Thanks

I’m quite sure that is not how the app works.
More likely your phone looses GPS and it by some reason believes it’s in Russia.

What if you move the second access point outside or something so that you for sure have a good GPS signal?

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:

https://companion.home-assistant.io/docs/troubleshooting/faqs/#location-is-not-updating-in-android-app

You should also look at the accuracy settings and see if they need to be adjusted based on the results from the logs: Location | Home Assistant Companion Docs

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 was home (France) from 18:53:13 on march 24th to march 25th. The problem is that I was in Russia from 19:01:48PM to 19:01:50.

This is the logtrace.

[03-24 19:00:10.446 1573:1620 W/ProcessStats]
Tracking association SourceState{1bd8ebc io.homeassistant.companion.android/10262 Top #619088} whose proc state 1 is better than process ProcessState{94d164f com.google.android.gms/10179 pkg=com.google.android.gms} proc state 5 (7 skipped)

[03-24 19:00:25.355 1573:2452 W/ProcessStats]
Tracking association SourceState{1bd8ebc io.homeassistant.companion.android/10262 Top #619143} whose proc state 1 is better than process ProcessState{94d164f com.google.android.gms/10179 pkg=com.google.android.gms} proc state 5 (16 skipped)

[03-24 19:00:39.288 1573:4095 W/ProcessStats]
Tracking association SourceState{1bd8ebc io.homeassistant.companion.android/10262 Top #619212} whose proc state 1 is better than process ProcessState{94d164f com.google.android.gms/10179 pkg=com.google.android.gms} proc state 5 (10 skipped)

[03-24 19:00:55.882 1573:1620 W/ProcessStats]
Tracking association SourceState{1bd8ebc io.homeassistant.companion.android/10262 Top #619231} whose proc state 1 is better than process ProcessState{94d164f com.google.android.gms/10179 pkg=com.google.android.gms} proc state 5 (10 skipped)

[03-24 19:01:10.926 1573:1620 W/ProcessStats]
Tracking association SourceState{1bd8ebc io.homeassistant.companion.android/10262 Top #619250} whose proc state 1 is better than process ProcessState{94d164f com.google.android.gms/10179 pkg=com.google.android.gms} proc state 5 (10 skipped)

[03-24 19:01:25.044 1573:1573 W/ProcessStats]
Tracking association SourceState{1bd8ebc io.homeassistant.companion.android/10262 Top #619259} whose proc state 1 is better than process ProcessState{94d164f com.google.android.gms/10179 pkg=com.google.android.gms} proc state 5 (6 skipped)

[03-24 19:01:25.405 1573:1994 D/ConnectivityService]
requestNetwork for uid/pid:10262/27925 NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ]

[03-24 19:01:25.407 1573:2055 D/WifiNetworkFactory]
got request NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:01:25.407 1573:2055 D/UntrustedWifiNetworkFactory]
got request NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:01:25.407 1573:2098 D/WIFI_AWARE_FACTORY]
got request NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:01:25.407 1573:2099 D/Ethernet]
got request NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:01:25.436 27925:27925 I/WM-SystemFgDispatcher]
Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }

[03-24 19:01:25.441 2431:2431 D/PhoneSwitcherNetworkRequstListener]
got request NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:01:25.568 27925:28041 I/WM-WorkerWrapper]
Worker result SUCCESS for Work [ id=e48f671f-2753-4a63-857e-e8642c9a6c2b, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]

[03-24 19:01:25.576 1573:2062 D/ConnectivityService]
releasing NetworkRequest [ TRACK_DEFAULT id=1460, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] (release request)

[03-24 19:02:02.069 1573:4161 D/ConnectivityService]
requestNetwork for uid/pid:10262/27925 NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ]

[03-24 19:02:02.070 1573:2055 D/WifiNetworkFactory]
got request NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:02:02.070 1573:2055 D/UntrustedWifiNetworkFactory]
got request NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:02:02.070 1573:2099 D/Ethernet]
got request NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:02:02.070 1573:2098 D/WIFI_AWARE_FACTORY]
got request NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:02:02.071 2431:2431 D/PhoneSwitcherNetworkRequstListener]
got request NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] with score 60 and providerId 5

[03-24 19:02:02.093 27925:27925 I/WM-SystemFgDispatcher]
Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }

[03-24 19:02:02.097 1573:5617 W/ActivityManager]
Foreground service started from background can not have location/camera/microphone access: service io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService

[03-24 19:02:02.259 27925:27960 I/WM-WorkerWrapper]
Worker result SUCCESS for Work [ id=66777369-1c17-4072-9a68-6e65ccd6a124, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]

[03-24 19:02:02.277 1573:2062 D/ConnectivityService]
releasing NetworkRequest [ TRACK_DEFAULT id=1461, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10262 AdministratorUids: [] RequestorUid: 10262 RequestorPackageName: io.homeassistant.companion.android] ] (release request)

May I know what you think ?

these are incomplete logs, we need to see output like the example in the docs

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.

Sorry, but did I miss something ?

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

https://companion.home-assistant.io/docs/troubleshooting/faqs/#location-is-not-updating-in-android-app

Just below step 6 shows all the details for location specific troubleshooting

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.

The are real and valid location updates. Not much we can do. The timestamp from Google is recent.