Easiest Presence Detection?

I recommend using a combination of phone based trackers. Owntracks, Life360 are good and free. Google location sharing is pretty easy, but not quite as easy as the other two. Your wife can also use the HA iPhone app to detect presence.

From there automation are easy. Here is one I use. I’m sure that some people will jump in and say I should use a group, or combined presence but for me this is what I like to use.

- alias: Home Mode - Arriving
  trigger:
  - platform: state
    entity_id:
      - input_boolean.paul_present
      - input_boolean.tracy_present
      - input_boolean.guests_present
    to: 'on'
  - platform: state
    entity_id:
      - device_tracker.paul_all
      - device_tracker.pauls_iphone_2
      - device_tracker.tracy_all
      - device_tracker.tracys_iphone_2
      - group.extra_device_trackers
    to: 'home'
  condition:
  - condition: numeric_state
    entity_id: sensor.ha_runtime_in_minutes
    above: 1
  - condition: state
    entity_id: input_select.house_mode
    state: 'Away'
  action:
  - service: input_select.select_option
    entity_id: input_select.house_mode
    data:
      option: 'Home'
  - service: input_select.select_option
    entity_id: input_select.security_system
    data:
      option: 'Disarmed'

I basically, if any one of these become present my home mode turns to home. I can use the changing to home to kick of other automations. Like turning on lights, etc. I chose to break it out to individual presense sensors vs groups, or combined (ie baysien) because sometimes one would be stuck home, or on, etc. This has worked very good for me.

1 Like

I now got Owntracks reconfigured.
Got a entry in known_devices.yaml but how to get as antry in device_tracker.yaml?

Known_devices.yaml:

devicename:
  hide_if_away: false
  icon: mdi:human-male
  mac: *macaroni*
  name: My name (as configured in owntracks app)
  picture:
  track: true

My two cents worth is that there is no presence detection that could be described as “easiest”. Least PITA is all you can hope for. All of them have issues, although assuming your apartment is small, bluetooth range may not be one of them. Modern phones disconnect from wifi, so router solutions will not always work. Owntracks is better but not always perfect and drains the battery. I’m currently using this solution on two Raspberry Pi Zero W devices - one upstairs and another near the back yard, plus the HA bluetooth tracker running on a Pi 3B+ downstairs. If any one of them has 100% confidence, then I say that person is home. Even then, it’s not perfect and every few weeks one of the devices just stops responding.

So my brutal assessment is it’s more effort than it’s worth. Just get yourself an Alexa or Google Home and control the automations through your voice.

Owntracks with iBeacons works like a dream… however they are removing beacon support from the android version soon, hence why I am now looking at the bluetooth tracker combined with Netgear (Orbi) and Monitor (I hope) and GPS Logger and maybe all wrapped up in a Bayesian sensor.

I want it to mark us home before we open the front door, so hall lights come on when dark etc… so a RPi zero (wired not wireless) with HASSIO an BT tracker, and MQTT statestream to my main HA

Just to jump in again, As you can see there are a lot of opinions on here as to what is the easiest presence detection. Easiest is not necessearily the “best”, or 100%. It takes some work and probably multiple detectors to get closer to 100%, and even then you’ll probably still only get 98%.

But, it looks to me that are still kind of new and begining to learn, so focus on one “win” at a time.

Get ANY presence detector working, even if its only 90%, it will teach you how presence sensors work, and how to create a simple lighting automation, which I think is all you’re looking to do at this time.

After you get that working, then you can decide if you want to set up multiple RPIs, or different custom trackers, etc.

I have to say that for me, this iPhone detection has bee working really well.

Both my wife and I have iPhones, and I’ve combined that with Bluetooth tracker, NMAP, Ping and UDP. I also have a FingBox that does a great job tracking what’s online. So I ave created a Baysian sensor to combine all of them and haven’t had any issues for presence.

2 Likes

Hi @berniebl, how do you get the info from the FingBox?

I followed this guide, this is another setup that has worked flawlessly.

I am using MQTT with Zanzito for a long time now, very happy with it!

1 Like

Thanks for the info.
I looked at this thread before and although I like the fact that it tracks all devices (and not just the wireless ones as my Unifi Controller does) I did not want to go through this complicated workaround - plus, it’s yet another ‘cloud’ solution.

QQ, though:
How long does it take for the device state to change to e.g. not_home in your UI as soon as you’re off your LAN/Wifi?
I know the FingBox has a setting where you can determine how quickly it considers you to be offline (‘State change timeout’) but how much does the sending and receiving of the email and recognition time add on top of that.

I believe, leave it to a connected wifi if I am home or not is simply not a good solution. If my phone e.g. restart e.g. because of an upgrade and I am off the wifi for a minute, then the lights would turn off in the house, because “I am not at home”?

A presence detection I just posted above is much better. It can tell not just if you are home or away based on the location of your phone but even if you are getting close to home from somewhere…

I have a Samsung Galaxy S7 and I’m not under any threat to have this phone upgraded any time soon :cry:

I am not sure that I would consider fetching information from your email a ‘cloud’ solution per se. It’s pretty much the same as getting your calendar information from Google. It looks a little more complicated on paper than it is to implement. I found it pretty easy to setup.

Response if very quick in my opinion. I have my delay in Fingbox for 3 minutes, as soon as this gets triggered I receive an email and within seconds it picks up the change. Works very well

Thanks - seems to be working quickly then, I am impressed.

I’d still take the liberty to consider a solution that relies on reading emails from a Google IMAP-server a cloud solution, though.

Although the interface is very clunky, I like Zanzito and use it for testing when I set up something new that relies on MQTT.

But I don’t need to / want to track anything else than home vs. not_home and I hate having ports open on my router with a vengeance - so Zanzito would not be my first choice.

So, it depends very much on what the OP wants to do with presence tracking (just home vs. not_home or more detailed info) and how comfortable they are with opening ports on their router.

@ptdalen Could you please share on github or pastebin also for the rest of the code.

input_select
input_boolean
sensor

And some automations built on that

Sure. Here is my repository

1 Like

Thanks a million!!! Now im trying your solution :slight_smile:

1 Like

EDIT:
Oops, sorry, I didn’t realize it was an ancient post. The dangers of using the google now feed; sometimes it thinks you want/need to see old stuff, and you don’t even realize it before it’s too late.


Just to add, and echo a bit, the best is likely many different ones.

Currently, I’m using a combination of:

  • Life360 (all phones)
  • Google maps (my phone)
  • iOS device tracker (the iPhone users)
  • Ping (all phones, but due to iOS device putting wifi to sleep, I’ve set it so ping can only determine that someone is home, a “away” in a ping tracker does nothing)

I set them all up in an appdaemon app (heavily inspired by an app by arsaboo, but modified to suit my needs better). It prioritized sources, and updates the “meta tracker” in a way that makes sense. And you can easily add more trackers, or change how you want a specific tracker to report/behave (like not having the Ping tracker be able to report someone as away).

However, it seems to me that the life360 is the most useful single component (and as luck would have it, the Life360 custom component becomes a home Assistant standard from next release)

Hi, I’m new on HA. I would track presence in my home only using wifi connection. We have all android phones. Ping is the best way to check phones connected to wifi? There are other ways?