Help with Unlock Rule Please

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:

April,

I was just asking as my door unlock (like me using Hubitat) is rather new. I only set the unlock up 4 days ago. I initially tried it with using the iPhone and found that sometimes the location of the phone would be just outside the defined presence area. Once I opened the Hubitat app, it then moved inward to my current location. So I swapped to the SmartThings Arrival Sensor and it's been accurate both in testing and regular use. I may open up the defined area in the Hubitat app and use an AND statement requiring both the iPhone and the Arrival sensor presence to trigger the unlock event since I normally carry both the phone and my keys which has the Arrival sensor on them.

Bill

1 Like

The error you see in post 20 isn't really a concern; it just means you're running "Cancel Delayed Actions" when there isn't any currently-delayed action to cancel. (I'm not sure whether staff considers the throwing of this error a bug.)

I'm not sure why your rule wouldn't be working. My guess is that the Private Boolean on Rule 1 isn't getting set back to False, which could happen if your presence sensor went away and came back (without your knowledge), which would restart those 5 minutes. Turn on at least trigger and actions logging for this rule and see if that's the case. I'd do that for Rule 2 as well so you can verify its execution path.

Ok, Thanks

Just wanted to follow up and let you know the rule is working correctly. Thanks again for your help

1 Like

No problem. Glad to hear that it's working well!