How do I make only the FIRST CHANGE of my multiple presence devices stick?


#1

I have had some flaky behavior with presence devices not triggering when they’re supposed to, so right now I have WebCore Presence, SmartThings Presence, and Life360 Presence set up. I’ve got it set so that if any of the devices presence changes it sets a variable “wifepresent” to true or false. Same setup for my own presence. I’d like to use that variable to trigger arrival/away pistons, and I like the redundancy of having 3 different presence devices “watching”.
The problem is that it seems like after one presence device sets the variable to “away”, if the other one is still close to home it’ll set the variable back to “home”. It’ll bounce around until it finally settles, but it ends up triggering my “back home” piston before it stops oscillating.
Is there any way to make the FIRST state change stick and ignore the rest? I considered PAUSING the piston after the first run, but then it wouldn’t catch my wife or I after the other one has left/arrived. I suppose I could make 2 separate pistons, but that seems unnecesary.

So, in summary, how I can I make this work? It would work if I could do:

If $presencedevices changes to not present
AND
_variable(wifeaway) has not changed in 2 minutes_

but there doesn’t seem to be an option to see if that variable has stayed the same over a period of time.

Here’s my piston:

Thanks for your help!


#2

You could use something like this, I set a variable “Timeout” at some point in the future. Add a condition that checks the current time is later than what is stored in “Timeout” and you’re system will ignore changes in status prior to that.

You’ll just have to adjust the addMinutes($now,xx) to whatever amount of time you want your system to be blind to changes.


#3

I have something kind of similar for mode changes. I have a variable called “recentmodechange” that will change to “true” when mode changes, and will turn back to “false” after 5 minutes. I was hoping to avoid 2 extra “timeout” variables, one for each of myself and my wife. Thanks for the suggestion!