Looking for a working method of tracking devices for presence

A yes.
B not necessarily
C yes.

Thanks for the info and the quick reply, appreciated.

On point B are there many pitfalls? I’m guessing range is going to be a killer maybe?

I never thought detecting a person would be so hard :slight_smile:

Well this isn’t going well - seems I have no BlueTooth adapter in my HA server :frowning:

Can anyone recommend a BT dongle that will work?

Look up esp32 Bluetooth proxies. BLE is great when you need to position a station in space and it needs a BLE mesh to detect the beacons.

No it’s not simple. Not by a long shot, you will need to temper your expectations.

The ā€˜most accurate’ will be if you turn off the rotating ip addr for your access points for that phone and assign that unit a static ip. Most network gear will pick up immediately and you’ll have a lag of detection for disconnecting by about 5-15 minutes depending on your gear.

Everything else is just adding to that signal you seem to be bouncing back and forth trying to find ā€˜perfect’ sorry doesn’t exist. You’ll be looking for ā€˜good enough’

Ok, i’ll take ā€œgood enoughā€ :slight_smile:

So i need to run an ESP32 as proxy and not plug in a BT dongle?

I don’t have access points, just the main router which covers my area pretty well.

Any further help much appreciated - you can tell i’m stabbing in the dark here lol

Yes you are.

You need to first start by stating what is acceptable. What you do or do not have available and what is allowed. (it’s a girlfriend and I can’t install software on her phone. Or it’s my kid and I’m being draconian they do what I say)

You want what kind of presence - just home not home or room by room.

Do you have control of the phone. Can you install anything. What exactly is your network gear etc (yes I know it’s up there hear me out)

Reason.

People don’t like to be tracked. Vendors spent a lot of time making sure people can’t be tracked. You’re fighting THAT

THE #1 Defense for an iPhone and android device is rotating Mac addresses for Bluetooth and wifi (sound familiar?) each keeps a library of 10-12 macs and rotates through. To combat that you can. Turn off the rotating key (my preference if I have control over it) by telling the wifi setting for your network on that device to not mask your ip then assign a static to that endpoint. Your home and away are now at the mercy of how well that works. Either look at your router integration to tell you (unifi does this natively(or setup a ping integration to ping that endpoint. That’s your starter device. If you can add companion app that’s another signal. BLE yet another.

Based on your stated issue above I’m turning off the rotating ip addr and tracking the node on my network.

WOW, I will admit that I’m almost at the ā€˜give up’ point on this really, its just looking messy at present TBH.

My setup - one AX1500 router, phones a mix of Apple/Android. No possibility to install any app on any phone apart from mine sadly. I can assign static IP’s of course, on my router. I could likely tweak the network settigs on the phones if it only related to my network?

My goal is purely for home presence, not tracking and not room by room, just the home area in general.

Yes it’s in where you setup wifi for that phone to connect to your wifi.

I have three networks one is guest if any ip address is assigned off that network I send a guest signal high which also sets presence for a ā€˜guest’ person in HA (makes the zone math work, any guest connects to wifi effectively throws my home into guest mode)

For friends I tell them to connect to a specific network and I set It up for them and turn off the rotating privacy for that network. I also show them what I’m doing and why << this gives me thier ip on my network… This is the tracking item.

My wife and kids I - pwn the device. I know what room it’s in via BLE on top of everything else. (so all that plus the BLE Bluetooth proxies probably two ish per room)

Thanks again.

I have turned off rotating MAC on my phone, reconnected it and given it a static IP. I deleted the tracker in HA and reassigned it, all working again for my phone.

I will try the others as and when they visit - this should be ok and as you did, will walk them through the minor tweak needed, transparency is good here.

If that works I can leave it there, if I need more layers/stability I will look deeper into BLE - I will have some ESP32 by then, good to have in the toolbox I think.

I’ll let the dust settle and check if my phone drops out when on a non-cellular call tomorrow as I get at least one every day from my partner when on lunch :slight_smile: If it does then that will denote another, backup layer needed I guess?

Yep. Mine is the IP address tracker covers my wife’s phone when the phone itself decides to place her GPS down the street for a few seconds randomly. I treat each as unreliable on its own and try to stack signals.

So the presence based stuff I do takes that into account.

NOTHING triggers on immediate state change. (stays x for y is yojr friend here you can debounce most noisy or flappy sensors)

Everything has a cancel or revert mechanism.
(the auto away sequence sends an actionable notification to the admin devices group)

I’ve thought about doing it dungeon crawler Ai style…
New achievement! The house thinks you’re gone, or dead… And is going to set away in 2 minutes unless you hit that button I sent you… The one right there that says cancel… Pfft. HUMANS. Reward? You don’t get one! You’re not here to get it!)

Nice, I think the iPhone_Detect integration uses mDNS broadcast tracking/pinging or something like that, it was supposed to get round changing IP’s I recall.

Anyway it’s working for one phone at present and will get more on as and when, thanks for the help.

This statement is not correct. Yes it uses mDNS. However you still need to have one fixed IP per phone. See my comment above from the other day.

mDNS does not mean you can get around IP changes.

Ok thanks for the reminder, it does seem to work so thats something at least :slight_smile:

Can an ESP32 running as a BLE proxy/hub also run a DHT22 temp/humid sensor as well??

I have some of these running on ESP8266 but could replace if it means I can build a BLE mesh type setup. Just thoughts for future use thats all…

In short, Yes.

As regards my ā€œbeing at homeā€, if I have tracking via iPhone_detect and on my companion app, location sensors>background location & Location Zone enabled, does HA use that information to back-up my device location or not??

TBH i’m not really sure what having those sensors turned on on my phone actually do - any help here?

So far the iPhone_detect seems to be functioning well.

Yes. home/not_home is derived from is this tracked person in the home zone.

That is true if any of the device tracker entities registered to person.* is in zone.home.

So if you have three different trackers any one of them can say ā€œDave’s here!ā€

It takes all of them simultaneously not reporting in zone to get ā€œDave’s not here, manā€¦ā€

(yeah couldn’t help it.)

Real effect. You leave - you’ll remain ā€˜in’ zone home until your device tracker with the longest release time releases. (so can be good or bad depending on what you want, more reliability in zone or faster out…). Come home, the first tracker to switch puts you ā€˜home’

Thats great, thanks.

Am i right that if i wanted to disable this location tracker, I just turn off background location and location zone in the mobile app?

Does location zone work independently of background location? I think it does but thought i’d ask as i need to reduce battery consumption and i only need to track when i reach the ā€˜home’ zone.

The Person integration docs starts with a description of how different device tracker types effect the person’s state and the order of precedence they are given.

Also, see the companion app docs on iOS location tracking.

Hi again,

still messing with bolstering my tracking; today I was home alone, in the garden and after a while the house shut down and marked me as not home.

Clearly not good but if I have a zone setup, zone.location turned on in my companion app and the phone-detect integration running, is it plausible that both the GPS and the WiFi tracker flipped out for long enough to trip the person/home setting??

Not sure if i need to set a bigger zone area in zones or try something different ??Maybe something like only allowing lock-down if the front door was opened & closed within a certain period (it has a sensor already)

Apart from today, the person/home setup has been very good but this shows me I need to do some further work i think.

Any suggestions??