I have the following Legacy rule that has worked great for several years now. It's and either/or Presence using two devices in two different vehicles and a Virtual Presence. I would like to update it to 5.1 with the added function of waiting "X" amount of time before showing "NOT Present" only. The two devices have a maximum delay of 15 minutes and would also affect being PRESENT as well. I live in town and lots of times I just run down the street to grab something and really don't want it to switch to "NOT Present" immediately and start other Rules/Scenes unless I'm really going to be gone for a while.
It is super easy to do. When you chose the presence trigger event, you will have the option to selects how long it remains in the state before it triggers.
I think it's going to be a little more complicated. I don't think you'd want the Stays for 15 minutes on the arrival so you''ll probably want a trigger for away with Stays and a trigger for arrival without. I also think you'll need a boolean to so that when you're away for 10 minutes your return won't run any actions.
Unfortunately I am Boolean ignorant! Never been able to wrap my head around it. An example would be greatly appreciated.
You could split the rule in 2: One for departure with a delay, and one for arrival with no delay.
Hmmmm. Interesting
Create a local boolean variable in the rule, something like LBV, and set it to false if both presence sensors are home.
IF (Terry2 Presence, Terry1 Presence all present AND LBV = true) THEN
arrived() on Terry
LBV = false
ELSE-IF (Terry2 Presence, Terry1 Presence any not present) THEN
departed() on Terry
LBV = true
END-IF
Or here is an easier option that should work with no boolean
Trigger
Terry2 Presence, Terry1 Presence any departs and stays that way for 0:15:00
Actions
departed() on Terry
Wait for event: Terry2 Presence, Terry1 Presence all arrive
arrived() on Terry
Thanks everyone for your help. I'm gonna play around with some of these ideas.