iOS presence detection WITHOUT HomeKit component or HA app (totally native)

Thanks for posting this very helpful info! After a lot of trial and error, I finally got it working. At least for me, it would not work until I also set a “Content-Type” header like this:

2 Likes

Weird, I just checked and mine works fine without the header. In any case, glad it worked for you!

Now that my HA can connect to the outside world, I will give this a try. The HomeKit method is flaky at times. Did you ever get an answer about the gps range?

I never did, but anecdotally it seems really precise. It will usually mark me as away by the time I’m 1 or maybe 2 houses away from my own down the block. I’m guessing it uses more than just GPS under the hood, so is able to be a bit more accurate.

Great work @zacs! Would it be possible to have just two shortcuts (arriving/leaving) for multiple persons by somehow adding the persons name in a textfield and get that in the attribute of the entity?

Just wondering because in the first steps of the shortcut it’s possible to select the person(s) in my household that trigger the shortcut. In that case I can setup a notification that shows the persons who’s arrived/leaved with just 2 shortcuts.

A nice idea. Doesn’t seem possible since a shortcut doesn’t have any sort of variable for the device’s name (at least that I can tell).

@zacs I found this: Using the Same Shortcut on Multiple Devices - Things Support
I’ll give it a try, although I don’t have a lot of coding skills :crossed_fingers:

Unfortunately the triggering is not constant when using the personal automation version. I dont any devices that count as a hub for homekit, is there anyway to fix this?

Unsure as I don’t use the personal automation, just the home one. My automation does tend to work really well still (although I use a person entity that combines this device_tracker with a Unifi one).

If you use HomeKit in any way, a refurb AppleTV 4 to just plug into your router and use without even a TV would be a good investment. Letting your spouse use the Home app while remote is a nice to have.

1 Like

Yea that was my intent for using the Homekit App, she likes it more than the HA app. Pretty stupid that there is no really good solution from HA… I have a Ipad, which when connected to power can be used as a homehub (just like a ATV4). Ill first try and test with that to see if I can get it working.

Thanks anyways because it does work (manually triggered)

I use iPhone device tracker and never have to touch anyones phone. Works with deep sleep too on the iPhone.

1 Like

@zacs I changed the automation to home automation and kept the Ipad connected to power and now it works flawlessly. I think the personal automation cant really determine the correct location. Im going to get an apple TV as you suggested to use as a home hub. Thanks again!

Hi, @PrayerfulDrop I have used that integration a couple of years ago trough HACS. But HACS gave me lots of troubles when I needed to update. I want my installation to be as close to stock as possible. Thanks for the tip, if @zacs solution doesnt work ill go look at it again!

I am trying to figure out if this is normal for the toggle to be greyed out. You’ve mentioned that homekit isn’t required. I cannot remember if it was like this when I first set it up a few months back. It is still a hit and miss for me to have the device_tracker.id toggle from home/ not_home.

I think it is grayed out because the home hub is offline? Here’s what mine looks like. All it’s doing is using its own logic to figure out if you’re home and then calling a webhook in HA, so definitely no Homekit integration is required.

I don’t know what I did or not did to have it greyed out. As is, testing to see if it works does work, but I have not tested in real life situation.

Home hub as in my appletv 4 (which is what I have). It is on standby is what it says. I don’t know how to fix this. Why I have two entries; I have no idea. I only have one appleTV.

That’s super strange. I’m just going based off of the text above your grayed about toggle. The AppleTV should say “Connected” instead of “Standby,” but it appears to be an Apple issue, not related to HA.

Might need to go into the AppleTV config and enable it, maybe? Or maybe it is on an isolated VLAN or something else network-related?

Just peeked in apple tv. All looks like it should be working.

I got it all working as per the guide but the device tracker would not show up in HA, that was until I found it I had to enable it in known_devices.yaml I just had to enable tracking on it and restart HA. Works a treat now.

1 Like

Yah, this looks like a problem with iOS/AppleTV/HomeKit, if your phone isn’t able to see the home hub. In the past I have seen good troubleshooting suggestions on the /r/HomeKit subreddit. Someone had the same problem here: https://www.reddit.com/r/HomeKit/comments/8kfasy/all_home_hubs_stuck_on_standby_any_thing_i_can_do/

1 Like

Well, that was easy enough. I went with the easiest option… Unplugged that damn thing. All is normal again.

1 Like