Easiest Presence Detection?

What is the easiest way to have Presence Detection?

We are living in a apartment without larm or door sensors.

I have Android Phone and for some reason my wife have iPhone :stuck_out_tongue:

Until now Owntracks have worked pretty good but not completely.

What i primary want is to have for example some light automations only to execute when any of us are home.

1 Like

the easiest is to have a switch / light that you turn on when you come home and turn on when you leave. If its integrated into HA then it is essentially a home/away indicator.

Other than that, thereā€™s a ton of ways to do it and while they may seem easy and simple, until you squash any bugs or get the wrinkles out it can be a bit of a curveball.

Motion and door/window sensor provide virtually immediate response(automation trigger)

Bluetooth by phone may be quick but have distance limit

wifi by phone will have delay 2-10min before detectā€¦due to my delay getting out car this never issue for me

GPS is OK

The easiest way would be to use Bluetooth. Turns out you donā€™t actually need bluetooth turned on your iPhone and the Raspberry Pi still detects it. Found that out the other night. This is how we run automations that require us both to be home.

Another way would be through your router. Your 2 phones are on the Wifi so it will run the automation.
Could do GPS tracking too.

If you didnā€™t want to go down the phone route then you could have input booleans that turn on and off depending on whether your keys are at home. You could use a Tile or something similar to that.

ANOTHER way if all that wasnā€™t up your alley could be using another platform like Nest and tapping into its away/home mode.

Just need to work out the consistent things you guys do for example do you always leave with keys in your hand? Do you both have phones and always take them? If you donā€™t find those patterns then simply turning on an input boolean could be your answer.

If you can train urself, get two sensors on hooks, and make sure you hang ur keys there.

Ur home if ur keys are on the hook.

1 Like

I have Amazon-Dash running on a Pi3, mostly for the dash buttons, of course.

But it also detects when our phones log back onto the WiFi network after weā€™ve been away using the same mechanism. Itā€™s the fastest not_home to home state change Iā€™ve managed to implement so far.

Itā€™s sometimes still not fast enough to disable the alarm automatically before I unlock the front door, but it is very reliable.

Are you turning Bluetooth off via the settings app or via the control center? If the latter, the radio isnā€™t actually turned off.

1 Like

It really depends on what type of automations you want as well as the devices you currently own.

There are many GPS/Phone based options on here that work pretty well. As youā€™ll find reading through the forumsā€¦none of them are 100% perfect, some are better than others.

Wifi is nice, depends on your router/hardware, etc. Not instant, mine usually picks me up within 30 seconds though.

No personal experience with bluetooth, but depends on if you have bluetooth options. I dont use a RPI, and dont have bluetooth, so I cannot say, but Iā€™d assume that it has the same time limitations as wifi.

Going back to what you want to do. If you want something to happen the second you get home, like open a garage, or unlock a door, they youā€™ll want something that has an quick detection. If you just want things to happen soon after you get home, or more common you want things to happen when you leave, like turn off lights, etc. It does not really have to be instant (in my opinion)

Iā€™ve been chasing the perfect presence detection for a while. Even before HA, I was using SmartThings, and even Hubitat for a while. Never found any one type of tracker that worked perfectly. What I do now, which is what many do, is use a combination of trackers and then automate accordingly.

I currently use the ASUSWRT tracker, the native HA iOS app, Google location sharing, Life360, and I have an input boolean controlled by Apple Homekit. I use a combination of these depedning on what Iā€™m trying to do.

Most of these are super easy to set up, have a look through the forums.

The easiest and most reliable for me was - alarm system armed / disarmed = not present / present. The alarm state was changed using an RFID reader inside the front door frame. Wave your keyring tag at the door frame as you arrive / leave.

However I have now automated arming and disarming using USB iBeacons (all with the same UUID) scattered about the house in cheap USB chargers in unused mains outlets. The beta version of the iOS app is doing a 100% job of entry / exit notifications. 5 beacons just covers a large two story house, however the alarm will arm if I head out into the back yard.

Oh that would explain it then! Cheers :smiley:

Ok i should have explained more i think :slight_smile:

We are living in a apartment without larm or door sensors.

I have Android Phone and for some reason my wife have iPhone :stuck_out_tongue:

Until now Owntracks have worked pretty good but not completely.

What i primary want is to have for example some light automations only to execute when any of us are home.

Nmap component or similar may work. It easy to setup and try out.

If that not work then maybe look at something else.

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.