HomeKit as a Presence Sensor

You can use life360 app i use it and work fine and not is necesary use AppletTV

In spanish how to config it

I have tree menbers in family and with family group with tree device trackers i can automate family presence

Thanks, Iā€™m actually familiar with life 360, as well as owntracks, Iā€™m just looking to understand the different options available, and thier pros/cons.

1 Like

Geofencing. Just like the HA app is supposed to, except homekit works 99+% for me, where as the HA app missed my arriving/departing more often than not. I supposed because HK is built in to the os, itā€™s better.

1 Like

Iā€™m about to get an apple tv and want to set this up, can you confirm this is what needs to be done

configuration.yaml

homekit:
  filter:
    include_entities:
      - input_boolean.me_present
      - input_boolean.wife_present
      - binary_sensor.hk_presence_me
      - binary_sensor.hk_presence_wife

binary_sensors.yaml

 - platform: template
   sensors:
     hk_presence_me:
       friendly_name: "Presence me(HK)"
       device_class: presence
       value_template: >-
         {{ is_state('input_boolean.me_present', 'on') }}      
 - platform: template
   sensors:
     hk_presence_wife:
       friendly_name: "Presence wife(HK)"
       device_class: presence
       value_template: >-
         {{ is_state('input_boolean.wife_present', 'on') }}

inout_booleans.yaml

me_present:
  name: me
  icon: mdi:account
wife_present:
  name: wife
  icon: mdi:account

Then once I get the Apple TV set up with HK, and devices added, etc I will add a total of 4 items, two binary sensors which will be seen as presence sensors in HK, and two input select sensors which will be turned on and off with HK based on presence.

EDIT: One more question, I think I know the answer to. This solution will likely be great for knowing when Iā€™m home or not home, but wont pass any GPS info, so wont work with any ZONE automations.

Iā€™m perfectly fine with with. I can still use the less stable HA for that if needed

a quick look at your setup looks like itā€™s correct.

One way to do this would be to create input_booleans for each zone, then have HK flip those. In HA, when the input boolean flips, use the device_tracker.see service to force that zone to ā€œseeā€ the device.

Ok Iā€™ve got a spare iPad I was going to sell but have set this up instead. I hope it will be a reliable and punctual way to determine if I am home or not as I have a number of automations that would benefit from this.

Thanks for the very easy to follow instructions. The only thing that stumped me for a moment was my own blunder. I couldnā€™t work out why I was unable to add an automation to HomeKit until I realised I had not set the spare iPad to be a HomeKit Hub.

Only thing that I cannot figure out is that now the devices in my HomeKit Are showing up in home assistant. They are showing to be configured. Itā€™s my hue hub. As well as two Ecobeeā€™s. Even the HA hub is showing up in HA to be configured. Of course Not only do I not want to configure these in HK. I donā€™t have a pin to do it.

But I do have my presence on off switch is working fine.

Sounds like you have discovery on and homekit enabled (which will have HA go out and look for homekit devices). If you donā€™t want that at all, you can try:

discovery:
  ignore:
    - homekit
1 Like

I have a apple TV 3ed Gen will this work for my roommate I ask because remote access is limited to just me due to the age of the apple TV

HomeKit works with 4th gen ATV or later only.

HomeKit Does indeed work with Apple TV 3rd Gen its just restricted on some areas (doesnā€™t support remote access for shared users or remote access to HomeKit enabled cameras)

Yes, well, you did ask if it would work for your roommate ā€¦

And thatā€™s a fail.

After three days of responsive tracking homekit just thought my phone was away while I was sitting here with my phone next to me. No good if Iā€™m going to use it to activate my alarm system.

Sigh. Back to the drawing board.

Iā€™ve had similar experience so far. Pretty good, but missed a couple times.

I have a Bayesian sensor, that seems to be working well.

I use the HA app (since I need to have that installed anyway, plus I use it for some automations that are zone dependent., HomeKit, since it does not really require any more overhead on my iPhone since itā€™s using native iOS calls, and my router, since my phone connects to wifi anyway. I have an asus router, so I use asuswrt.

Those three seem to be a great combination for me, Iā€™ve removed OwnTracks and not looked back.

I might try that. How quickly does it recognise you have returned home?

This is mine. The input Boolean is my HomeKit, the other two are HA app, and last is router.

When I come home Homekit tends to show present 1st, and that is enough to trigger this as On (aka home). As far as triggering away, it takes multiple items to go away. But router is always correct for me, and one of the other sensors usually goes ā€œawayā€ quickly.

Bottom line, for the past week that has been great

 - platform: bayesian
   prior: 0.6
   name: Paul Presence
   probability_threshold: 0.9
   observations:
   - entity_id: 'input_boolean.paul_present'
     prob_given_true: 0.9
     prob_given_false: 0.1
     platform: 'state'
     to_state: 'on'
   - entity_id: 'device_tracker.pauls_iphone'
     prob_given_true: 0.9
     prob_given_false: 0.2
     platform: 'state'
     to_state: 'home'
   - entity_id: 'device_tracker.pauls_iphone_2'
     prob_given_true: 0.9
     prob_given_false: 0.4
     platform: 'state'
     to_state: 'home'
3 Likes

This is strangeā€¦ HomeKit is about 99% for me - I have an automation open my garage door when I come home and itā€™s like magic ā€¦ I drive up and donā€™t even completely stop, the door opens.

I think in the month or two Iā€™ve been running this, I can count on one hand the number of times it ā€œmissedā€

Are you sure the automation was correct and did not change? I noticed in the past it was for some reason tracking my ipad instead of my phone. For most people homekit seems to be very reliable.

Yes. I can see the state change of the homekit input_boolean in history.

Something odd happened again today. I went for a short ride that HomeKit recognised. Then not long after I returned home I was sitting with my phone within 2m of the wifi access point and HomeKit momentarily set me as away twice.

More oddness from the homekit tracker today. The iphone app tracker was 100% for a change though.