[UPDATED] iPhone WiFi Presence Sensor

Sorry for the delayed response, I was still trying to figure out the problem. I'm having the same issue with apps and automations failing to run after some time -- I think your suggestion about a new HE scheduler bug is true, this problem doesn't seem to be unique to your driver.

It’s certainly possible, though I haven’t experienced it. I’d suggest reporting it to Support.

1 Like

I'll keep an eye on it -- not exactly relying on presence detection so much these days :man_shrugging:

Add a few more compatible devices to your list that work with this presence sensor.
Moto Z2play
Amazon fire 7 tablet (2019)

And the other half uses a Samsung S3 I think.
Away/not present status changes pretty accurately. But arrival after being gone for sometime seems to take up to 10 minutes.

I'm gonna make a tile for my PC so I can confirm when WOL happens. Hopefully it works but may have to use the WiFi ip, not sure yet. Otherwise I don't see why this wouldn't..

Thanks.
It's still better than HE geofence giving random arrivals and departure when your 10 miles outside the area at work.

Found a way to have this ping more frequently (less than 1 minute) to check a device.

Created a rule to run the refresh every 10 seconds. That time can be increased/decreased as needed, but it works great...now to monitor and see what type of impact this has on my HE

How is you hub performance?

no issues with the HE. dashboard my take an extra second to pop up, but it's nothing breaking

Is it possible to edit the app internally to do this rather than use a refresh rule? Or 1 minute is the minimum possible in the code? Could it be changed to seconds internally?

Yes, Hubitat allows for scheduling in the range of seconds. One has to be careful though, due to the timeout duration of the http call. It makes no sense to try to issue http calls while previous ones are waiting for a timeout condition.

Personally, I would not want a ton of http calls being issued in rapid succession as it may cause issues with the hub. YMMV, of course.

1 Like

If you look in the code, there are 2 options for polling. Option 1 is enabled by default, which is every 1 minute. Option 2 polls every 15 seconds

Yeah I thought so. You can remove your refresh rule! :smile:

What would you need to change the code to for option 2?

if (enableDevice) {
runEvery1Minute(refresh) // Option 1: test it every minute. Have a 10 second timeout on the requests.
//state.triesPerMinute = 1

//schedule("*/15 * * * * ? *", refresh)    // Option 2: run every 15 seconds, but now we have a 10 second timeout on the requests.
    state.triesPerMinute = 4
}

Does that look correct?

Not quite...

I think this is what the author intended

def updated () {
	log.info "${device.displayName}.updated()"
    
    state.tryCount = 0
    
	unschedule()
    
    if (enableDevice) {
        //runEvery1Minute(refresh)		// Option 1: test it every minute.  Have a 10 second timeout on the requests.
        //state.triesPerMinute = 1

	    schedule("*/15 * * * * ? *", refresh)    // Option 2: run every 15 seconds, but now we have a 10 second timeout on the requests.
        state.triesPerMinute = 4
    }
    
    runIn(2, refresh)				// But test it once, right after we install or update it too.
}

That is correct. And I purposely made it a code change, rather than an option in the UI, because even every 15 seconds could cause problems. You really need to try it out on your own network/wifi/router and see if there is any impact on either the performance of the HE hub, or the overall performance of your network.

3 Likes

Set your phone to static and lower refresh time.
Worked on my galaxy S8

I noticed that for some reason, It does not work on LAN devices. I cant see the code of the driver where I can change it . Also if I change the name on the app, will it affect future changes.
Or does this driver not self update.
Sorry, still a newbie to the platform.

What do you mean by LAN devices? When connected to WiFi, your phone is on your LAN.

Custom apps and drivers written by community members do not update on their own.

However you might be interested in the hubitat package manager, which substantially simplifies the process of keeping some apps and drivers up to date:

1 Like

No. This is the closest thing to an IP ping that I use to check if wired and wireless devices on my network are on. Based on their state I have certain redundancy measures in place to either reboot them or change modes..
Smartthings had host pinger.
But I find it interesting that all lan devices cannot be picked up

You need to search for the other driver for that there are 2 I think the other is called HTTP presence sensor.

1 Like

Not sure what you mean? Your phone is definitely on your LAN when it’s connected to WiFi...

I believe this driver relies on a response to an http get. It’s not an ICMP ping, so it won’t necessarily work with all devices on your LAN.

2 Likes