I used the door lock code as a trigger at one time. My issue in my system was you would unlock door, open it , thus opening door contact before smarthings would change the house mode or turn off SUM.
My initial ‘edit’ remark was about having found a global ‘all valid codes run XYZ routine’ which can be ‘I’m back’ and that disarms the security status as the door unlocks. But this means we can’t ARM it without having a phone after we close the door.
What we ended up doing was making a generic code - 0000 - that triggers a goodbye. This unlocks the door, but the keypad ‘action’ field is the ‘goodbye’ routine, which then locks the door and arms the system.
It’s a little clunky but it works. Leave, close the door and punch the top ‘lock’ button, then hit ‘0000’ and it unlocks then locks again and arms the house.
This allows us to let our friend house sit for us and both disarm upon entry and re-arm upon leaving all without having direct access to the smartthings interface.
I would not recommend a code like 0000. Since the door unlocks, even if only for a few seconds, someone would have access to your home. What kind of lock do you have? Most locks have an option to allow you to use a code to lock or unlock. Having your guest use the same code to lock may be a safer option.
Fair point - I hadn’t considered that. It’s a kwikset 913. If I could trigger a response off of just pushing the button at the top of the keypad that locks the door immediately, that would be awesome. Entering the same code a second time (IE once to open, once to lock) doesn’t do anything.
You might be able to do this with @RBoy’s handler (I’m assuming your lock is Z-Wave). I don’t think @ethayer’s SmartApp has that ability yet to determine if the lock was locked manually.