Triggering automation with a Kwikset Z-Wave lock

I’m trying to write some automation for my Kwikset Z-Wave lock. This is a deadbolt which can be opened/closed with the usual lever or a key. It also has a touchpad, and a valid code will retract the deadbolt with a motor. On the touchpad is also a lock button which closes the deadbolt with the motor.

I’d like:

  • If the lock button is pressed, turn off the lights in the house
  • If the door is unlocked with the keypad, turn on some lights

Pushing the lock button is not the same as locking the door. For example if I’m inside and lock the door before bed, I don’t want all the lights to be turned off.

I used to have this set up with a Vera, so I know it’s possible.

How might I accomplish this with Home Assistant? If there’s not an obvious way, is there a way I can log all the events on the event bus and make a guess? I’m expecting there are some z-wave events which correspond to the actions I’d like, but I don’t know how to find them.

1 Like

There is a sensor that’s created for the lock when you add it that will give you a numerical value depending on the state fo the lock. I have a similar (but not the same Kwikset lock) and I have some of these same automations. Also you can create a template sensor that will grab the state of the lock in text. The numerical value the sensor returns can be cross referenced with the technical documentation of the lock found online. values of 21, 22, 23, 24, 25 all pertain to the locking state. There are a couple others outside of that range that pertain to user codes, device status in general, etc but I either don’t use those or don’t have them since I don’t have a keypad.

Examples:
Door Lock state in text (have to use templating for this one)

{{ states.lock.garage_door_lock_locked.attributes.lock_status }}

Or numerical value (this is a sensor created with the lock when added)

sensor.garage_door_lock_alarm_type

Door Lock mode template sensor with icons:

  - platform: template
    sensors:
      garage_door_lock_mode:
        friendly_name: 'Garage Door Lock Mode'
        entity_id: sensor.garage_door_lock_alarm_type
        value_template: >-
          {%- if is_state("sensor.garage_door_lock_alarm_type", "23") -%}
            Deadbolt Jammed
          {%- else -%}
            {{ states.lock.garage_door_lock_locked.attributes.lock_status }}
          {%- endif -%}
        icon_template: >-
          {%- if is_state("sensor.garage_door_lock_alarm_type", "21") -%}
            mdi:lock-outline
          {%- elif is_state("sensor.garage_door_lock_alarm_type", "22") -%}
            mdi:lock-open-outline
          {%- elif is_state("sensor.garage_door_lock_alarm_type", "23") -%}
            mdi:emoticon-dead
          {%- elif is_state("sensor.garage_door_lock_alarm_type", "24") -%}
            mdi:lock
          {%- elif is_state("sensor.garage_door_lock_alarm_type", "25") -%}
            mdi:lock-open
          {%- else -%}
            mdi:cancel
          {%- endif -%}

Then just use your sensor in an automation to trigger the lights you want and when.

EDIT: If I remember correctly, the numeric value state corresponds to the following actions. The Kwikset 912 may have a few additional for the keypad functions.
21 - Manually Locked by Inside Thumb Turn or Key Cylinder
22 - Manually Unlocked
23 - Deadbolt Jammed
24 - Locked by RF
25 - Unlocked by RF

I’m trying to find the technical document that documents these codes but it’s been a while since I’ve used it and didn’t save it.

Thanks, that’s a good start. Looks like you’re right and I’m seeing that sensor on the overview page as “Front Door Lock Alarm Type”. I think some of the codes may be different on my lock, but it’s easy to figure out.

Related, I found documentation on configuration parameters: https://s7d5.scene7.com/is/content/BDHHI/z-wave-configuration

Wow, I just discovered Z-Wave devices are really well documented if you know where to look.

Find products here: https://z-wavealliance.org/z-wave_for_integrators/

Here’s my particular lock: https://products.z-wavealliance.org/products/2239

Linked on that page are all the configuration parameters. Very handy, and more extensive than Kwikset’s documentation I linked just above.

It also lists the support command classes. Then it’s necessary to head over to http://zwavepublic.com/specifications to find the details of the particular classes supported.

1 Like