This quit working for me on December 3rd. Nothing has changed on my network or with Hubitat. The only thing I recall is an Android update. Phone IP has not changed and the MAC is not randomized. I'm hesistant to remove and reinstall because I have this tied to several webCoRE pistons. I have rebooted the hub. Debug logs show...
httpGetCallback(The following 'connection refused' result means that the hub was SUCCESSFUL in discovering the phone on the network: {"headers":null,"warningMessages":[],"status":408,"errorMessage":"Connect to 192.168.50.160:80 [/192.168.50.160] failed: Connection refused (Connection refused)","errorData":null}, data)
If you do a search for "connection refused" and select "in this topic", you will see a number of posts indicating that is exactly what it should say when present.
As to deleting and making a new version, you could create a virtual presence dummy device, and use the swap apps device. Delete, recreate, and then swap it back. Although, I do not think that would do anything as you are using the same device driver.
Might be worthwhile to go into Hubitat Package manager and run repair on the Iphone Presence sensor app/device.
Turn off “private WiFi address” in your iPhone’s settings when connected to your home SSID, then set a DHCP reservation for your phone in your router’s settings page.
That is correct. Also, most newer phones will now try to randomize their ip address when they connect to wifi, so it's important to turn off "private WiFi address" on the phone's settings for your home network.
On the Samsung Series(maybe all androids), this is called "Randomized Mac". You have to click View More in the wifi connection and select "Phone MAC" to turn this off.
I installed this yesterday for my Samsung A53.
I made the address static and disabled randomized MAC for home wifi.
When arriving last night, I waited at the gate.
It took maybe 30 to be present, whereas the SmartThings arrival sensor takes a max of 20 seconds.
Still too long not to push the button though, lol.
I unplugged the phone and let it run overnight.
It didn't disconnect.
Pleasantly surprised.
I'm going to see how it works for my wife's Samsung S10.
I'm thinking I could somehow add these to the rules I have for the SmartThings sensors.
Don't want anything weird and unpredicted happening though, lol.
By default, the code tries to ping your phone once per minute. (And there are some retries in there.) For many people, that's the best timing. But depending on your wifi range, buildings around you, phone model, etc... it may work better for you to have the code ping your phone every 15 seconds. If you want to do that:
Not really. The logging is what I put in to help me make it work, back when I wrote it in 2019. One day I may get enough free time to make the logging more useful for non-programmers.