Purpose: to provide presence notifications for two users
Problem: I get too many messages to my phone as it is. I don't need a message telling me my wife has left the house when she is in the car with me. I already know that. The idea here is to have RM wait to evaluate the rule and make sure that we both haven't left the house at nearly the same time.
I managed to get this into 4 rules. for more than two users it will require quite a few more rules since you can only choose one switch to act as a restriction.
I also created two virtual switches:
vpresencechangeUser1
vpresencechangeUser2
I've been using it for the past couple of weeks and it seems to work pretty well.
@bravenel I'd also love to be able to refine my time delays to less than one minute. For some reason that is only allowed when turning on or off switches, but not when delaying rules.
Notify Presence User 1 Trigger
Trigger:User 1 arrives or User 1 leaves
Action:
On: vpresencechangeUser1
Delayed off: vpresencechangeUser1: 75 seconds
Rule Boolean True: Notify Presence User 1 Rule: Delay 1 min
Rule Boolean False: Notify Presence User 1 Rule: Delay 2 min
Run Rules: Notify Presence User 1 Rule: Delay 1 min
Notify Presence User 1 Rule
Conditions/Rule: User 1 present
True:
send message: User 1 has arrived!
set rule boolean false
False:
send message: User 1 has left.
set rule boolean false
Restriction:
Switch to disable Rule: vpresencechangeUser2
Enable/Disable with private Boolean
Notify Presence User 2 Trigger
Trigger: User 2 arrives or User 2 leaves
Action:
On: vpresencechangeUser2
Delayed off: vpresencechangeUser2: 75 seconds
Rule Boolean True: Notify Presence User 2 Rule: Delay 1 min
Rule Boolean False: Notify Presence User 2 Rule: Delay 2 min
Run Rules: Notify Presence User 2 Rule: Delay 1 min
Notify Presence User 2 Rule
Conditions/Rule: User 2 present
True:
send message: User 2 has arrived!
set rule boolean false
False:
send message: User 2 has left.
set rule boolean false
Restriction:
Switch to disable Rule: vpresencechangeUser1
Enable/Disable with private Boolean