Presence Detection Improvements

For many of us presence detection involves multiple methods working together. Some methods are more reliable when it says someone is home, than when it says someone is away. Because Iphone’s sleep, it has a tendency to give false away results. Own tracks is better, but sometimes it is a little slow telling me someone is home and when Nmap says your are home, you are probably really home.

Additionally when devices are in the zone named home, their icons do not show up in the map. In order to get around this, I use own tracks and have a zone named House that covers my house. My home zone is very small about 1m. This has the benefit of showing my icons for everyone who is home, but it means that HA almost never thinks anyone is home.


  • Fix it so home shows the icons for people that are in that zone.
  • If not #1, then make it so that multiple zones can be configured to be considered "home".
  • Allow multiple device trackers to an entity
    • Each person can be assigned on or more device_trackers to be queried to determine their location/status
    • Allow us to use a template to determine how we prioritize the information coming back from the individual device trackers when it conflicts with each other.
    • This should be at the device_tracker level, not at the platform (owntracks, nmap, etc) level.
    • proximity would use the results of where the person is, rather than a specific device tracker.
    This allows us to configure presence detection the way it works best for each person in our homes, since sometimes the same thing doesn't work best for everyone.
  • If I vote I lose some of my credits but I really like the idea.

    Yes I would love to see this. I use owntracks and NMAP right now. Owntracks is slow to update. Just tried out the Icloud component for today but it is killing my battery in my Iphone so fast.

    As far as I know you can already combine multiple trackers, e.g. Owntracks and nmap. But the last reported one counts, it does not combine or enhance. With sleeping phones nmap and ping checks are useless.

    When Nmap says you are home, you have responded to a ping of sorts. So Nmap is reliable when it says you are home. The problem is that when Nmap says you are away it could be because of a sleeping iPhone. So it’s not as reliable when it says you are away. However, if owntracks says you are away, you are probably away (unless Nmap says you are home). Rather that just believe the last one reporting, I would rather implement logic like this.

    if nmap_device_tracker==home:

    But maybe I’m using trackr instead of owntracks. Then I would want to be able to change out my configuration accordingly.

    Owntracks currently lets you integrate it in with Nmap like you said, but it’s only with Nmap. My idea is to move the integration out of the platform, and into the domain (I think I used the terms correctly there). This gives anyone the ability to use multiple trackers of any type supported by HA.

    I wonder if google maps can be used, they are enabling location sharing


    Using hping3 might be an option for iPhones

    The problem with the iPhones is that when they go to sleep, they do not respond to pings of any type. And the Iphones are just one of the symptoms. No one solution currently out there meets all of our needs in presence detection. My request is to give us more flexibility in configuring the multiple tools that we use when determining presence.

    Based on the article you posted, it could be nice. But in it’s current configuration, I don’t think google maps map location sharing would do us any good. It requires you do something on the phone every time the timer expires. I also wonder how much it chews up your battery if it reports you location continually. Then there is also the question of when the iPhone goes to sleep, it does not know it’s moving so you wouldn’t get any updates.

    The iPhone sleep problem is the downfall to most of the app based and ping based (like nMap) presence detection tools. When the iPhone goes to sleep, the smart phone becomes very dumb, and it’s a sound sleeper (meaning it doesn’t wakeup unless it has to).

    Sounds like location can be shared indefinitely, so manual intervention may not be required. Personally I’m picking up my phone vey often so if it’s pinging the sever every time I might be ok :ok_hand:

    We use iCloud for all our iPhones, and Unifi for guests. It works really well, Pretty much when i have parked my car it says “You are home”, sometime it takes a couple of mins to go “Away” but thats not really a problem for us.

    It looks like it can be shared indefinitely, but again I have to wonder what that is going to do to battery life. It also doesn’t address the iPhone sleeping problem. It might work great for you. Put in a request to have someone add it to HA and give it a try. Right now with the tools available to us, I stand by my request.

    Yea, but iCloud kills our battery which makes it unusable for many of us.

    I have not been able to test this extensively, but using hping3 is suggested as a (the only) solution to ‘wake’ your iPhone.

    Interesting approach. how are you dealing with it when Apple changes the mac address of the iPhone. They started doing that a while back as a privacy issue? It caught me again today. I have reserved IP addresses in my DHCP pool for my iPhones. Today they started getting other addresses from the pool and when I investigated, they had new mac addresses.

    Some other improvements I was looking for. As I am using the unifi device tracker it would be nice to recognize which lan/SSID the device is using. This way I can identify guests and send myself a notification if a new guest has been identified. Or have a list of active guests at this moment.