[UPDATED] iPhone WiFi Presence Sensor

Can I recommend you also look into @jwetzel1492's Combined Presence Sensor. It really makes presence detection way more reliable and versatile.

Yup @jwetzel1492 - 100% deserves our thanks!

@jwetzel1492 Well, so far so good for me. I have not been able to play with it extensively, but I ran out of the house a few times this morning and according to my logs the app is correctly seeing when I am gone and when I return. For the record I am on a Oneplus 7 pro (android).
I have not had a chance to try how well this works with your combined app but hope to later this week.
Thanks again for taking the time to develop this app, really is a great tool especially for apartment dwellers like me!

Would it be possible to incorporate the time between checks into an option in the device page? Reason is that I would like it to check very often when I'm approaching home (using the HE app geofence). I have a garage door that automatically opens and shuts when my phone connects to the wifi network, based on this app, and I'd like the connection to my wifi and HE to be instant. So, I would have a rule that increased the checking in this app/device when I'm approaching home (as per the HE geofence).

1 Like

Can you post that rule? I'm starting to play with one myself and would love some guidance.

Sure, but I dont have the HE geofence app written - at this stage it's only an idea.

This is the rule for opening the garage door, and the second rule is one that only enables THIS first rule if I've been away from home for >15 minutes. While I have an extremely strong wifi network, I dont want my phone to drop off then on the wifi network, and then to open the garage door. Note that this rule is restricted to DAY and EVENING (not NIGHT or AWAY). I have a separate rule for AWAY which first turns off the alarm, then opens the door).


The VS automatically turns off after 500ms.

This (below) is the second rule that enables the first, when I'm away for >15 mins.

Here's what I'm playing with so far. I've commented out the refresh statements in the driver and put the refresh action into this rule below. I'm trying to limit the amount of refreshing by using the geofencing of the Hubitat App and my wifi. The "Joker" and "iPhoneX" are the same device. The Joker is the Hubitat driver and the iPhone is the Wifi.

28%20AM

Here's the actual rule to turn the alarm off.
43%20AM

1 Like

At risk of taking this thread off track, how would I do this repeat. I've not worked with repeats before.
I want to repeat the refresh at 10 second intervals until my wifi presence is detected.

This is the current rule, which triggers when the Mobile App enters the geo fence.

Do I use: wait for condition, and can wait for condition cancel repeats?

Unfortunately, this isn't working well on my S7. It keeps showing my presence as dropping and re-connecting at random times, even though, according to my router, my phone has remained connected the whole time.

I turned off all battery saver functions, but it didn't seem to help.

Does anyone have any suggestions?

So I plugged the phone in last night at 10:30 pm, and unplugged it a little after 8 am. While the phone was plugged in, it didn't disconnect once. After I unplugged it, it began disconnecting again at random times. This is despite the fact that I have turned off all battery optimizations, set several apps to not optimize battery usage and never sleep, and even installed an app from the play store which claimed to keep wifi awake. It seems like no matter what settings I use, I can't keep the phone from putting wifi to sleep when it's not plugged in.

Throw your iPhone out of the window and get an Android phone lol :wink:

2 Likes

This is with a Galaxy S7!

Woop ha ha ha :smile:

I'd say to increase the delay before timing out, but one time your phone put wifi to sleep for a full 30 minutes. That's too long.

I agree. I once saw it asleep for over an hour, but it came back immediately as soon as I turned the screen on. The weird thing is the router showed the phone as connected the whole time.

It's not necessarily that weird. WiFi devices can connect to an AP and tell the AP that they will be a sleepy device. It tells the router to not drop the WiFi connection for these devices, even though they are inactive for a while (usually to save battery power.)

1 Like

@bissadaj

I agree with what @ogiewon has written. My Google WiFi displays my tablet as connected for at least 20-30 minutes after the tablet is powered off.

One of my old phones (I think it was a Nexus 6) would drop off the WiFi network when it went to sleep which messed with automations that depended on my phone being WiFi connected to my router. I found an android app called "WiFi Keep Alive" that prevented the WiFi connection from being dropped. Maybe you could find something similar.

I tried WiFi Keep Alive (and a few others like it), and unfortunately, I'm still getting the regular drop offs. It seems like no matter what I have set, the phone won't keep the wifi on unless it's plugged in.

I set this up yesterday on my Samsung S10+ and my Wife's Samsung S10+. I set the polling to 15 seconds just to have a better test bed for connectivity issues. It has been dead spot on for the past 24hrs for both devices. Really cool "device"...

I'm 100% new to Hubitat and smart automation, soooooo much info that my head spins lol I've not used the device yet as I've not fully wrapped my brain around the Rule Machine, but I'm sure it will be handy down the road!

1 Like

Welcome.
Home Automation (HA) is certainly like the proverbial "rabbit hole".

also check out simple lighting and motion lighting. There are heaps of options in there to start before you need to dip into RM :wink:

1 Like