I struggled with trying to add the Schlage Deadbolt to Home Assistant. The answers are buried in multiple thread posts and component posts. I hope this helps and consolidates it for folks!
Steps to Add Schlage Deadbolt Z-Wave Connect to HA
if you already added your lock but not securely scroll to bottom of this post to learn how to remove it first
In order to add secure ZWave device (which the Schlage lock is) you need to add a network key to your ZWave configuration.
A) Go to your command line in your Pi and execute this command cat /dev/urandom | tr -dc '0-9A-F' | fold -w 32 | head -n 1 | sed -e 's/\(..\)/0x\1, /g' -e 's/, $//'
B). This command randomly generates a network key for you copy that (it looks like you can also go to a website to grab a key, but I just used the command line)
Open your configuration.yaml file find your Zwave configuration parameters it’ll look like this (maintain formatting)
If you saw a check mark on the lock after a few minutes you should be able to see the lock appear in your HA States search for Schlage
Optional if you want to test to see if it works from a lock/unlock perspective go to services (within Developer tools). Let’s say the deadbolt is unlocked - select “lock.lock” service, then “lock.locked” entity, in the service data put
How to remove the Schlage Lock from ZWave, because you didn’t add it securely
1). Go to your Z-Wave manager in HA UI - Configuration -> Z-Wave
2). Click Remove Node when you are ready
3). Go to your Schlage Lock and follow the instructions below, same as enrolling
4). It’ll take a little bit for Home Assistant to remove it completely, wait a few minutes and restart HA
5). Now go back to the top to add the Deadbolt using Z-Wave “Add Node Secure”
Optional if you want to test to see if it works from a lock/unlock perspective go to services (within Developer tools). Let’s say the deadbolt is unlocked - select “lock.lock” service, then “lock.locked” entity, in the service data put
I’ve never needed to supply a “code” element in the JSON dictionary when invoking the lock service with my Schlage lock. You might try it with yours without a code to see if it still works; it will simply your automations.
Also, could you please edit your posting and fix your configuration snippets to be in preformatted text blocks? There’s a link at the top of every post that describes how to do this, and it preserves the YAML indentation/formatting. That will make your post much more helpful.
new to HASS and trying to learn all the right terms. I did manage to get the lock to show on the home screen with all the many senors ( still trying to figure those out as well) I also have a switch that will lock and unlock. I’m trying to setup the app on my phone and it doesn’t show the switch entity to add to the home screen.
Thanks for the instructions! The only trouble I had was I tried to use some of the keys from the randomkeygen.com link you provided and it did not work. When I used some of the keys from that site in my zwave network_key property, I saw an error in Driver.cpp “Failed to Read Network Key” when I looked at home assistant’s status. (use command “systemctl status [email protected]”) Home assistant was not loading with the invalid network key. When I generated a key with the command in your post (cat /dev/urandom | tr -dc ‘0-9A-F’ | fold -w 32 | head -n 1 | sed -e ‘s/(…)/0x\1, /g’ -e ‘s/, $//’) and put that key in my zwave config, everything worked. The key needs to be in hex.
Are you using rechargable? How often do you unlock/lock the doors using the motor/code/ha?
I do use rechargable, and they last 2-3 months, standard AA batteries lasted 9-12 months for me. Of course I have not been using Home assistant for a year, so maybe they wont last that long with HA.
I’ve had my deadbolts for a year on the same NiMH batteries (I think about 2400 mAH LSD’s). I finally got around to installing HA and connecting it up. Does anyone know how we can get a low-battery indicator? It wasn’t one of the sensors I saw show up. Thanks!
I am struggling here. For long, long time, my locks were working just fine, until I moved to version 0.77.2. Then my locks stopped working.
How it used to work: I added the Network Key in the file options.xml, located in the configuration directory for the z-wave [:/srv/homeassistant/lib/python3.6/site-packages/python_openzwave/ozw_config], then you added the node secure, proceed with the manual instructions for your lock and with some luck your lock showed up in home assistant. If everything went fine then you should be able to lock or unlock from home assistant without any additional code.
In your post you are talking about adding the Network Key in the configuration file and then providing an user code to lock, unlock… Is that the new way to do it? Or the way I described is still the way to go?
IMHO, adding the network key to the Zwave configuration is the way to go because it is more portable (moves with your config and no searching in some file somewhere). To re-add your lock, you of course have to exclude the lock, do a factory resetexclude it and add it securely to OpenZwave. While adding, you should tail the OZW_Log.txt file to see the activity to have a level of comfort about what is happening. It sometimes takes a full 2 to 4 minutes for the lock to “settle” depending on the activity on your Zwave network and how close it is to the hub. You will have to add all of your users back, after that.
If you have a Schlage lock, IMO it does not have good user code add/remove support in HA, and I don’t know if it is a limitation of the lock or HA, but it doesn’t work well for managing users. You are better off using the lock keypad instructions to add/remove users at the keypad.
Does HA have any support at all for add/remove user codes for this lock? When I look at the zwave panel, it just get random characters in the user codes.
Once you set the code, it gets replaced with what seems to be random characters, I assume that’s to keep the code hidden. But it does set it. So if you put in something like
\x32\x34\x36\x38
It will set the code appriopiately, you just wont be able to come back later and view the code
I have 4 digit codes for my schlage and this works 100% of the time. Here is a screen shot of what it should look like if you enter it correctly. Then just click set usercode