Handling GPS vs. Wi-Fi states separately for an apartment above a shopping mall (No Companion App)

Hello everyone,

I'm looking for some advice on how to optimize my presence detection for a specific living situation by separating GPS and Wi-Fi tracking.

My Setup: Right now, I am using HomeKit automations for basic presence tracking. When an iPhone arrives or leaves, HomeKit toggles an input_boolean switch for that person in Home Assistant. This part works perfectly. I am not using the official Home Assistant Companion App, and I do not want to install it (especially on my girlfriend’s phone) to keep things simple and native.

The Problem / My Living Situation: My apartment is located directly above a shopping mall. Because of this, my physical location remains inside the standard GPS Geofence even when I leave my apartment to spend time downstairs in the mall. If I go down to the mall, GPS still thinks I am "Home", but I am obviously not in my flat.

My Idea: Two Separate Entities Per Person To solve this, I am planning to track two distinct states per person instead of forcing everything into one single "person" entity:

  1. input_boolean.person_gps_home (via HomeKit geofence)
  2. binary_sensor.person_wifi_home (via local Ping/ICMP, with a 15-minute delay_off to bypass the iPhone's aggressive Wi-Fi deep sleep behavior).

How I want to use this logic:

  • Arriving Flat: As soon as the local Wi-Fi reconnects (on), I am back in the flat. (e.g., turning on welcome lights).
  • Leaving Flat (but staying in the mall): My iPhone drops off the Wi-Fi. After 15 minutes of Wi-Fi absence, HA should know I left the flat, even though the GPS Geofence still says I'm "Home". (e.g., ideal time to run the vacuum robot).
  • Leaving Area completely: Both Wi-Fi and GPS change to away. (e.g., turning down the heating).

My Questions to the Community:

  1. Does it make sense to keep these two entities separate for automations, or is anyone successfully merging a Wi-Fi state (with a 15-min delay) and a snappy GPS state into a single, reliable template binary sensor/person entity?
  2. If you keep them separate, what is your preferred way to structure the conditions in your automations (e.g., using Template Sensors, complex AND/OR blocks, or specific helper combinations)?
  3. For those without the Companion App: Is a 15-minute consideration time (delay_off) for local Ping tracking enough to counter the iPhone’s Wi-Fi sleep cycles, or would you recommend a different threshold?

Looking forward to your ideas and how you solved similar "mall/apartment" tracking challenges!

Thanks!

i use a combo of homekit presence and private BT. One or the other may miss occasionally, but I’ve never had both of them miss as at the same time and they are both snappy.

Are your GPS and BLE co-ordinates reported in two or three dimensions.

Your geofence may have to be a geocage and your code may have to be expanded to allow for threshold detection in the third dimension.

How to get a geocage instead of geofence? Any system which offers this out-of-the-box?

Latitude, longitude, and altitude/elevation are the three dimensions usually reported by GPS devices. Signal strength, sometimes by triangulation is usually the measure used by BlueTooth. Both methods can be used to put you into a three dimensional space location.
Most phones measure air pressure too, and altitude above sea level can be mathematically derived from those figures too.

I don't think GPS elevation will work accurately inside a reinforced concrete building.

A leaky Faraday Cage with openings to the outside world? Those receivers are immensely sensitive and the error correction code is insane.
Of course if you live in a war zone, all bets are off, unless you use an alternative to the American based GPS like most modern receivers and phones are capable of.
General observation: iPhones are the ones most often reported in these forums with poor location capabilities for HomeAssistant. Not sure where the bottleneck is, but the trend is noticeable.

In @mensa84 case, moving between floors in the building should be readily detectable with a change in atmospheric pressure far greater than passing weather, and may be the most effective detector, measuring a change over a short period consistent with taking the stairs or the lift/elevator to and from the apartment, within the latitude and longitude of the building perimeter to prevent false alarms when he visits other buildings. The Companion app may be the most effective way to relay that information to HomeAssistant, unless he wants more intrusive intervention for his girlfriend like a BLE tracker, ankle bracelet, an ever present camera for presence detection, or an obligatory NFC card swipe detection when entering and leaving the apartment.

This is the way to go. With BLE you can even get room presence if you want :slight_smile: