Please help with code to lock a Kwikset

MrSpeed

Member
I have the zwave kwikset hooked to my HAI. I can see the status on PCAccess when the lock is opened or closed. I want a code to auto lock the door one minute after the lock is opened. The lock comes with a default 30 seconds auto relock and that is not long enough for me to walk to the mailbox.

I am drawing a blank. I imagine that I need to use flags, but if anyone has done this and would be kind enough to post the program, I would greatly appreciate it.

Thanks
 
Here's something I did for a ZigBee lock but it should work just fine for a Z-Wave lock.

First I created a flag:
Name: fZigBeeRelck
Description: f_ZigBee Relock

Next I added the following automation blocks:
Code:
230. //    ZigBee automatic relock.
231. WHEN Front Door Access Control Reader
  AND IF Front Door Access Control Reader IS UNLOCKED
   THEN f_ZigBee Relock ON FOR 60 SECONDS
232. WHEN f_ZigBee Relock OFF
   THEN LOCK Front Door Access Control Reader

This is just to demonstrate the principal so you can adjust times and lock names as needed. Also if you have multiple locks that you want to add this feature to you will have to use a separate flag for each lock.

Don't forget to write it to the controller...
 
Here's something I did for a ZigBee lock but it should work just fine for a Z-Wave lock.

First I created a flag:
Name: fZigBeeRelck
Description: f_ZigBee Relock

Next I added the following automation blocks:
Code:
230. //	ZigBee automatic relock.
231. WHEN Front Door Access Control Reader
  AND IF Front Door Access Control Reader IS UNLOCKED
   THEN f_ZigBee Relock ON FOR 60 SECONDS
232. WHEN f_ZigBee Relock OFF
   THEN LOCK Front Door Access Control Reader

This is just to demonstrate the principal so you can adjust times and lock names as needed. Also if you have multiple locks that you want to add this feature to you will have to use a separate flag for each lock.

Don't forget to write it to the controller...

This way will work if you have dry contacts on your doors If you don't you can also use messages sent from the zwave locks to trigger the flag. There is another post in the forum that explains how to get it to work with Yale locks. Zwave messages are the same regardless of the lock . That post will give you some ideas with what can be done with messages sent from devices. Read the whole thread. I found that only 1 vrc0p+3 is needed to be able to receive and program in Hai. Some of the messages given in the thread are not needed if you go the route of a single vrc0p+3. Understanding how zwave devices communicate will help you in using the "received message" program feature in Hai.

When i have time I plan on writing a help document explaing my way to deal with locks and messages they put out.

Brian
 
I setup my lock to auto relock when the door shuts (triggered by the security sensor). I didn't want to have the deadbolt extend based solely on time because one of the kids or my wife will ultimately try to shut the door with the deadbolt out and it will make a nice dent in the jamb!
 
I setup my lock to auto relock when the door shuts (triggered by the security sensor). I didn't want to have the deadbolt extend based solely on time because one of the kids or my wife will ultimately try to shut the door with the deadbolt out and it will make a nice dent in the jamb!


First thank you all for helping out. John, do you mind sharing your program. The lock extending is one of the reasons I went with this lock. I wanted to keep it from locking unless the door was closed, I curently have it on auto lock but 30 secconds is not enough for me to go to the mailbox and back. So what I wnat it to do is to lock 60 secconds after the door is closed. It should remain unlocked if the door is kept open.

I already got a couple nice dings on my door due to the lock extending while the door was open and the kids did not notice it before attempting to close the door.

Thanks
 
Very simple code:

When Front Door Secure
THEN LOCK Front Door Deadbolt


You could use a flag to set a delay if you wanted, but then you should also set code to re-check for the door being secure at the end of the delay in case someone re-opened the door during the delay period.

Our front door is left open a lot (which I'm fine with), but when it is closed, I want it secured.
 
Hi Brian,

I just wanted to correct a statement you made. You said "This way will work if you have dry contacts on your doors...". The method I posted only uses the unlock event from the lock and does not rely on anything else. This will relock the door even if you manually unlock the door but do not open it. Having said this, my example was merely to demonstrate a principal.

This method could be improved by using the security sensor on the door if one exists. Then you could prevent the lock from relocking if the door is still open. You could add an alert if the door was left open too long (one of my favorites since my grand kids periodically forget how to close doors).

Personally I am not a fan of auto relock. Picture the scenario where it normally takes you 60 seconds to get the mail so the set the auto relock to 2 minutes. Then one day you go out to get the mail. You close the door so you are not trying to air condition the city. While standing by the mail box something delays you, say your neighbor across the street asks if you saw the game last night. When you get back to the door 2 minutes and 10 seconds later you are locked out.
My preference would be a gentle reminder like a console message with beep every 3 minutes or so but that's just me. Of course this doesn't help if you leave the house and forget to lock up, but in my case when I hit the Away button to arm the security it takes care of it.

I guess I am just rambling. There is no "one perfect way" to do things so use what is useful here and select the method that works best for your lifestyle.

Thanks for choosing HAI.
 
Thanks for posting this. Understanding flags is what I needed.I wanted to added some additional functionality since I have a security zone for the front door and can tell if the door is open or closed. I wanted to lock to not relock if the door if it was open, and I wanted the timer to restart if the door was opened/closed during the countdown (for going out to get groceries, etc.) I added 2 additional code blocks to add this functionality. I kept the relock logic because it's required in case the door is unlocked but never opened.
Code:
1. WHEN Door Access Control
AND IF Front Door Access Control Reader IS UNLOCKED THEN
f_ZigBee Relock ON FOR 2 MINUTES
2. WHEN Front Door Zone SECURE
AND IF  Front Door Access Control Reader IS UNLOCKED
THEN f_ZigBee Relock ON FOR 2 MINUTES
3. WHEN Front Door Zone NOT READY
THEN f_ZigBee Relock ON    (indefinitely)
4. WHEN f_ZigBee Relock OFF
THEN LOCK Front Door Access Control Reader
 
Back
Top