Question on Device Trackers

I am trying to wrap my head around the device tracker component.

For example, I would like to use the Ping and GPSLogger platform. Here is an example of what my device_tracker.yaml would be.

device_tracker.yaml
- platform: ping
  consider_home: 180
  hosts: 192.168.1.3
- platform: gpslogger
  password: !secret gpslogger_password

If a device is pingable on my network it would automatically be considered home? And if not it will use my zone file along with the GPS location from gpslogger to determine where my device is?

The ping tracker will have a state of ‘home’ if the device responds to pings. When it doesn’t, and it hasn’t for the consider_home period, then its state will change to ‘not_home’. The ping device tracker does not provide GPS data.

I haven’t used the GPSLogger platform, but my guess would be it works like other GPS-based trackers in that it will provide GPS coordinates, which will be used to determine where the device is. E.g., if it’s in the home zone, then it will be considered ‘home’. If it’s in another defined zone, then the state of the device_tracker will be the name of the zone. Otherwise, the state will be ‘not_home’.

EDIT: I should add, by default these will each create a unique device_tracker entity, and they will work independently. There will also automatically be a group named group.all_devices, whose state will be ‘home’ if either of the two devices are ‘home’, and will be ‘not_home’ if all of the devices are not ‘home’.

Exactly what I was looking for in an answer, sometimes its a bit confusing reading the docs. I am only building my HA system next week, and im trying to pre-write a lot of it!

Hard to understand some of the concepts without testing!

Thanks

1 Like

Fair warning: the ping tracker can be fairly, and sometimes very, unreliable. This is due to the fact that many cell phones like to ignore pings to save battery. I happen to be testing it recently myself, and this is what the past day looks like:

image

Notice all the changes between Home (i.e., ‘home’) and Away (i.e., ‘not_home’) yesterday. I was actually home the whole time. Then you can see when I put the phone on the charger it responded all the time (i.e., the solid Home period.) But then in the morning it became erratic again until I left.

So, typically this type of presence detection must be carefully used in conjunction with others. There are plenty of topics about this. You should read up. :wink:

I use asuswrt component after falling ony ass with ping due to your mentioned ping problems …asuswrt is very reliable

Solution might be Ping Intervall Change

1 Like

I believe you can control how often it will try to ping, and when it pings how many pings it will send until it gets a good response (if any), and how long of a period of no response should still be considered home. But even with all that, if the device chooses not to respond for an hour or more (which is not uncommon), then you’re still going to have times where the tracker’s state goes to ‘not_home’ when the device is really at home. (And the longer you set the consider_home period to try and compensate, the longer it will take to change to ‘not_home’ when you actually leave.) So previous warning still applies. :slight_smile:

I use BT it’s pretty reliable for me…

image
No false aways or homes :slight_smile:

1 Like

What bluetooth device are you using on the HA end and what kind of coverage distance do you get?

1 Like

Standard RPI3 BT and coverage is easily enough for my small flat however if you had a larger house then I would use Andrews Monitor and a couple of PI Zeros.

I agree…monitor is a nice tool .