Locks

I have wrote a app to lock my kwikset after 5 min of it being unlocked. If someone comes home I have it unlock so I want it to auto lock back.

I have used

input “lock1”, “capability.lock”

def lockOpenHandler(evt) {

lock1.lock(delay: 300000)

}

It works fine but I was reading in the manual you have to use a encapsulation command when you work with locks? Can anyone else provide any insight to this?

Sorry miss understood where the encapsulation is used. It is used in the device type handlers and not in the smartapps directly.