Currently, I have my Hubitat sending me a notification when a contact sensor on a door is open and when it is closed. The problem is, I get constant back to back notifications every time the door is open and then immediately closed.
What I would like to do is have a single notification go out letting me know the door was opened and then closed if the open and closed event happen within a 5 second period of time, otherwise, I would like to get notifications from both individual events.
I know there are probably several ways to tackle this problem, but what is the simplest way to go about it?
Update: I got it working. This is how I did it
- I created a boolean Hub Variable 'FrontDoorOpen' and gave it a connector type of switch.
- I created a Front Door Opened rule that triggers when the contact sensor is open and sets the FrontDoorOpen variable to true.
- I created a Front Door Opened Notification rule that triggers when the FrontDoorOpen variable has been set to true for 5 seconds and then sends me a notification that the front door was opened. It then sets the FrontDoorOpen variable to false.
- I created a Front Door Closed rule that triggers when the contact sensor is closed. It then either sends me a front door was opened and then closed notification if the FrontDoorOpen variable is set to true or just a front door was closed notification if the FrontDoorOpen variable is set to false. It then sets the FrontDoorOpen variable to false.
I wish there was a way to put multiple rules in a group and treat them as a set.