Notification on Door Left Open *and* Resolution

I have a couple doors that don't always get shut all the way (or the contact sensors don't register the door getting shut). I'd like to have a simple notification when a normally-closed door appears to be open for more than a few minutes, then another notification when that's addressed.

Solutions I'm aware of:

  • Notifier can tell me when any door has been open too long, and could tell me whenever a door closes, but can't restrict close notifications to only resolutions of open notifications.
  • Rule Machine could easily trigger on any door being open for too long, notify, then wait for closure. However, I don't see a way to wait for closure of the event device in particular, so any door closing would make it think it's remediated.
  • Alternately, Rule Machine could trigger a rule on each door individually, but that requires creating near-identical rules for each door. Possible, but a pain.

Am I missing a more elegant built-in solution to this, or is this another case where the only more elegant solution would be a custom app?

I have several of these on select interior doors that have no reason to be left open.

They both can just write separate rules for each door

I have that working for my garage fridge door using a combo of Hubitat Safety Monitoring and Rule Machine.

(1) set up a custom HSM rule to monitor when door gets open too long and to notify you

(2) use one rule machine rule to set a rule machine variable to true when that particular custom HSM rule triggers

(3) use another rule machine rule to trigger when the offending door closes, if a precondition is met that your local variable is true. In the actions of that rule, set your local variable back to false, notify of door closure, and cancel the HSM alert.

(here’s my legacy RM rule, but if setting up via new RM use preconditions instead)

If you want this for multiple doors without having to create a bunch of copies of this for different doors, you might could instead trigger the custom HSM alert when any of the doors is left open, then only trigger the second rule machine rule when all of the doors are closed. Might be some corner cases missed with that, like one door being left open for too long and then another door being left open for too long as well, etc, but I think in practice it would work.