New User Multiple waits running simultaneously

I just ordered a hubitat hub. I am moving from smartthings. I have been doing lots of reading here on the forums so I am ready when the new hub arrives.

I currently have a fairly basic piston in webcore called bedtime. When triggered it turns off the lights and television in my living room and turns on the light and television in my bedroom. It then waits 2 minutes and turns off the bedroom light and waits 90 minutes and turns off the television.

My question is this. Can i set something similar up in Rules Engine and have the timers run simultaneously or will one timer not start until the first one has completed?

Yes you can no problem.

As mentioned above, this is certainly possible. In Rule Machine, it sounds like you want a "Delay" here. There are "Wait"s in RM, but they're a bit different. Something like this would work:

Trigger events: whatever you use for this :slight_smile:

Actions to run:

Turn off: Living Room Lights, Living Room TV
Turn off: Bedroom Lights --> delay 0:02:00
Turn off: TV --> delay 1:30:00

When you set a delay on an action like that, the delayed action is scheduled for that far into the future, while the rule continues immediately to the next action (which here would be just scheduling yet another delayed action then exiting). But I don't see why the "one timer not start until the first one has completed" thing would be a problem. RM has actions like that, too--a standalone "Delay" action. But you could achieve the exact same result that way, too:

Actions to run:

Turn off: Living Room Lights, Living Room TV
Delay 0:02:00
Turn off: Bedroom Lights
Delay 1:28:00
Turn off: TV

That being said, I have a couple "timed" rules like this and happen to like a way to back out if I want. It's only a bit more complicated (I keep a virtual switch turned on while this whole "timed" thing is going and assume that if I'm turning that switch on, I want this all to start, and if I'm turning it off, then either it ended on its own or I decided to cancel it mid-way through myself), something like:

Trigger: Virtual Switch Z changed

Actions:

IF (Virtual Switch Z on) THEN
  Turn off X
  Delay 0:02:00 (cancelable)
  Turn off Y
  Turn off Virtual Switch Z
ELSE
  Cancel Delayed Actions
END-IF

So, here I've made the delays "cancelable" and added a "Cancel delayed actions" action (which will cancel those delays and anything after it that hasn't yet run--which for a standalone delay will be everything), so I can manually turn that switch off if I decide mid-countdown that I've changed my mind.

Might be more than you need to know now if you don't even have a hub yet, but I thought I'd just show a way I do something similar to what you're asking. :smiley:

Thanks so much for the info. Can't wait to get the hub and start playing.

The biggest piece of advice I can give is go slow. If you do too many things at once you may have conflicting rules and then narrowing down why something isn't working like you want can be a pain. At least rules, and devices for that matter, can be easily disabled to help when trying to figure out why something did what it did. I've never not found the answer by just taking time to go through it.

1 Like