Combining trackers?

Hi All

I have installed the Home Assistant IOS app on all our phones
I have also enabled Unifi wlan tracking
I have also enabled ping to fixed IP adresses on all our phones
I have also enabled NMAP
I have also created Zones

UPDATE: Running HASSIO…

So how do I combine these to work together in the top ICON bar for my family users?
Currently I have one showing up as Home, by GPS? but I know that I am away also I am not on my WLAN…

So how do I prioritize these to get the best result?
Also I have the same naming for Host names and IOS names, this was done to have one user iscon on the top bar, I also deleted the LAN devise under known_devices and added the MAX adress to the primary users iPhone in known_devices

I thought that Home Assistant would take all these tracking information and value them internally?

Best regards
Casperse

I believe they all have to have the same mac address for them to be combined into 1 device tracker. I haven’t done it myself. Maybe @anon43302295 knows?

I didn’t find using the known_devices file to group trackers to be very effective when I tried it a long time ago.

The best way IMO is to create groups of trackers per person, and use the state of the group to establish if the person is home and the state of the GPS based tracker(s) to establish what zone they’re in.

You can use a template for what actually displays on the dashboard.

Hope this helps :+1:

I haven’t tried it but I believe others use this:

1 Like

Which of these trackers you find most reliable?

Tried Wifi/NMAP/Ping trackers and they were not reliable cause devices not stay connected to network 100% of the time, they come in and out and automation’s go crazy

I found that Owntracks and Bluetooth trackers more reliable but still they sometimes miss

In past I combined several trackers with automation, made input_boolean which turned on only when all trackers in “home” state and turn off if any of the trackers is “not_home” state

There’s an example of using the baysian sensor here:

This is essentially what I do, but using Node-Red and MQTT to do it.

I have an MQTT switch, and a topic for each family member as home/not home state. Node-red handles all the automation of everything so basically, when both the owntracks (using zanzito’s owntracks method), and the wifi are ‘not home’, and the switch is ‘home’, then change switch to ‘not home’, and vice versa.

When someone comes home, it just has to match either condition to trigger home state, but in order for us to be counted as ‘not home’ both conditions must be met.

FWIW, I only use Life360. Two family members (including myself) have it on Android, and one has it on iOS. It works great and is not a battery drain. Although it’s not perfect (nothing seems to be), we find it very reliable. I’ve been using it for years, including with SmartThings before I recently switched to HA. (It’s even more reliable and prompt with HA than it was with ST.)

I do essentially the same thing as flamingm0e. I use GPSLogger, Unifi, and Bluetooth for trackers. Each person has their own group (group.tracker_name) which includes all 3 device trackers for their device. As stated, all 3 must be away for the group to be away. Any 1 of them as home will mark the group as home. This has been extremely reliable for me so far. I also use a master group (group.tracker_family) for some automations which includes all of the relevant device trackers (I could just use the individual groups to simplify it if I wanted)

I highly recommend that you do not combine trackers in the known devices file. Let each tracker type have its own entry.

Have not messed with the bayesian sensor. Seems like a lot of guess work, but others say its reliable.

Thanks everyone for all your valuable input!

@gregg098 eegg098 I believe I saw a post from you about the weight for each tracking device?
I would thing that this would be even better solution?

I only added the MAC address to the iPhones known_devices information so it wouldn’t create a second one from the Unfi tracker so ending up having multiple icons above for the same iphone/user.
(I like the user icon at the top stating: Away or Home)

But looking at your example it looks like you have two different ID’s “gregg_phone” and “greggphone” ID for the iPhone app and the other ID as the wifi host name correct? My naming is the same and that might cause more problems than helping?

I just enabled Ping and made sure each phone have a fixed local IP…hope that helps getting to many false positives.

Reading so many posts it seems that having an electronic door look with a unique code or providing special key chains that can unlock the door identifying the user is best option

I use the SNMP sensor to get the currently active MAC addresses off my wifi router, and couple that with owntracks, I get 99.95% accuracy from this method.

1 Like

I have never used the Bayesian sensor so I don’t know what weights to use in each category. It is probably a good solution, once tuned, but maybe not the best route now until you understand what the variables do.

Not sure which examples you are looking at but chances are, I have tweaked it since then. To break my usecase down a little more, my group (group.tracker_gregg) would include:

  • device_tracker.gregg_phone - This is from GPS Logger. No MAC address is included
  • device_tracker.gregg_phone_BT - This is using the Bluetooth tracker (not BLE). It includes my BT MAC address as BT_XX:XX:…
  • device_tracker.gregg_phone_wifi - This is from my Unifi controller and includes my phone’s WiFi MAC address

So what I think you are saying is that you combined two trackers by including the MAC address from one into another that didn’t need it. In my use case, I think you are saying, for example, I would have the wifi mac address in the GPS logger tracker which would combine them as one. So the problem with doing this is that Home Assistant will mark that tracker as home or away based on the last event it has seen, WiFi or GPS Logger. So lets say I’m in my backyard and fall out of WiFi range. Even though I’m still home, Home Assistant will see my WiFi presence as being marked away and now that entire tracker is away unless GPS Logger sends an update to say I’m home again. This usually doesn’t happen though as most GPS trackers have radius where it won’t report unless you move x distance from your last location. So if you keep 3 independent trackers, group them, and understand the group rules (1 home = group home, all away = group away), then you can work your automations around that basis and keep the incorrect reporting to a minimum.

Hopefully that makes sense.

That’s a very specific accuracy! :slight_smile:

LOL exaggeration but close enough :stuck_out_tongue:

I do the same as others here only I use a template sensor with my most likely (weighted) trackers at the top.
If my group of ble trackers say I’m home then that the likelyhood of me being home is very high and this condition triggers my home condition.
The sensor will remain in the home condition until Bluetooth group is not home and it will take the owntracks zones as next precedence and the likely hood that I’m home and in my zones is less likely being in 2 places at once :slight_smile: (not impossible for me to leave phone at work however).
Lastly being away on all trackers is the close of the template condition loop.

You could essentially do the same with a Bayesian sensor adding weighting for the most likely scenarios aka
All trackers at home 1.0
2 of 3 trackers 0.9
Bluetooth home 0.9 as its unlikely that this says you’re home when you’re not
own tracks home only 0.6 as you may have turned off Bluetooth on your phone
etc etc

I find my template to be 100% accurate provided I don’t leave my phone anywhere so thats where a Bayesian can help by taking other factors into account aka workday sensor says its a workday its past 7pm but tracking says I’m still at work likelihood of this is 0.3 or likelihood I left my phone at work is 0.7 say I’m home.

To combat things like this I use a second tracker on my car keys the likelihood of me not having either of these things and being at home is very low.

How do you get a “device_tracker.gregg_phone_wifi” on your Unifi?
Have you created a alias name that Home Assistant sees? or have you named your phone this way in order to get a special wifi ID that you can stack against the other trackers?

Would you mind sharing your updated configuration?

Again thanks to all of you for sharing your valuable input so many options! so hard to get working! LOL
@firstof9 SNMP 99,5% I have to read up on that! would it work on Unifi - impact to network traffic?

SNMP is low priority QoS and uses trivial amounts of data, so almost no impact to traffic. I am not sure if Unifi has SNMP available, I use Tomato firmware on my router. I can post you my SNMP config for this tracking when I get home.

@firstof9
Thanks! - I found this on Unifi

Yes, you would use SNMP to query the APs themselves and not the controller.
You enable SNMP on the APs via the controller configuration just like any other AP setting.

I have 2 AP’s in the house and a third covering the garden and most of the street (:joy:)
So I am not sure if this would be doable, I would have to ask all 3 and not one controller

For decent tracking it’s not really an issue, the traffic generated is minimal.

You can directly edit the known_devices.yaml file and update the device tracker names for any tracker with a MAC address (since the MAC is what is being used to update that entity). In other cases, such as GPS Logger in my case (probably OwnTracks too), there is no MAC so the name comes directly from the app. I was able to modify the logging string that GPS Logger spits out to get this entry.

I dont have much of a configuration to really share. It really is as simple as having a group with 3 entities to cover each tracker for each person. Then use the group state to trigger automations.