Garage Door Rule - Help

I just switched over from Wink to Hubitat yesterday and am struggling to fulfill a rule that was pretty easy to accomplish in Wink. Here is my scenario.

  1. My garage door is controlled by a switch. When you turn the switch on the garage door opens or closes based on its current state. There is a rule inside Hubitat that turns the switch off automatically 10 seconds after it turns on. Basically the switch energizes a relay that triggers the garage action. The off position means no power to the relay and no action, so open and close are both based on the On position of the switch.
  2. In wink I had a rule to do the following:
    a. Trigger – Garage tilt sensor changed to open
    b. Set timer for 1 hour IF sensor is still open then turn on garage door switch to close it
    c. However any time during that 1 hour the tilt sensor state changed to closed the timer would cancel

This is what I seem to be struggling with to setup in Hubitat, any help would be appreciated. May just been that I am new to the product and having an issue with the rulesets.

This is doable.

How about this rule in Rule Machine:

Trigger Event:  Garage sensor changed
Actions:
   IF (Garage sensor open) THEN
      On: garage door switch, delayed 1:00:00 with cancel option
   ELSE
      Cancel delayed actions
   END-IF

Walking through this, garage sensor opens (a change presumably), start the 1 hour timer (which we set to be cancelable). If the hour passes and the garage hasn't closed, throw the switch to close it. But, if before the timer runs out the door is closed, cancel the delayed action.

Note that the action of closing the door, whether done by the rule or from some other source, will trigger the rule. But if the door closes, it will run the ELSE part of the rule. That's harmless unless the timer was running, in which case, it cancels the timer.

1 Like

Bruce beat me to it, but I'd hate for the test rule I created to go to waste, so here's something that's almost the same thing:

image

(I did use a separate delay action instead of a delay on an action, which gives you the flexibility to more easily add other actions after this if you want--say, a push notification that your door was automatically closed. Everything after a cancel-able standalone "Delay" action will get cancelled, but if you only have one action and set a cancel-able dealy on it, there is no effective difference.)

1 Like

Haha, you beat me to it too. Here is the other form:

Notice that mine says "cancelable". That's a UI change coming in the next release.

Hey @chad2, less than 15 minutes and you've gotten two solutions! That's pretty much the way things roll around here until you come up with a real stumper.

4 Likes

Wow I was not expecting to hear anything until at least tomorrow.. you guys are awesome. I am still having a bit of trouble with the rule. Maybe due to basing the trigger on the tilt sensor and not the switch action.. Ill post an update soon once i play a bit.

So unfortunately it seems to not work, the premise is there i think but something is different in my setup causing it to not work. BTW for testing i set it to 2 mins and not 1 hour. After 2 mins if the door is open it closes it. However after 2 mins if i already closed the door it opens it. It's currently a 2 min revolving door .. lol

Welcome to Hubitat!

Please post a screenshot of your rule as that is the easiest way for the community to help debug it.

1 Like

Got it ... thank you guys so much.

1 Like

Sounds a lot like you didn't set "Cancel" on your delay (or delayed action, depending on how you have it set up), but if the above doesn't mean that you figured out the rule, feel free to post for help. Good luck in either case!

This also works well

You'll want to make your trigger "Garage tilt changed" rather than "Garage tilt opened," otherwise your ELSE will never be true so your delayed notification will never be canceled (so they'll all pile up from each time it opens). Also not sure why you have two separate delays, inside and outside the IF--probably want to move the first inside to delay the closing and notification by 45 minutes (plus a few seconds of separation, apparently, for the next items). Otherwise, looks good!

Hmm.. It seems to be working perfectly for me so far. It starts when the door sensor goes open. Waits 45 mins then checks to see if the status is still open. If so it closes the door, else it cancels everything. The tiny delay there is so that line can be canceled. Working great.

Ok, I understand where you're coming from now. In most cases that will work. It will still fail as I described in some cases because it's not really checking if it's been open for 45 minutes but rather checking 45 minutes after it was opened (every time) if it's open (from any time, even if you closed it then opened it 44 minutes later and it's only been opened for 1 minute).

1 Like