[UPDATED] iPhone WiFi Presence Sensor

Yep, those are the two expected responses from this driver trying to connect to your phone via http.

Connection Refused means that the phone is at least on the local network. (i.e. "present')

Connect Timed Out means that the phone is not on the local network. (i.e. "not present")

4 Likes

This question has come up a number of times from new users. I'm tempted to wrap that logging statement in an explanation of what it means. I'm actually taking some time off from work soon...

7 Likes

Ok, I made that logging statement less confusing. New v1.03 is live on GitHub. As always, the best way to get the update is with Hubitat Package Manager.

7 Likes

I have a question. In the house we have Galaxy s8 s6 and A5.
The S8 presence works really well on this and shows no false not present.
Why would 1 phone (it has the hubitat app but dont thing thats the reason) work 100% and the others not ? is there something that can be sent on the phone to make the presence readings as accurate as the S8 ?
Thanks

Unfortunately, I'm not an Android user, so I don't truly know. My guess would be that those other phones aren't giving the same response to the requests I make.

Ideally, there would be a version of this driver designed for Android. It would ask you what phone you had, and be able to understand the different responses that come from the different device types. Unfortunately I don't have any Androids and maintaining something like that isn't a commitment I'm going to be able to make.

But if anyone else wants to take the idea and run with it... :smiley:

Are the others possibly shutting down their WiFi when they are not actually being used? iPhone guy here but I remember reading that this is a possiblity.

Do you mean manually ? Then that would be no.

Unless the phone is doing something automatically but then would it not do that on all galaxy's?

Don't know not an Android guy. On the iPhone it depends on how many apps you are allowing to run even when you aren't using them. In this case those apps would also need to be doing some kind of wifi activity I would assume. Just was a guess.

Lots of Android shut off wifi after the screen goes dark. My Motorola is nearly instant, it drops off Wifi almost simultaneously with screen saver.

Different models and different Android versions seem to handle power saving differently.

check the logs and see the responses when the phones are on and off the wifi. You might need to change the status code or the description to match what the phone is giving

I AGREE. Xiaomi and Huawei are famously known for this. Even notifications of whatsapp wont be received. This is how they sell longer battery life marketing.
However being a samsung user myself I can tell you samsung is so big a company They are not consistent with their products performance.
My one tab 4 years old can last 3 weeks straight and only goes down 40 percent when screen is off. It also uses minimal wifi like once a day to receive any notifications.. atill my most reliable android device.
My latest S4 tab and S8 last 4-6 days even with wifi turned off.
Use wifi analyzer app and see how they run

So coming back to my posts from May, this is still occurring where it looks like a scheduled job gets stuck which means the presence detection doesn't work. Clicking refresh does nothing, neither does restarting the hub. If I remove/add the device, it works for some time before getting stuck. I still think this is related to an earlier system update, because I recall having problems since that time.

I just installed this on my wifes iphone 8 and my pixel 3.

It works better on the pixel than it does on the iPhone?

It keeps flipping between present and not present on her phone but rock solid on my pixel, is this the wifi sleep thing on iphone? if so how doe one get around that?

You can try increasing the timeout until it marks the device as away.

wouldnt that reduce the overall accuracy? I have it set to the default 3

It kinda depends. iPhones will shut off their WiFi radio when asleep after a few mins, so the device won’t be very accurate while it’s in your home but asleep after ~10 mins.

If you increase the timeout, it’s less likely to send a false “away” event, but of course will take longer to register away once you’ve actually left your house.

This driver for presence detection is used by most people as one component of a multi-presence sensor solution. It’s great for triggering present, but unless your phone has very specific battery optimization/background app refresh options you can tweak, it’s usually much less helpful for triggering away (on its own).

1 Like

Exactly. You need to use both this and a gps-based sensor, and then use Combined Presence to get a final verdict on “are they here or not”.

2 Likes

To note on this thread that iOS 14 has a new ‘feature’ that will change the MAC address and static IP addresses will change. It is defaulted on to this ‘feature’.

4 Likes

Luckily you can turn it off on a per-network basis.

Btw, I just implemented this on my C7 for the wife and I as follows - hopefully this will work correctly. I've now turned off "High Accuracy presence" mode on our iPhones as it's a power hog.

IMPORTANT INFO FOR ALL CURRENT USERS:

If you update to iOS 14, by default it has a feature that randomizes your IP address. This will break this presence sensor. To fix this:

  • Go into your Wifi settings
  • Choose the settings for your home network
  • Turn OFF the "Private Address" feature

That will fix it.

6 Likes