Conditional Action

If a rule has a conditional action, does it require a trigger.

My rule is simple, if everyone’s phone leaves the house, lock the door. Only way I could get it configured is with a conditional action

This is how I would write the rule. Well, it's how I wrote my rule. There are a bunch of right ways to write it.
triggers:
phones x,y,z presence changes

If presence x,y,z all of these is away
then
lock the back door.

1 Like

End if

2 Likes

Thanks!
Does this look right

Most rules will contain a trigger to initiate the actions within the rule. Something has to occur for the actions to be executed. To answer your question though, rules do not require a trigger. You can call rule actions from other rules. I do this quite extensively. I have actions that I want executed when various things happen. Instead of incorporating those actions into multiple rules I create one rule with those actions and call that 'action only' rule from other rules.

4 Likes

Add an end if.

2 Likes

Another thing to consider is the fact that a single presence sensor is usually not that reliable, for various reasons. Most users use some sort of presence aggregation to solidify this. There are multiple threads that touch upon this. I have listed one below along with a presence search link. I would recommend reading through those to get a better understanding of what you can expect.

https://community.hubitat.com/search?q=presence

2 Likes

I personally have great success with one precense setup.

I use homebridge/homekit that does this very well.