[Depricated] Lock Code Manager

Yes, it monitors my doors. So far those are the only contact sensors I have installed so far. My plan is to add sensors to the windows over time.

Ok got it. In my use cases with cleaning people and contractors, Armed-Stay won’t work since they frequently go in and out of the house to get supplies/materials. This more like for Night mode when people are sleeping and don’t want the motion to trigger an alarm when you make a midnight run to the kitchen or bathroom :smile:

For now, Lock code manager and native ST routine with “Things Quiet Down” is probably my best route. Even then, if my wife is home when cleaning people/contractor shows up and then she leaves, the house will go into Away Mode and alarms were start triggering,

I have my setup to only arm stay when the doors are locked, so if they were to unlock the door to go out and get something it would disarm.

Also, the middle of the night bathroom run in addition to cats that occasionally go crazy at night are reasons why I don’t use the motion sensors for alarms, even in away mode.

I understand that every use case is unique. I was just hoping that I could spark some ideas for you with what I have done. I think one of the great things about ST is the flexibility of the system to configured how it meets your needs.

The ST team and community really make this a great platform.

2 Likes

I am curious if my lock (the Yale Zwave touch screen lock http://www.yale2you.com/Products/Keyless/Oil-Rubbed-Bronze-YRD120-Keyless-Entry-Deadbolt-To.aspx) can report different codes back depending on how the door was locked. For example, Does it know the difference between using the thumb turn from inside, a zwave signal to lock, or manually locking it from the outside. If it does, then I imagine it can be coded to trigger the Armed (Away) mode when you lock it from the exterior manually, and trigger the Armed (Stay) mode if it was locked by a zwave command, or the thumb turn.

Did you trigger this within lock code manager? If so, how do you handle away day vs away night in order to disarm / arm?

I assume you can’t select multiple modes from within lock code manager without is causing confusion.

I use “Code on Unlock Too” to fire the routines.

In my situation my Armed Away and Armed Stay function the same since I don’t use the motion sensors due to pets.

For each lock I have a copy of “Code on Unlock Too”, an Arm routine and a disarm routine. I leave the actual codes blank, just set the labels in COUT. COUT calls the Arm routine whenever the lock is locked, and calls the Disarm routine on any unlock. In the disarm routine I set SHM to Disarm. At this time this is all it does. In the arm routine I set SHM to arm and lock the other locks.

I use “Lock Code Manager” to managing the schedule of when codes are available. I have an instance running for each needed schedule.

I had only set this up this weekend, so as of last night I had not been running this much. Since then I have run into a slight timing issue. If I am too quick to open the door after an unlock I get an alarm in SHM. I think this is where an alarm delay in SHM would solve the issue. At this time I have not looked into if that is a planned update to SHM or not yet.

I hope this clarifies what i’m doing and how it works.

Hello @ethayer, thank you for sharing your awesome code! I was trying to find a way to configure a small number of access codes that will be disabled when we are at home or during specific day/times. I would like to do this to keep ‘services’ out of the house at any time other than when they are allowed in, or to keep relatives from entering the house instead of ringing the doorbell and letting us open the door (having the code doesn’t mean you can just walk in whenever you please… family or not). The first goal is for added security, the latter is just to combat bad habits that won’t go away even with kind reminders.

I am using the “Century Style Schlage Connect Touchscreen Deadbolt” on my front door and really like it. The biggest issue was the pin code management which you have resolved!

Would it be possible to have one or two codes that always work (not affected by schedule or other limitations), and a couple codes that are based on a schedule (plus any other applicable limitation)? An example limitation would be to only allow a code to work if the house is in “Away” mode so relatives cannot enter the house (without being let in) unless we are away (ie: to let the dog out).

I get the impression that the current code sets all users to the same schedule. Is that correct? If so, do I have to install multiple instances to set different schedules for different users?

BTW, the device type I am using was written by @garyd9 (Thank you!!) and was recently updated to support your smartapp.

My lock: http://www.schlage.com/en/home/products/BE469NXCENFFF.html?bck=@@sch-us:brand/schlage@@sch-us:product/deadbolts/touchscreen@@sch-us:product/deadbolts/connectedDevice@@sch-us:product/deadbolts@@sch-us:electronics/zwave

Create a new instance of the app.

Because of limitations on the scheduling calls, and for simplicity sake… any user(s) whom have different scheduling needs from other users should be initiated and handled by a different instance of the app.

This may change as ST evolves.

I migrated over to the new hub yesterday and since then my Kwikset 916, which has been working perfectly, no longer reports the battery level. Anyone else with similar problems?

I have a Schlage and occasionally it has helped me to do a battery pull/disconnect/connect and get the right status. Thereafter it works fine.

1 Like

Give it time. The poll is ridiculously long on all parameters. Can take a day or so for it to show up. Unless the battery level actually changes.

1 Like

Thanks to both of you. I’ll give it until tomorrow and then pull the battery if nothing by then.

I am glad you mentioned this! I performed the “nightmare” V2 hub migration yesterday in the AM sans SmartThings support :confounded: and have missing battery status.

The Kwikset SmartCode™ 916 Touchscreen Electronic Deadbolt with HomeConnect™ technology has been included in my V2 Hub network for over 24 hours and as of 3:00 EDT, I have no lock battery status. The tile has a field for the value, but is waiting for a value. I have pressed the refresh button several times still no battery status. Battery status was woking perfectly on V1 hub.

I also notice that SmartThings marketing staff and Kwikset must be feuding because SmartThings UI does not recognize the Kwikset 916 as a supported lock. The 916 is in the family of the Kwikset Zwave 914 which SmartThings does support `> (and “Yes”, I have asked SmartThings support about why they do not have the Kwikset 916 lock listed. Smartthings support provided no response to my requested email…which is typical!)

Luckily the Kwikset SmartCode™ 916 Touchscreen Electronic Deadbolt with HomeConnect™ will emit a short alert tone after each open and close when the battery level is less than ~40%. According to Kwikset technical documents, based on 10 operations per day, a single, new set of Alkaline batteries will operate the lock for over a year.

I am using @ethayer 's “Zwave Lock Reporting” device type with capability “Battery” which was working perfectly in V1:

valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") {
  state "battery", label:'${currentValue}% battery', unit:""

// Only check lock state if it changed recently or we haven't had an update in an hour
def latest = device.currentState("lock")?.date?.time
if (!latest || !secondsPast(latest, 6 * 60) || secondsPast(state.lastPoll, 55 * 60)) {
  cmds << secure(zwave.doorLockV1.doorLockOperationGet())
  state.lastPoll = (new Date()).time
} else if (!state.MSR) {
  cmds << zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
} else if (!state.fw) {
  cmds << zwave.versionV1.versionGet().format()
} else if (!state.codes) {
  state.pollCode = 1
  cmds << secure(zwave.userCodeV1.usersNumberGet())
} else if (state.pollCode && state.pollCode <= state.codes) {
  cmds << requestCode(state.pollCode)
} else if (!state.lastbatt || (new Date().time) - state.lastbatt > 53*60*60*1000) {
  cmds << secure(zwave.batteryV1.batteryGet())
} else if (!state.enc) {
  encryptCodes()
  state.enc = 1

I’ve updated the device driver to the latest SmartThings release. Update your device type code accordingly.

You lucky lucky peoples. Still waiting for my hub.

Erik,

What changes did you make to the driver? (Just as an FTY)

Thanks Erik, just did that!

Is the only difference between your custom “Z-Wave Lock Reporting” device handler and ST’s “Z-Wave Lock” device handler is the call to:

reportAllCodes(state)

Just trying to see why the “Lock Battery Status” would not post in the new V2?

I made no changes. The changes were made by SmartThings. I did not analyze their changes, I simply merged them.

A summary of the changes can be found here:

@kurtsanders - Yes, that is the only change in the device driver from the default, coupled with the function itself.

def reportAllCodes(state) {
  def map = [ name: "reportAllCodes", data: [:], displayed: false, isStateChange: false, type: "physical" ]
  state.each { entry ->
    //iterate through all the state entries and add them to the event data to be handled by application event handlers
    if ( entry.key ==~ /^code\d{1,}/ && entry.value.startsWith("~") ) {
      map.data.put(entry.key, decrypt(entry.value))
    } else {
      map.data.put(entry.key, entry.value)
    }
  }
  sendEvent(map)
}

Note, this is not a change from previous versions of Lock Code Manager.

Thanks Erik for the confirmation. Your mods look fine.

I’m still scratching my head why the lock’s battery status does not report to the ST Tile from the device’s function calls. I see that the ST Developer only periodically checks and report the lock battery status based on last time checked, perhaps to save battery life with too many poll checks? Who knows?

Any thoughts on the missing battery status before I submit to ST Support?

No idea. My first inkling is a bug with the v2 hub? I’m still on v1 and it’s still working fine.