Z wave locks ... make a key code sensor into a binary_sensor?

Hi, I am migrating away from Wink hub2 and using a USB Z wave stick…have had good succes so far but am missing a feature from Wink and would like to create it. I had a key code binary_sensor fromWink that was triggered when certain user codes were entered on keypad. How can I take the Z wave sensor ( not sure which one yet) and make it into a binary_sensor so that I can use key codes for automations?

It’s only supported in OZW 1.6.

1 Like

Thank you,

Alrighty, where do I find what version I am running and how do Inuograde? I have looked before asking and can not seem to find it anywhere in the GUI

my version is OpenZwave Version 1.4.3462

its ok, lol, I’ll wait, I read up on it…

if you prefer I post a new topic I will but if you are able can you please advise me on the following z-wave to MQTT add=on Qs:
Can I run this alongside the Hassio integration?
and/or will running 2 instances cause Hassio to “see” copies of every z wave device?
Is this just for MQTT or can I use the advantages of the OZW 1.6 in Hassio?

Thank You,
Mark

Not sure what lock you have, but I’m using Schlage locks and this is possible. Have been using it for a couple of years now.

Not able to verify at the moment, so this is from memory, but should get you close enough. Check your lock.whatever entity in the states page. In the attributes, I have a “lock status” and when unlocked with a code, this changes to something like “unlocked by user x.” You can create a template binary sensor for each user that triggers on that text. Then automate off of that.

If I have time later, Ill go back and find my yaml code when I did this pre-NodeRed.

1 Like

You make a binary sensor for the alarm level… that will be the code slot… I’ll get the code in a minute…

1 Like

right on, this is what I am looking for, I do have Schlages…not sure where to find that lock status but will have a look, shouldnt be hard

@Bacon-Ranch

So I also came from wink originally, and the key usage already made binary sensors, so for ease of making my automations work again I made these. I have one of these for every code slot… I did not use code slot 1 because a manual turn kept making it say 1 again briefly… that was quite awhile ago so I do not know if that is still an issue…

- platform: template
  sensors:
    amy_front_key:
      friendly_name: "Amy's Key"
      entity_id: sensor.lock_front_door_deadbolt_alarm_level
      value_template: >-
        {{ is_state('sensor.lock_front_door_deadbolt_alarm_level', '8') }}
    brian_front_key:
      friendly_name: "Brian's Key"
      entity_id: sensor.lock_front_door_deadbolt_alarm_level
      value_template: >-
        {{ is_state('sensor.lock_front_door_deadbolt_alarm_level', '2') }}

and my key notifications just watch for the binary sensors to turn on.
and obviously you will want to change the alarm_level entity to match whatever yours is.

1 Like

thank you, will have a go in a few days!

Be careful, different Schlage locks use different alarm levels, or at least that was the case when I originally followed examples way back when. That’s why I went with matching the lock status attribute which is text and very clear.

My Yale transmits the user number anytime that code is used to unlock the door, so if I do it it sends User A, next user is User B, etc so I watch the lock data attributes for that user number and trigger automations based on it.

Message is basically “User X Unlocked via Keypad”
Manual lock actuation says Manually Unlocked
Zwave commanded is Unlocked by RF

it is in lock.lockname.data.attributes.lock_status. You may want to consider sending a unlock command at it after the door unlocks and automation bit is set, to clear that message out.

I hear ya, what I want is to have a dummy key code, it will unlock the door, but it is used only in an emergency, so the code will also trigger sending emails to emergency services, like in case of a home invasion, I enter the code and its a silent alarm, I also give emergency services control over home assistamnt where they can lock and unlock, kill all lights, etc…

where are the lock data attributes and if I use in an automation is it under service trigger?

thank you, works just like the Wink set up !

Awesome did you happen to try code slot 1? I don’t know if that was just a fluke in my setup at the time because the codes were already set from wink, but I just started at 2 and never used 1 again.

no I did not, my use is it a bit of security and counter-intell lol. I set up a code I would only use in case of an emergency, like a robbery, I enter the code, door opens and all kinds of other stuff happens quietly or otherwise, only limited by imagination

That’s actually a really good idea… my old Fashioned house alarm When I was a kid silently notified the alarm company if you entered one digit above your actual code… totally forgot about that…

1 Like

The message you see in the HA lock screen in the bottom right(Notification Line), that message is located in lock.LOCKNAME.data.attributes.lock_status

Just set your duress code into an available slot, monitor for the message including that user’s number. You can then fire off your automations based on it. I don’t think it has a category itself as its just text data. Just have to watch for a change in that message field. to know when to lock use the lock service, status changed to Unlocked.

Consider using Node Red for automations, much more powerful.

thanks, have been thinking about node red, looked at it a few times but will maybe try again next year.

What is the HA lock screen?

I am not sure what the actual name is… click the lock icon on your interface, the little window that pops up, has lock/unlock on it, etc.

I’m using the User X number to turn on that individuals room light in the dark hours. Next year is quite far away :wink: HA’s own automation capabilites are lackluster and an annoyance to make work. Node Red is its own oddities but is easier to work with, can easily set up the steps in your events.

1 Like