SOLVED Schlage Deadbolt Z-Wave Connect Added to HA

Hi Fellow HAers-

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

  1. 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)

  2. Open your configuration.yaml file find your Zwave configuration parameters it’ll look like this (maintain formatting)

  usb_path: /dev/ttyACM0
  network_key: "<YOUR NETWORK KEY>"
  1. Restart Home Assistant

  2. Find your programming code for the Schlage Lock - it was on the back of the lock prior to installing

  3. Navigate to the ZWave Manager in the HA UI ->Configuration -> Z-Wave

  4. When you’re ready click “Add Node Secure”

  5. Now go to your Schlage Lock and follow these instructions (came with your lock)

  6. 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

  7. 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

  "entity_id": "lock.locked",
  "code": "<your access code, not programming code>"

The Deadbolt

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

“entity_id”: “lock.locked”,
“code”: “<your access code, not programming code>”

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.

1 Like

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.

1 Like

Thanks for the instructions! The only trouble I had was I tried to use some of the keys from the 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.


Thanks, that works!

Has anyone gotten the battery life to improve mine lasts about 2 weeks maybe 3

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 do use rechargeable. That’s a good question I should monitor that.

Did you make any tweaks to your Z-Wave settings for pinging? To reduce battery drain.

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!

Create a sensor like so (change names as neeeded)

        friendly_name: Back Door Lock Battery Level
        value_template: "{% if states.zwave.lock_back_door_deadbolt %}
            {{ states.zwave.lock_back_door_deadbolt.attributes.battery_level }}
          {% else %}
          {% endif %}"
        unit_of_measurement: '%'
        icon_template: >-
          {% set battery_level = states('sensor.door_lock_batteries_back_door')|int('unknown') %}
          {% set battery_round = (battery_level|int / 10)|int * 10 %}
          {% if battery_level == 'unknown' %}
          {% else %}
            {% if battery_round >= 100 %}
            {% elif battery_round > 0 %}
              mdi:battery-{{ battery_round }}
            {% else %}
            {% endif %}
          {% endif %}
1 Like

Does your lock slide into the door freely? If not, that could use up some batteries.

Thanks so much! I really appreciate it. It worked almost as is. I just had to add this before:

- platform: template

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.

1 Like

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.

you have to use hex/ascii, If I remeber correctllt, it would be something like this

Code you want: 2468
what you’d put in the zwave control panel

then click set usercode. if you’re entering it correctly, it will show 2468 in the ASCII section


yeah I mostly get \x00 and \x02 which aren’t alphabetic characters.

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


It will set the code appriopiately, you just wont be able to come back later and view the code

1 Like

I cannot get this set from a user code perspective it works for you?

What kind of lock are you using?

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