First steps with SmartThings: setting up Yale YRD256 smart lock


#1

Hello!

I’d like to share my first steps with SmartThings in case it is of value to someone in the same situation.

My situation:

  • only one lock to manage
  • very limited number of users to manage, with little changes, and access always granted
  • interest in being notified when the door is locked/unlocked. Notification should tell me who unlocks the door

I got the Yale YRD256 with z-wave module for its aesthetic and compatibility with ST. After installing it, I started playing with ST. Here are the steps I went over, issues I encountered and what I learned along the way:

Mobile app setup
It was probably the most confusing part of this project. There are 2 mobile apps out there, SmartThings Classic and SmartThings ( the most recent one). Bottom line: SmartThings classic, as of right now, is the way to go. The new app is not ready yet as it does not have feature parity with the classic app. It is all explained on ST FAQ here: https://support.smartthings.com/hc/en-us/articles/360000114006-New-SmartThings-app-FAQ

First pairing
After pairing the device, the only capabilities I had were to lock and unlock the device, and to see battery level. Not enough to call it done.

This article was very helpful to know what my options were: New to Smart Things need help managing Schlage lock user codes. There are 3 of them: rboy’s paying solution, ethayer’s free solution, and smartthings Smart Locks solution.
After a bit of reading, I decided to try the full featured, yet free, solution from ethayer first.

Playing with ethayer’s lock manager Bottom line, ethayer’s solution is too much for my need. But I still learned a lot which allowed me to move on. Here are more details:
I think this is where things got fun. Ethayer’s app installation is very well explained ( see [RELEASE] Lock Manager ). Here are the little tricks I learned when setting it up:

  • When you go to the developer portal ( http://graph.api.smartthings.com/ ), make sure to go to “My Locations” and click on your location so that you get redirected to the proper server. Otherwise, your devices will not show up. [edit] as mentioned in the replies below, it is best to use https://account.smartthings.com instead of the graph api link to get to the correct server.
  • [edit] From replies below, I was mistaken. Rebooting the hub should not be needed. [/edit] From what I observed, when installing a new device handler and assigning it to a device, it is best to reboot the hub. No need to get off your chair to do it, go to “My Hubs” -> view utilities -> reboot hub. I did have issues at some point of not being sure which device handler was being used, and I suspect some of the issues I encountered were related to that.
  • I used the github integration, but I did not like that it was giving access to all the repositories my account has access to, including private organizations and repositories. I decided to create another github account just for that purpose. You could also add the device handler and apps using code only to avoid the setup.
    Once installed, I was able to setup users, locks, add code, set notifications. I almost had all I wanted. The reasons I was not satisfied were:
  • notification were not telling me who was opening the door. Every event was sent with “Code 99”.
  • the notification setup with 3 level ( global, locks, users ) was a bit confusing, and I honestly did not know what behavior I would end up getting at the end. From my testing, I was not consistently being notified.

This is when I decided to go in another direction. I did consider rboy’s solution, but the problem is, it is hard to see what you will get after you pay for it. The functionalities are all listed on rboy’s website, but there are no screenshot or anything to gauge usability. This is why I decided to pursue the other free solution, Smart Locks from ST.

Smart Locks from ST
ST has a smartapp that give you more control over smartlocks: https://support.smartthings.com/hc/en-us/articles/200958090-Smart-Locks-in-SmartThings-Classic
Setup was easy. I changed the device handle back to the stock “zwave lock” handler. But I had errors when trying to add codes using Smart Locks. I cannot fully explain why because I took 2 actions that could have independently resolved the issue, but do not know which one did:

  • I rebooted the hub to make sure z-wave lock device handler was the one being used for the lock
  • I cleared all the user codes created with lock manager
    After that, I was able to add user codes, lock/unlocked, see the lock history in Smart Locks. It was not the end of the journey though. Smart Locks does not send notifications, and I was also getting “Code 99” in the history tab of Smart Lock, while I expected the name of the person activating the lock.

Diving into the device handler
I decide to first tackle the “Code 99” issue. I figure it was coming from the device handler. I proceeded by creating my own device handler using the code of the ST one ( https://github.com/SmartThingsCommunity/SmartThingsPublic/tree/master/devicetypes/smartthings/zwave-lock.src ). Thanks to having gone through ethayer’s guide, it was easier to understand how to create a device handler, associate it with the device.
To my surprise, just by using the latest version of zwave-lock device handler, the Code 99 issue that I was having with both ethayer’s handler and default zwave-lock got resolved. To my knowledge, this indicates that both are outdated and do not contain the latest fixes and improvements.

So at that point, I could lock, unlock, add user codes, and I could see in the Smart Locks history who was locking/unlocking the lock. Great! Still no notifications. This is when I decided it was time I write my own SmartApp to get the behavior I need.

First SmartApp
I used the “From form” dialog to create the app, and start with a blank slate. I also referred to the following for inspiration:

This is the end of this first project using SmartThings for the YRD256 lock. I hope it will be useful to others, in the same way a lot of articles posted here were useful to me. Please let me know if you have any feedback!


(jkp) #2

Users should always use https://account.smartthings.com to access IDE. Everyone should avoid the graph.api URL and therefore you would not need to click on locations as mentioned.


#3

Thank you! I was not aware this was the right way to access the dev portal. I have added this info to my original post.


(jkp) #4

I have never rebooted my hub after changing a device handler on any of my devices so I find your observation a little odd. :slight_smile:


(jkp) #5

There is also another smart lock option available. It is a paid version but wanted to let readers know about it.


#6

Yes I did not explicitly explain why I did not consider it. Let me add this to the post.


(jkp) #7

Just curious, which version of @ethayer lock manager did you try?


#8

I used this device handler: https://github.com/ethayer/lock-manager/tree/master/devicetypes/ethayer/zwave-lock-reporting.src


(jkp) #9

He released a new version of his app and device handlers two months ago if you want to test it. I believe the notifications are still an issue. He mentioned he I going to post an update soon.

I used WebCORE to set up my notifications


#10

This should never be required (rebooting the hub). I have never had to reboot a hub after assigning a Device Handler to a device.

Sometimes it does take time for the change in IDE to reflect on the Device when you open it in Things from the mobile app.

The way to resolve that is when you open the Device in Things, click on the Gear icon and then Save the Device. This will make sure that the device is indeed tied to the Device Type Handler that was assigned to it :slight_smile:


#11

I updated my post to avoid misinformation. This is the part where I played with many variables at the same time and could have easily got confused on what was causing the issues I experienced. Thank you for correcting me!


#12

More of just an observation :slight_smile:

So many things happen and can go wrong on this platform, sometimes it’s hard to determine what the resolution to something is, especially if you are doing more than one thing at a time :slight_smile:


(Erik Thayer) #13

Version 2 should be much easier to install (only 1 app), and doesn’t have the code99 issue.

It’s just not the official version yet, as I need to write an install guide for it, but it should be soon.

Good luck on your journey!


#14

That is good news! Do you know if Lock Manager and Smart Lock from ST can co-exist? If yes, I will probably try lock manager beta2 right away!


(Erik Thayer) #15

They can co-exist, however changes made in SmartLock will be overritten by LockManager.

Example:
Create Code1 as ‘Emily’ in LockManager
LockManager will ask SmartLock to rename Code1 to ‘Emily’
Logs in SmartLock will show actions done by Code1 as ‘Emily’

Create Code2 as ‘Greg’ in SmartLock
LockManager will see an unexpected change in Code2 and delete ‘Greg’

EDIT:
Note, you do have to use the custom DTH at this point. There is a bug in the current SmartThings platform that makes the default DTH report wrong objects to the SmartApp. Using a copy and paste of the original SmartThings code in the IDE fixes this issue. Root cause unknown, likely SmartThings bug.

All necessary Device handlers are included in the beta-2 branch, including a special one for Yale to add more options to control various aspects of the lock.