Help with Unlock Rule Please

Have a Rule in 3.0 for this but having trouble figuring it out in 4.0 plus wanted to modify slightly. When either wife or I become present and door is locked, then when outer storm door is opened (there are sensors on both doors) unlock door. Also, want some kind of cancellation after say 5 minutes, whereby if we donā€™t use that particular door the Auto Unlock part will cancel. Any help greatly appreciated.

The way that I would do this is to remove the requirement for the door opening to trigger an unlock. Just unlock when your presence changes and then auto-lock after [x] minutes if the door hasn't opened.

I created a custom app for mine, but I'll see if I still have the auto-lock rule running around in a backup.

Found them: Best way to automate door locks

Because I have the lock set to automatically lock, just the presence didn't work because it would autolock before I got near the door. I did something similar to what the OP wants:

1 Like

Thanks

Just want to make mention that presence (not just hubitat presence) but life360 presence also (because I have it) has been shaky. Some people have just mentioned false arrivals, so I'm not hatin', I'm just asking that you are careful with this rule and base it on more than one condition or your door may be unlocked with you away. I'm just looking out for the better interest. I'm all for convenience.

April,

Does this apply to the SmartThings Arrival Sensor? Other than battery issues (contact loose or low battery), I've not seen any issues with it. Just out of curiosity I look through the Events for the device and don't see mismatched arrived/departed.

This is certainly do-able, even with the 5-minute "timeout." To keep things simple (Bruce's rule with RM: KISS), I'd use two rules. It's also worth noting that, as April hints, staff have recommended against using presence for unlock automations, so I'd proceed with caution. I suppose that having the door criterion adds a bit of a safeguard to this, at least.

Here's my idea:

RULE 1

Triggers: Back Door opens OR Front Door opens

Actions:

IF (Private Boolean is True) THEN
  IF (Back Door open) THEN
    Unlock: Back door lock
  ELSE-IF (Front Door open)
     Unlock: Front door lock
  END-IF
  Set Private Booleans False: This Rule
END-IF

RULE 2

Triggers: Presence *changes*

Actions:

IF (Presence is present) THEN
  Set Private Booleans True: Rule 1
  Delay 0:05:00 (cancelable)
  Set Private Booleans False: Rule 1
ELSE
  Set Private Booleans False: Rule 1
  Cancel Delayed Actions
END-IF

Can you tell me what I did wrong?
AU1 AU2 AU3

Put the delay in your second rule as a separate action, not a delay on the first action (or just apply it directly to the second, but my personal preference is discrete delay actions). The rest looks good!

Like this?
image

Or better yet, I think this is more like what you meant. Correct?

image

The last option is very close to how I have my rule written, but you're missing "cancelable" on the Delay. Other than that, it looks good to me now.

Is that why it still opened after 5 minutes???

Just tested this. Still opened after 5 minutes.....
image

Did you generate a departure and arrival event from your presence sensor before testing? Maybe I missed some logic somewhere, but an arrival event is definitely something you'll need to make this start working.

No i just did "Run Actions" form app screen

I don't believe so. But I don't believe you mentioned that before. I've had friends that set up rules like this and I have driven by to find their garage door wide open and no one home. So I just like to make sure people who set these automations up stop to think about the best way to prevent a false arrival.

No only HE App presence and Life 360

Lately, my husband has been arriving home 10 minutes after he actually gets there via life360. We both have the same phones. Mine reports a bit sooner. I haven't troubleshot it yet, but you could probably build in conditions that would prevent having to wait if your reporting gets slow. LIke wifi connectivity with the community app. Works pretty well for connections, but will fall off if wifi goes to sleep.

With the latest version getting this error: