Trigger required?

Does a rule have to have a trigger if you use conditional actions?

Yes, the trigger is what causes the rule to be run.

No rule has to have a trigger, but with out one, your actions will never run unless you run the actions from another rule (this is an option--a possible action in a rule). However, I'm guessing you are thinking of a rule like this:

IF (Motion is active) THEN
  Do something
ELSE
  Do something else
END-IF

...which you want to execute on its own with changes in motion. In that case, you need a trigger, with the most likely one you want here being "Motion *changed*". This is what is alluded to in the post above. If you're asking this question, I'm assuming you may have come from ST/WebCoRE, where a piston like the above would create subscriptions for you (that is what the lightning bolt icon in the WebCoRE IDE means). Hubitat makes you specify themselves, and there are times when you may want conditions that don't trigger anything (or triggers that aren't part of your conditions), so this comes in handy.

As always, the Rule 4.0 docs are good reading if you plan on using the app. You can see lots of examples there, plus some explanation of triggers, which are somewhat new to 4.0 (3.0 had triggers as a rule type that were similar, but many rules were created with the old conditions, rules, and actions for true vs. false format that didn't have explicit triggers like this, so there is a lot of explanation).

Thanks. Trying to run a rule that if everyone’s phone leaves and all doors are closed, set the status to Away. I’ve set the trigger to, when the garage closes
(separate rule takes over from there). Does this look correct?

No, I'd do it more like:

Triggers: iPhone 1 leaves OR iPhone 2 leaves OR ....

Actions:

IF (iPhone 1, iPhone 2, ... all not present) AND (Door 1, Door all closed) THEN
  Mode: Away
END-IF

You probably don't really really want to trigger on the doors changing--you want to trigger on the phones going away. When they've all gone away (going away = trigger), you can check if the doors are closed (= condition) and then proceed from there. Nothing will happen if all are away and then the doors all close, but I'm guessing that's not something you really need to account for. If you do, then I think it makes sense to add the doors closing as a possible trigger. (Also, nothing here will handle setting the mode back from away, but I'm guessing you have something else to handle that.)

1 Like

Thanks

Thanks again, does this work better.

1 Like

Be careful with this....your trigger is only based on the presence sensors. If a presence sensor goes not-present when one of the contact sensors is open, the house will never go into away mode because the contact sensors are not triggers as well.

Would you recommend adding contact sensors to the trigger?

That all depends. What type of presence solution are you using? Do they only go not-present after a timeout or do you use any virtual sensors that you sometimes set manually? You don't want to have too many triggers but at the same time, you don't want to not have the house go into away mode either. Also, do your presence sensors reliably return from being away? Adding the contact sensors as triggers could cause the house to return to away mode when someone returns if their presence sensors is delayed in returning.

I’m using our iPhones as presence sensors in Hubitat and Life360.
Was going to start playing with PresenceGoverner

I'm kind of thinking the same thing as @Ryan780

What if everybody leaves but the last person out forgot to close the garage door as they were pulling out of the driveway? The house never goes into away mode and your garage door is sitting wide open all day.

I'd personally set the house to away based on all the presence sensors leaving, this can be done in mode manager without a rule. Especially since you'll be using presence governor. The combined presence logic makes it nearly 100% reliable (WiFi and then multiple geolocation options).

Then, created a rule with the trigger of the mode changing to away to check to make sure all the doors are closed. If one is open, send a notification saying "The front door is open and nobody is home" or something to that effect. You could also use this same rule to turn off lights, drop the heat, lock doors, etc.. etc.. If it's a garage door and you have it automated, you could also use that rule to close the door.

1 Like