Schlage Z-wave Lock Command Works Occasionally

Hi,

I am new to SmartThings. I just setup the hub with my door sensor and door lock (both Schlage). I did not use the Schlage built-in auto-lock function.

I created a routine called “Door - Lock It” and it only perform locking the door command. I also set the routine to auto execute when my door sensor is closed. The routine will lock my door when I trigger it manually via the smart app. For the auto locking when the sensor closed, it works in most cases when I go in / out of my home. However, if I unlock the door, open the door, and close it within like say 3 seconds, the auto-lock doesn’t work.

I looked at the messages from the smart app and it indicated that the door lock command was sent successfully. Any idea why the Schlage lock doesn’t execute the command? Here is the sequence of events as shown on the smart app. I named the door lock as “Front Door” and the sensor as “Door Sensor”, and the routine is named “Door - Lock It”

9:57:39 - Front Door was manually unlocked
9:57:44 - Door Sensor is open
9:57:47 - Door Sensor is closed
9:57:48 - Door - Lock It sent lock command to Front Door

As you see, the lock command was sent but the Schlage didn’t execute the lock command at all. I was notified by my other smart app that the door was still unlocked a minute later. This behavior is repeatable when I open and closed the door within a few seconds. Is this an issue with the Schlage lock that it wasn’t able to pick up the z-wave lock command when I unlocked it within a few seconds?

Thanks so much for your help. Sorry I don’t know which category / tags are appropriate for this topic.

How far away from your hub is the lock? Are there any hard-wired/wall-powered z-wave devices between the hub and lock?

Hi thanks for the reply.

There are no wire or obstacle between the ST and the lock (with direct line of sight). They are about 19 feet apart. However, the ST is on my TV stand where my plasma TV, Apple TV, and some AV equipments are located.

You can’t stack too many commands on Schlage locks. Need to space them out by about 10 seconds or so. There is talk in this post ((Enhanced) Z-Wave Schlage Touchscreen Lock) about the slowness. Maybe adding a slight delay will help.

Also look at the IDE live logs it will show if the commands are even being transmitted out. What you are seeing in the app is the log from the smartApp but not necessarily from smartthings sending the command. (https://graph.api.smartthings.com/login/auth)

I had an issue with my locks a few days ago, the commands never was sent. I had to remove and re-add.

Why not just use the autolock function?

Thanks for the info. I will look into the IDE log as well and see if I can add delay to the locking actions.

The auto-lock function of the lock itself isn’t really what I was looking for. Sometimes I have to move heavy items in / out of my apartment and require more than 30 seconds (or talk to my neighbor when they pass by). The lock doesn’t know if I have the door closed yet and locking it without the door closed is useless in my situations.

A better design of the lock would be detecting the door close (by detecting the knob is next to the wall plate like the sensor using magnetism) and perform the auto-lock.

Hi,

I found out that the ST did send the command to lock the door. However, the lock does not respond at all. It might be caused by when I manually unlock the door, the lock sends an unlock status to the ST, and it requires about 4 seconds of delay before it can accept a new command. If I wait for about 4-5 seconds delay after manually unlock the door, the lock will be able to execute the command consistently. Now, what I need to do is to introduce a 4 - 5 seconds delay after the door is closed and send the lock command to the Schlage, which I do not know how to do.

The way I set up the trigger is based on “door closed” event generated by the “door sensor” using “Routine”. I created a “Door - Lock It” routine which basically lock the door, and have it trigger automatically when “something is opened or closed”, and I selected the “door sensor” with the “closed” event. There is no option to add a 5 seconds delay. Can anyone help on how I can introduce this delay to the auto-triggered routines?

May be the better way to do this is to create a smart app? I think a better solution is to have a routine that triggered when the door is closed and it will schedule a task to be run in 5 seconds. The task will then check for the door is still closed before attempting to lock the door. If this logic is better to be handled by a custom smart app, can someone help me and point me to a sample program that does similar actions? I can try to program that during my spare time (I need to learn Groovy and the ST environment which are all new to me).

Thanks for all your help.

Figure it was too quick of a send. I think it is to prevent repeated commands from jamming up the lock and possibly burning it out.

There is a smart app under “Safety and Security” called Enhanced Auto lock. The delay is in minutes, which may be to long, or maybe 0.2 minutes will work.

If that doesn’t work you can go to the code. Here it is from the smartthings repo:

To change it to seconds change line 122 and/or 115. If you need help making a smart app hit me up. Its mostly just copy and paste into the ide.

Thank you so much. I will take a look at the code and try it out. Thanks so much for your help. :slight_smile: Have a great holidays!

Thanks for all your help, @desertblade.

I spent this Thanksgiving morning putting together some code and test it out. It works exactly the way I want it to be. I have the delay set to 15 seconds (turns out 5 seconds is not enough). I also added checking the lock status after 10 seconds to see if the lock was locked successfully - my first Smart App! :smile: Now the app will lock the door if I close the door and forget to lock after 15 seconds, or lock it if I turn the knob without opening the door after 15 seconds. I use another app to monitor the door is opened for x amount of time.

I have to say, ST is much easier to setup than Vera. It took me a whole day to figure out the virtual switches, etc to program in Vera land on what I needed vs couple hours with ST IDE. May be Vera is more powerful for fine tuning but I am sold on using the ST for my home automation :slight_smile:

2 Likes

If you are willing too, I’m sure the community would love to see your work!

Sure @Benji but I am a bit shy :blush:

It’s just a simple code to do what I need based on my “forgetness” to lock the door :slight_smile: I added “checkDoorIsLocked” because sometimes I dont fully closed the door (the sensor will say door closed) but the lock will fail (the bolt not fully extended) into an unknown state. Together with another app to warn myself the door is still open, I covered all situations with my door lock.

definition(
name: “Door Auto-Locking”,
namespace: “drmilktea”,
author: “Dr Milktea”,
description: “Auto Lock the door if door is closed. Also auto lock the door if the lock is unlocked for 15 seconds. Also check for door locking failure and send push notification.”,
category: “My Apps”,
iconUrl: “http://cdn.toptenreviews.com/rev/prod/large/60623-schlage-camelot-touchscreen-box.jpg”,
iconX2Url: “http://cdn.toptenreviews.com/rev/prod/large/60623-schlage-camelot-touchscreen-box.jpg
)

preferences {
section(“Select door sensor:”) {
input “thesensor”, “capability.contactSensor”, required: true
}
section("Select door lock: ") {
input “thelock”, “capability.lock”, required: true
}
}

def installed() {
initialize()
}

def updated() {
unsubscribe()
initialize()
}

def initialize() {
subscribe(thesensor, “contact.closed”, handler)
subscribe(thelock, “lock.unlocked”, handler)
}

def handler(evt) {
DEBUG(“Detected Door lock unlock or Door is opened”)
runIn(15, lockTheDoor)
}

def lockTheDoor() {
DEBUG(“lockTheDoor fired”)
if (thesensor.latestValue(“contact”) == “closed”) {
DEBUG(“lock it”)
thelock.lock();
runIn(10, checkDoorIsLocked)
} else {
DEBUG(“Door still open, skips locking”)
}
}

def checkDoorIsLocked() {
DEBUG(“checkDoorIsLocked fired”)
if ((thesensor.latestValue(“contact”) == “closed”) && (thelock.latestValue(“lock”) != “locked”)) {
sendPush(“Door auto-locking failed”);
runIn(30, checkDoorIsLocked);
}
}

def DEBUG(msg) {
log.debug msg
}

1 Like

Would you believe that code is probably one of the easiest to read I have seen and really helps make you understand what is actually going on! I like it! Thank you very much for sharing! I still haven’t fitted any of my Schlage locks yet… really really need too!

1 Like

Glad you got it all worked out. You should toss it up on Github.

1 Like

milktea what door sensor are you using? I’m looking for similar setup as yours

I am using the Schlage door sensor but I believe any open/close sensor will work.

Ah cool. Thanks. I thought there was one built into the lock

I wish that’s true too! That’s why I disabled the lock’s auto lock function because it doesnt check if the door is locked before auto locking the door.

Hi, I’ve installed Schlage Century Touchscreen Deadbolt (BE469…) and prior to installing on door paired with SmartThing Hub. After successful pairing with Z-wave, I can see basic control such as open/close/refresh on app. Unfortunately, Schlage Century Touchscreen Deadbolt lock works great by itself but cannot operate using ST App on iOS device. I tried to remove Z-wave device and recreated pair again as directed in link ( https://support.smartthings.com/hc/en-us/articles/200969564-Schlage-Century-Touchscreen-Deadbolt-BE469NXCEN- ) but issue is still present.

When I follow steps on lock “Schlage button on the lock”++0 button then ST Hub App immediately found hardware as expected but lock amber flashing lights continue to flash for a while and then flash red X light. Could it be a reason for a problem? If yes, how to fix this? I tried 2-3 times so far removing/adding Z-wave device onto network.

Please advise
Thanks
Rakesh

Just an update.

I’m able to pair with Z-wave lock successfully after below steps

  1. z-wave exclusion method enabled
  2. on lock – SCHLAGE Button+6 digit programming code+0 – it will remove z-wave device from hub
  3. on lock – reset lock completely by removing batteries + press SCHLAGE button and same time place battery connections. It will perform factory reset on lock. One will loose all user setup.
  4. add z-wave device using ST App – it will start showing searching for lock code on phone
  5. while #4 is searching – on lock press SCHLAGE Button+6 digit programming code+0 and in few seconds app on other hand shows lock. Bingo …

At this point it will function basic stuff from ST App.

I believe a key was to factory reset lock.

Thanks

Glad you got it working. I did the exclusion before the pairing because my lock was paired with another hub before. Didn’t know this is a required steps for ST hubs…