Presence and absence tracking isn’t working

We’re a two-person household.

I’ve set up a few automations that check whether there’s still someone at home or not.

Both of us are tracked via our mobiles: both via Wi-Fi and via the Smart Home app.

We both have a Samsung Galaxy S22 (I have the Ultra).

The GPS update isn’t working for my wife. Her mobile is always shown as being at home, even though the app displays the correct location data. It’s as if the data isn’t being sent to the server.

I’ve compared the settings on both apps. They’re exactly the same.

It’s driving me to despair. I’ve also tried using AI. Tried 100 different things. Nothing worked.

Does anyone have any other ideas?

Thanks.

Is she logged into the app on another device like IPAD or tablet? That may be making it look like she is still home.

She is looged in like me on the App only on the mobile.

I'm seeing something similar with iOS on 4 different phones

What are you using to determine that her presence "isn't working"? What entity?

Below is the correct way to set it up - and test it - and it works flawlessly.

Use this combo for each person (you need at least one of each type, all assigned to the person, to guarantee that it is 100% accurate - as long as the person never leave's their phone home!):

  1. GPS
  2. Router
  3. BLE

It takes about 15 minutes of not being home for all three of them finally switch to the phone not being there which is fine with me, my main issue was getting it to trigger as being home the second we arrive. Also, you would prefer to make it HARDER to say you are not home and not do so unless you are ABSOLUTELY SURE. Example: when perfecting this, as it was not working on our phones 100%, my wife's phone would show as not home when she was home, so when I left the home, things would turn off while she is still there! So, for safety reasons, it really is more important to have 100% accuracy about not being home but much more important to have you show as home the second you get there. There is a certain length of time that your router will take to decide your phone is no longer on the network and that varies by router manufacturer how long that is (I have Omada equipment and have found that it takes almost exactly 15 minutes). Only after all 3 show as not home then that person entity is shown as not home - because you want to be 100% sure they are not there. The above works flawlessly (but never for immedately after leaving, as per above, but always becomes correct, 100% of the time - and for returning, it is instant). This is the way! Example:

Notes:

The above is how my wife's location (home vs. not home) is tracked.

The above picture shows two "router" items. That is because I have two ways of tracking wifi connectivity to my wife's phone, both the regular router connectivity and then also as separate HACS integration for our Omada router. That is complete overkill, you only need one of the 'router' types.

Follow this paradigm and it will work perfectly. HA does do all the calculations for me using it this way and it does it very well. IMPORANT NOTES:

  1. The BLE (Bluetooth Low Energy) IRK (Identity Resolving Key) I am using is the actual unique number on the phone. Therefore bluetooth needs to stay on, on the phone (unless you have a different BLE device on a keychain or the same). There are instructions for how to do this on the forums. You need at least one BLE sensor in your home that needs to act as a BLE gateway between HA and your phone. I have Shelly relays all over the place in my home so the gen2+ versions of those devices can also act as BLE gateways (so I only had to switch that feature on, but there are other ways of doing it, many HA sensors can also act as BLE gateways). Here are the exact instructions to get the IRK for any phone (you must follow the instructions to the letter and once you have the IRK for a device keep it stored somewhere because that is not only not easy to get but also never changes for the lifetime of your device). There are other ways but I have found this consistently is the easieest way for both an iphone and android of different versions - the section here that is entitled "On Windows - for any devices that will connect to a computer". There are other ways, all involved and many do not even work, but I have found this the easiest and most reliable.

  2. IP address for the phone on the local network MUST BE static. To do so and make it work 100% properly, turn off anonymized mac addresses (in the phone wifi settings for the yoiur home network wifi connection) because most routers assign IP based upon Mac address of the device as the unique identifier for every device. If the phone in it's wifi network settings has an anonymized (or changing) mac address (supposedly a helpful security feature but no big deal to turn off as it is specified individually by wifi network and you trust your home network don't you?!), then the router will not be able to assign it the same IP address each time your phone reconnects to the network (because the router does not 'understand' it is the same device and gives it a new different IP address - as it sees every mac id or mac address as a unique device).

  3. HA must be installed on each phone with full access rights (location etc.). Annoyingly, apple will very often re-ask the user to verify they want the HA app (or any other app for that matter) to continue to have full location reporting access. This does not happen with android. If the owner of the phone is a non-technical person, then just explain it is needed to ensure the house alarm functions properly (or some other related valid reason simple for in layman's terms - we also use our phones and HA to control a very robust alarm system).

  4. GPS must always be turned on for the phone as well. Note that sometimes other apps on the phone might turn off the GPS.

This is the way.

For testing I set up some dashboards that I used in the past, for example for the same phone above, I have:

The one in the red rectangle is a combination of the others, as shown in the first picture, and is the sensor you use to act upon her being home or not home.

Once you have something like the above dashboard for testing, it's a simple thing to get in the car with your phone and drive 5 minutes away and just wait to test it, verify that once they all change to "not home" that the person changes to "not home", then go back home and see how quickly one of those sensor changes to make the person sensor also immediately say you are home. As mentioned before it is designed such that the person is considered not home only after ALL of the person related sensors have changed to not home, and then when you arrive back home as soon as any one of them changes to you being home then the person sensor will see you as home. Hope this helps, here is the source code for that dashboard card above for testing (note I renamed all the sensors that were working for each to a name that made sense once I dug up which were which). It's alittle bit of an excercise to update all of this when either of us gets a new phone! Note in the source code the above card is also using card-mod to make the text smaller so it is more convenient on a cell phone display, you can just remove that "card_mod:" section from the source code if you don't want to install card-mod... Note - I just changed this source code here, I now use "last_updated", not "last_changed" - for instance the GPS may be updated hundreds of times while the person is home all day, you want to know the last time it was updated (you could use both if you wanted....)

type: markdown
content: >
  {% set sensor_issues = states
     | selectattr('entity_id', 'search','person.cathy_ludington|cathy_s_iphone_17_pro_gps|cathy_s_iphone_17_pro_ble|cathy_s_iphone_17_pro_official_router|cathy_s_iphone_17_pro_hacs_router')
     | rejectattr('entity_id','search', 'cathy_s_iphone_17_pro_ble_estimated_broadcast_interval|cathy_s_iphone_17_pro_ble_signal_strength|cathy_s_iphone_17_pro_official_router_reconnect|cathy_s_iphone_17_pro_ble_estimated_distance|cathy_s_iphone_17_pro_ble_power')
     | sort(attribute='last_updated', reverse=true)
     | list %}
  {% if sensor_issues | length > 0 %} {% for s in sensor_issues %} {{
  as_local(s.last_updated).strftime('%m/%d @%I:%M:%S %p') }}, {{ s.state }}:

  {{ s.entity_id }}


  {% endfor %} {% else %} Nothing to see here, there is nobody home (this is
  actually never shown lol)! {% endif %}
title: 👩🏻 Cathy - Location Sensors
card_mod:
  style: |
    ha-card {
      font-size: 12px;
    }
    ha-markdown {
      line-height: 1.25 !important;
    }
    ha-markdown p {
      margin: 0px !important;
    }
    .motion-row {
      display: grid;
      grid-template-columns: 1fr auto;
      column-gap: 10px;
      margin: 2px 0;
    }

Hope that helps!

In return for my efforts above - can someone answer with a way to for me as HA admin to determine and get notified on my android phone if my wife's phone settings for the HA app' location tracking ability get turned off, or if GPS or Bluetooth are turned off? Because - Murphy's law - that DOES and WILL happen!???

I am using two identifiers:

  • device_tracker.sm_s9010 (GPS from the phone and sent by the HA App)
in_zones:
  - zone.home
source_type: gps
latitude: 47.3563149
longitude: 9.4273898
gps_accuracy: 16
altitude: 1125
course: 0
speed: 0
vertical_accuracy: 0
friendly_name: SM-S9010
  • device_tracker.s22_von_erika (from the Fritzbox)
in_zones: []
source_type: router
ip: 10.100.5.146
mac: BA:16:F2:F2:DA:3A
host_name: S22-von-Erika
last_time_reachable: "2026-06-10T07:39:56+00:00"
friendly_name: S22-von-Erika S22-von-Erika

Mine is configured exactly the same. Works perfectly.

And is the top device tracker changing state when she moves? What about the bottom one?

No. The GPS one is not working.
The router one is fine.

So does her phone know where she is when she is not at home?

Yes.
Is maybe activating background location an option? Mine was working without that.

Background location is necessary. It allows the app to be closed/off and track location. If you’re always on the app and it’s always working, that explains the difference. I’d be willing to bet your wife is like my wife, she never uses the app.

I alway thought you needed background location enabled for it to work if the app is not opened. I seem to remember some stuff about battery usage on Samsung phones, this could well be from years ago and now not irrelevant ,as its been years since I had a samsung phone.

My GPS location was working for years and now recently has been throwing GPS scatter outside the original 50m home zone. (Some change has happened)

My initial solution was to open up Google Maps on the phone which seemed to bring it back to my home zone. I found the geocoded location was positioned 350m away.

I have now increased my homezone to 380m which encapsulates the scatter seen in the below image.

Sensors Enabled though companion app settings

Geocoded Location

  • Sensor enabled
  • Update with location sensors ON
  • Minimum accuracy 200m

Background Location

  • High accuracy OFF
  • Minimum accuracy 200m
  • Location sent Exact

High accuracy mode

  • Sensor enabled

High accuracy update interval

  • Sensor disabled

Location Zone

  • Sensor enabled
  • Minimum accuracy 200m

Single Accurate Location

  • Sensor enabled
  • Include sensor in sensor update ON
  • Minimum accuracy 200m
  • Minimum time between updates 60000 milli seconds

Android settings for Companion App

Permissions

  • Location Allow all the time
  • Manage app if unused disabled

Battery usage

  • Allow background activity
  • disable any battery optimizations for the app

Has been working as it should now, I only use GPS position.

Could it be that the GPS gets stuck at home?

I’ve noticed that the update works much better when you’re not at home.

But when my wife drives away from home, the device stays stuck at home, even though she’s long since been somewhere else.

Is there anything I can do to help the device disconnect from home more easily?

Check the settings i posted above, the only other thing is open google maps.

You could try high accuracy mode and see what that does. I did try it and it posts a notification showing the actual location.

On my wife's phone everything is activated.
On mine not all of them. And it works.
My wife's location was again not updated for 18 hours.

You may need to replicate your settings on her phone, including the Android settings.

Does it rectify if you open Google Maps?

I just created a new integration to help people with this! Hot off the presses! Enjoy!

Have you setup a map dashboard with some tracking markers?