[UPDATED] iPhone WiFi Presence Sensor

Yes I believe it’s only when the device is idle for a period of time.

A couple months ago I just set up a virtual presence for his iPhone 6s and my iPhone 8. I’m only using his presence for my goodnight routine to see if I should leave the downstairs lights on or not, so nothing critical. It’s turned all the lights off on him a couple of times and I had to go up to 90 minutes of timeouts on his phone to make sure I don’t get a false ‘not present’

After making this change I set it down to 5 and actually I just got a not present in the device events that lasted for one minute. I don’t see the cause for it in the logs - A little more debugging but this looks promising.

Edit: nope i was wrong - that was my weekly wifi reboot @ 3:15am on Tuesdays.

so i get those error messages as well? is this expected? how did you resolve this? also i am use a static IP set by my router, which is a 192 IP, does that make a difference?

dev:1652020-06-29 10:37:48.217 am debugDrGs Wifi: httpGetCallback({"headers":null,"warningMessages":[],"status":408,"errorMessage":"Connect to 192.168.113.191:80 [/192.168.113.191] failed: Connection refused (Connection refused)","errorData":null}, data)

dev:1652020-06-29 10:37:48.069 am debugDrGs Wifi.refresh()

Connection refused is actually good. That means your phone is receiving the request. (And refusing it.) But it should be marking your phone 'present'.

1 Like

oh ok got it. yea my phone shows as present when i go to the device.

so its not an error message really. sweet, thanks for clarifying.

status 408 means it made a connection but your device is not hosting a web server for it to load from. this is a good sign

2 Likes

IMPORTANT UPDATE: iPhone Presence Sensor can now be installed from Hubitat Package Manager. This is the best way to make sure you keep up-to-date with bug fixes and new features.

9 Likes

Noticing an error after update, any idea?

groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Integer#div.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class java.lang.Character]
[class java.lang.Number] on line 98 (refresh)

Ah, I think you might be updating from an older version. Can you go into the device page for each of your iPhone Wifi sensors, and click the "Save Preferences" button? This should update it and fix the error.

Bingo, I’m good now! Thanks

FYI - I'm on the iO14 beta, and by default Apple now adds a "privacy" setting that screws with this integration. Specifically every few days the iPhone will now change Mac Addresses which in my case (most routers?) changes the IP of my phone.

Good news is you can turn this off, but just FYI in the event you upgrade and are initially confused about what's happening.

3 Likes

Thanks for the tip!

Ooh, I haven't tried iOS14 yet, but I'm going to be ticked about this if I can't find a workaround. So you're saying you assigned a fixed IP address to your iPhone on your router, but then iOS14 changes the MAC address, so your router sees it as a new device and assigns a new IP address?

1 Like

You can specify by hitting the "i" next to the wifi network the phone has joined. This is more for non-home networks I would think. Similar functionality is built in to Windows 10.

1 Like

This is actually a feature in Android as well, but I think it will not be turned on for existing wifi connections. But when I go to my wifi settings, click on my network, and go to advanced I can choose device MAC or randomized MAC. I'm not sure if it defaults to on for new connections or not. Or maybe only defaults to on for access points with no encryption. I don't know.

Must be new in one of the latest Android versions? My older Android 8.0 doesn't have this anyway.

It looks like they started laying the foundation in 8, added it in 9 but hidden away in the secret developer features menu, and then enabled it by default in 10.

https://source.android.com/devices/tech/connect/wifi-mac-randomization

2 Likes

Thanks!

Yes, but it is an option you can turn off.
Right now it seems to be on by default even for existing WiFi connections, however that may just be in the beta.

Regardless i figured it out, and am happy that the feature exists (yay) and I am able to get this back working as normal.

1 Like

After a security update to my phone already on android 10 it enabled the random MAC addresses for all of my networks so this might not be the case.

For anyone using this driver with my app Combined Presence, I have just release V2.0 of Combined Presence. The best way to get the update is to install via Hubitat Package Manager, but you can also install directly from GitHub.

It should be fully backwards compatible and not break any existing combiner instances.

The most important update is the new "Standard Combiner". This instance has the optimal logic for detecting presence of a person using multiple geofencing and wifi-based presence sensors. You don't have to think about the boolean operations involved. It just does it the best way based on the performance characteristics of the different sensor types.

https://community.hubitat.com/t/release-combined-presence

1 Like