Example of simple anti-flaping mechanism for Presence

No the group represents if someone is home or if everyone is away.
The timer is just a timer

Right, the magic is making the expire timer a member of the Group as well, so it acts as an Group ON-stretcher

The bit confused me was rule trigger changed to ON - you really want any change (including to OFF)

1 Like

Correct

Why? Explain your thinking?

A change indicates activity. A phone may drop off because it’s been turned off, or the owner has walked from here to there. Leaving the building is only one possible cause.
Just me I suppose; for motion sensing I start a timeout from “off” i.e. motion ceased, because that is the interesting part.

fair point for not being phone centric :slight_smile:
you need to get some smart wifi watches for your family this christmas, wearing is mandatory! :slight_smile:
btw the phone is not suppose to decide to burn your data (you might not have a data plan active at all) if wifi is available. I had mobile data off and never lost push notifications regardless of deep sleep

disclaimer: I am not iphone fan and never used it :slight_smile:

your real world is different then mine, I am in 1550sq ft apartment on high floor, there is no house or huge back yard involved, people don’t wander off leaving the phone in back yard, front porch etc

wifi coverage in the entire flat is excellent with single access point, if the phone is offline it is not in the apartment, period. so the timer of few minutes is all I need to override hickups.
samsung S8 with official firmware never lost wifi coverage in the apartment whatsoever, but if you are open source enthusiast with unlocked bootloaders and unofficial LOS firmware without google services, you might experience hickups :slight_smile:

I missed the magic. That is a clever way to handle it indeed! I may have to revisit my tutorial.

It depends on how the motion sensor works really. Some report every motion detect and that’s it. Just a series of ON/OPEN updates. Other report motion and then after a time of no motion report OFF/CLOSED. Most will have a sleep period after motion is detected in which it will not report new motion. In the case where the OFF means that there has been no motion for that time period and doesn’t necessarily line up with the time of last motion. So it depends on what your use case is as to which event is most meaningful.

For example, if you want a shorter time than implemented by the device you can only use the ON/OPEN events. If you want a longer time than you can either use the ON/OPEN events with the amount of time you actually want to delay since the last motion, or use the OFF/CLOSED events with the amount of time you want after the last motion minus the time built into the device.

Clever idea if you rely on phones only. A bit more tricky when you have implemented wasp-in-a-box and your home door sensor resets all presences to “OFF”.

Allowing your phones to immediately set their respective presence back to “ON” creates some issues when you leave your home, lock the door, and your phone happens to connect again to your WIFI, from outside your flat (i.e., from your door mat). I need a grace period, too, for going back to “ON”, it seems.