Lock states and logic issue (2.2.4.148)

There are many ways to handle this.

The first thing I would suggest is that you probably want to use a door sensor so that this has something easy to trigger from, and also you aren't just going to be locking "into thin air" when the door might be open like when you are bringing groceries in from the car or whatever.

Next, community apps are very helpful. Here is one example (might be more) that can do what you want.

Lastly, there are lots of examples in this forum of this. Probably one of those would be a good example to start from.

https://community.hubitat.com/search?expanded=true&q=auto%20lock%20door

2 Likes