Now the only thing you may have probs with is when the phone goes to low power mode, wifi turns off. It's why a lot of us use "combined presence sensor" and use 2 or 3 items. For instance I use my phone and a fob on my keys (as does my wife) It seems more reliable.
and I use four different wifi presence sensors... !
holly cow...ok...so the more the better. Got it. Trying to get one to work at the moment..lol. Will try this on a basic automation and go from there. Hope it works.
Thanks for your help!
The issue is really with the iphone... its power saving algorithm often causes it to fail to respond to a ping. So you get a lot of false "departed" events. So I use Joel's wifi presence sensor, which attempts to make an htttp connection to the iPhone and gets rejected (which means the iPhone was present to reject it). I also use a unifi presence sensor which queries my Unifi network console to see if a particular device is connected to the network. And then I do a regular ol' ICMP ping. I aggregate them all with timeouts. If ANY of them return "present" I assume the person is present. If ALL of them return "not present" for at least 5 minutes I assume the person really is gone. It is pretty accurate unless *** someone *** who will remain nameless turns off the wifi on their iPhone.
You could also try a geofencing app like Life360. It works pretty well, until *** someone *** objects to being "tracked" and disables the app, immediately locking them out of the house. Of course if they remembered their alarm code after they got home from a night of carousing it wouldn't be that big of a deal... at 2am. But I digress.