Looking for a working method of tracking devices for presence

Hi all,

I have been trying to use the TP-Link integration for my router to alert HA when my (and families) phones log on to the network, its for home presence detection as my setup is so that the home is pretty much disabled when I am not home.

It was working fine on my mobile (Pixel6) but as it cannot use the MAC address and most iPhones log in as plain “iPhone” it makes it pretty useless really for my needs.

Is there any sensible, workable presence detection out there I could use?

IP address is no good either as mobiles would be dynamic not static.

Thanks in advance

Have you tried renaming the device(s) in the companion app? I don’t use TP-Link but my household’s iphones have unique names and device tracking works perfectly via the Unifi integration.

That’s fixable though, you can set a static ip either on the router or the device itself?

There’s always the GPS tracking feature in the companion app aswell.

1 Like

Sadly they don’t (and probably wont) run the companion app :frowning:

I could assign a static IP but as yet I can’t see the IP address in the TP-Link integration, not saying its not there just i cant find it in Node-red yet.

It complicates things not being able to install the companion app. Of the top of my head some other possible solutions could be BLE tracking (you would need the IRK pr phone).
I haven’t tried pinging iphones, would a ping sensor work?

PS: They don’t need to actively use the companion app to have it integrated into HA.

You can ping i think but as the IP changes, its not much help I think.

If i get them to add the app, is it possible to lock it down so they have no control over the home devices unless I allow it etc???

I have the app of course and have full access naturally.

You could manually configure IPs on the devices or your router if you want to have static ips. No it is not possible to exclude users from accessing devices.

So we can’t control home-page access etc - maybe give them a blank home page ??

If so i’m pretty surprised at that really :frowning:

You can create blank dashboards, but that does not exclude users from accessing devices.

So i can create a blank page but cannot lock the user to that page only?

Seems a bit lax especially if we have a page of delicate settings or presets etc that we dont want users to play with??

Grab a cup of coffee RBAC - Role Based Access Control (Users & Groups rights) :slight_smile:

1 Like

I’ll read that, thanks

Just tried using the “Wifi connection” in HA app settings on my phone - it shows up nicely in node red with my network name but when turning off wifi on my phone it still showed the SSID even after a minute or more, should it disconnect??

Edit - been turned off over 5mins now and node red still shows the phone as connected so I don’t think this will help me at all.

As a little update, some reading turned up a HACS integration titled “iphonedetect” which seems to offer a possibility and although it states iphone in its title, it uses mDNS which is available on most phone os’ now so should be ok with my Android etc

When using iphonedetect, you do need to have a fixed IP, which would require a fixed mac address if DHCP.

An alternative option and something I’ve used before with success is the Traccar Client integration. As long as the phone has mobile service, download the Traccar Client app on the phone. The integration gives you a webhook URL to use in the app and voila! A decent device tracker ready to go.

I have read several solutions for this and I also tried many Solutions that never were satisfying, especially when you are “asking” people to set something up in settings that they never would do for themselves/never saw.
People will spin their eyes if you require them to traverse through 10 menupoints, resulting in a loss in “acceptance factor”.

Ping (mentioned by @Dave_K )
con:

  • Needs static IP, private IP disabled → if you change Wifi name or if something changes in the setup you need to reconfigure it always and people become annoyed (+ you)

Traccar (mentioned from @mmstano )
con:

  • Needs App
  • Needs Mobile Data
  • Drains battery if you want it to response fast
  • relies on GPS/Geofence

iphonedetect (mentioned from @k8gg )
Cant really tell but custom integrations are a pain in the butt sometimes

Imo this is the only reliable solution:
try using Private BLE Device - Home Assistant.
pro:

  • no app
  • works natively
  • works on any ble-device theoretically
  • higly responsible
  • can be extended with ble proxy
  • setup works via pairing → people know how to pair bluetooth and are less annoyed/spin their eyes less. → “oh yeah i know that”

How to:
0. Get a esp32 and install espresence

  1. Get IRK via Espresence → keep the espresence for future devices
  2. Copy IRK and use it in Private BLE Device - Home Assistant

IF you dont have bluetooth:

Get another esp32 and setup Bluetooth Proxy - ESPHome - Smart Home Made Simple

The BLE options sounds ok, can it be done with an ESP8266 as i have some of those??

Thanks

8266 is not compatible or lacks function for ble. just invest those 3-5€ :smiley:

1 Like

OK thanks :slight_smile:

Just a clarification:
For security reasons (specifically to thwart what you are doing - tracking - which can also be construed as stalking or privacy invasion if you don’t have permission) most modern phones have random MAC assignments as a default setting, to allocate a random MAC address each connection time.
This can be over-ridden to be static in the phone network settings - a one-off change, which then also gives you the added functionality of being able to consistently allocate a Static IP Address as well.
Your ultimate goal, to see when somebody is home or not, is frequently reported here in these forums as a problem using connection and disconnection flags from the router, and other methods and apps are often used instead.

1 Like