A rule to announce doors/locks remaining open

I want to create a rule that notifies me when a door has been unlocked or a garage door has remained open for a certain period of time, say 15 minutes. Ideally it would send a notification every 15 minutes until the door has been locked/garage door has been closed. Initially the rule can send me the notifications to my iOS devices, but eventually I want it to notify us via Alexa. I have Echo speaks but haven't figured out how to use it yet. I tried to create the rule in Alexa itself but it doesn't appear to have the tools needed to create such a rule.

Could anyone share a rule or suggest a rule configuration to make this work? I've made quite a few rules but have only explored a few of the options available and when I tried to create one for this, the way to do it was not obvious to me.

I would start with the built-in Notifications app and see if it does everything you need. Sounds like it should:

(Alexa is a separate issue; to get notifications there, you'll either have to use a virtual sensor and an Alexa routine that speaks something--and on the Hubitat side you'd need a rule to make this sensor active/open--or you could set up something like Echo Speaks to get a "regular" TTS device you can use in stock apps like Notifications and send arbitrary text from Hubitat that way.)

1 Like

Cool! I wasn't even aware there was such an App. So here is what I have, as an example for my door locks. I want this to tell me in 15 minutes if a door is still unlocked, and to keep notifying me every 15 minutes if it is still unlocked. Tell me if this looks right:

In this rule there wasn't an option to do repeat notifications. But, I made another version of this rule for my garage doors being open, and I checked the "Stop repeat upon next event" but I'm not sure what that means - perhaps when something else happens to the garage door (i.e. it is closed) then it stops the repetitions?

If you do go with rule Machine, here's my front door rule which includes notifications if the door is open more than 5 minutes. At one point, it also announced the message through our google home, but it looks like I have removed that. This rule is a couple of years old, so it may well be that there's a better way to do it now, but it works.

1 Like

That should work, except I'd use a separate instance of the app for each. If you put them all in one app like that, you'll get unexpected results: say, you open Back Door at (let's say) time 0, then open Front Door 10 minutes later. Five minutes after that--not 15 minutes--you'll get a notification that "Front door is still unlocked." Keeping them in separate apps will track each device separately, which is probably what you want.

And yeah, not all the options in Notifications let you use repeats. I'm not sure why--perhaps they just added it to the ones they thought would be most useful. With a rule, of course, you could do anything you wanted. For examples of that, I'd take a look a the patterns in this thread:

1 Like

For the notification part, you might want to take a look at the excellent Device Status Announcer app, available via Hubitat Package Manager. This helpfully notifies you which specific door(s) or window(s) are open if you have several of them. You can then pair it with a simple RM rule to trigger the notification every n minutes until the doors and windows close E.g. below is the rule I use to remind us every 20 minutes that the garage and/or front door are open (we use a second hourly rule for the back door and 16 windows):

A few notes on this rule:

  • The private Boolean logic ensures that reminders for multiple open doors are synchronized every n minutes, to avoid a cacophony of rolling announcements if several doors or windows are open.

  • To send a notification (announcing on Alexa, in my case), the rule turns on a virtual switch (with auto-off enabled) which triggers Device Status Announcer.

  • You can ignore my final IF statement for cancelling HSM alerts. It’s only there because I use HSM to announce when a door or window first opens (“X opened”], and use Device Status Announcer for left-open reminders (I modified it to say “X is still open”), to differentiate between opening events and reminders.

1 Like

I use SharpTools to text me when the garage has been left open for one hour and again at two hours and again at three hours.

I also have a cam in the garage to visually confirm as well as record garage activity.

The SharpTools rule is very simple and works perfectly.

We were out of town. Daughter was home alone.

1 Like

I was using this for a daily check of doors at 9pm. Most of my notifications are silent, but SMS is set to vibrate, so this was a great option for getting attention. I also make good use of the garage cam, so I am wondering if I am literally just copying everything that you do.

Recently, though, I moved it over to webCoRE using a device list. It caught one offender in the first two weeks (dang shed door).

1 Like

I do something similar in SharpTools, but with multiple triggers as I wanted different timing for the different garage doors.

This uses the 'Context Variables' feature to dynamically grab the device name and put it in the message similar to your notification.

2 Likes

I am brand new to both Hubitat and creating rules. I want to create a notification rule that the garage has been left open, is there a better way that the rule below?

Probably; periodic triggers are rarely the best way to do something in an event-based system, where it generally makes more sense to respond to an event, like the door opening.

I might suggest something like:

Trigger: Door 1 opens and stays that way for 0:10:00

Actions to Run:
Notify/Speak "Garage door left open"

There are ways you can get fancier with repeated notifications if it stays that way (and the relatively new "and stays" feature for triggers makes writing this kind of rule easier now than it may have been in previous examples, if you found any), but that's the general idea!

Thanks! Yes, i was trying to figure out how to do repeated notifications if it stays open beyond the initial "and stays" clause. I can't figure out how the Wait and Delay functions work in the Rule engine. Pardon the very basic questions, I am trying to figure this out!

You shouldn't need delays to get the repeat; the repeat has an interval specified, which will take care of the timing in between.

The post I linked to above is a bit old now, but everything there will still work and shows how you can do this:

There are also examples of some newer "Repeat" features in the docs that might make some of these easier to write, though there's no reason you have to use these features if the "old" way still works:

But if you are still curious about delays, etc., the docs have lots of information there, too, so I'd encourage a read.

Good luck!