[ST Edge] Driver for Ring Keypad 2nd Gen

I have created an Edge driver for the Ring Keypad 2nd Gen.

You can find the source code here: https://github.com/hmorsti/SmartThingsEdgeDrivers/tree/main/drivers/SmartThings/zwave-keypad

Here are some features:

  • setting the PIN code for the “disarm” and “arm home” buttons (you can set an empty PIN too)
  • the PIN code can handle long pressed digits - they are then mapped to the letters:
    • 1-9 is mapped to A-I
    • 0 is mapped to “@”
  • wrong PIN signal
  • motion sensor
  • power source indication
  • most alarms support strobe only and some support siren only
  • panic combination (hold simultaneously “X” and “Check” buttons)
  • doorbell with selection of 5 sounds
  • entry and exit delay counters
  • most configuration options were mapped in the settings

Due to the limit of 20 components per device I commented out some of them in profiles/ring-gen2.yml. They are handled in the source code so you can uncomment them (and comment out the others) and they should work.

I am not publishing the driver in the SmartThings Edge driver channel for two reasons:

  • the driver was written especially for my needs and it is hard to write a general driver to meet everybody’s expectations - feel free to fork and adapt to your own requirements
  • I don’t want to maintain the driver - there may be some breaking changes in the future

So if you want to use this driver, you must upload it on your own.

I decided to publish the driver here but I plan to update it only with fixes or new fingerprints.

I did a hack for turning off the alarms: I send once again the current state of the alarm system but without sound and light. If anyone knows a better solution for that, please let me know.

I noticed that the alarm system state is synchronized with STHM without any automation. Changing the state in STHM will change it also in the keypad. The opposite synchronization is not enabled but I don’t see any reason to automate it in that way.

Disclaimer: as the driver is related to safety and security and I cannot guarantee that it will work as intended, please don’t rely solely on it. Use it at your own risk.

I have a small request to all Spanish and French speakers: there is the possibility to select the language in the configuration. I took the list of supported languages from the documentation to the Ring Keypad 1st Gen. However, in the 2nd Gen there are additional 2 languages. I marked them as LANG_12 and LANG_13. I think these should be “French (Canada)” and “Spanish (Latin America)” but I need confirmation from some linguists/native speakers. Please let me know, especially by listening to the differences between them and “French” and “Spanish” languages.

11 Likes

Hi, I hope you don’t mind me reaching out to you for advice on this device. I am looking for such a device as this that is able to be configured to the following. Can unique PINs be allocated to individuals, if so can the date and time stamp be read in the SmartThings app and would it be possible send a push notification when the code has been entered when required.

Thanks in advance for reading this.

Wayne

1 Like

Hi,

The PIN code is not stored on the device but in the driver (hub).
It works like this: when you enter the code and press one of the “action” buttons like “arm away” or “cancel”, the device sends the PIN code (to the hub) with the information which button was pressed. So you can do anything with that information in the driver.

In my driver I compare it to a single PIN but only for “disarming” and “arming home” as I wanted to be able to “arm away” without providing the code:

if event_type == EntryControl.event_type.DISARM_ALL or event_type == EntryControl.event_type.ARM_HOME then
  local pin = device.preferences.pin
  if event_data ~= pin then
    incorrect_pin(device)
    return
  end
end
device:emit_component_event(component, capabilities.button.button.pushed({state_change = true}))

You can create the list of different codes and emit any event for that. You can later use the event to send the push notification to the user that for example PIN number 5 was used.

Regarding the timestamp, SmartThings registers it as you emit an event and you can see the date and time in the events history in the app. It should be also possible to get the current timestamp in a driver if you need it for the automation.

Thanks for your support with this, I appreciate it.

@hmorsti

Really appreciate you sharing and all the hard work that people like you are putting in with the Edge drivers. I dont currently have this device but wondered if you could answer a few questions before I make the jump and buy one?

I am converting from Konnected (Cloud) over to local devices/drivers and currently the missing piece of my puzzle is a keypad to keep the ‘non-technical’ members of the household happy.

Can I assume, when Disarmed: The user enters a PIN, the device starts chirping to signal the alarm is about to set and it sets to Armed when the timer runs out?

Can I assume, when Armed: The device detects motion and starts chirping signalling that the alarm needs to be disarmed, once a PIN is entered it signals ST to Disarm.

What happens if a PIN is not entered or the wrong PIN is entered when disarming?

I also appreciate you dont want to maintain the driver, however as this is still early days for the Edge drivers, in the event that you made a code change to fix anything ST might break, would you make the fix available through GitHub? - I understand a little about coding but have not done anything with Lua yet.

Thanks in advance.

Hi @SlySi

Just for the clarification: Disarmed, Armed Away and Armed Home states are handled by the SmartThings Home Monitor (STHM), not by the driver.
image

You can use automations to make the keypad to set the desired mode (e.g. IF Disarmed button was press THEN set STHM to Disarmed). The device also reflects the current state of the STHM by the top buttons lights but it is done without any automation - it seems the SmartThings just works like this out of the box.

Let’s start with the Disarmed → Armed case. My driver does not require to enter the PIN for Arm Away button, only for Arm Home. This is for two reasons:

  • it’s easier to just press 1 button when going away
  • in my case, when the alarm is armed away, it uses all available sensors in my home and when armed home, only a few of them. I decided to use the PIN for arming home because otherwise it would be possible for someone to reduce the number of selected sensors without the PIN by just pressing 1 button.
    So the PIN is required for disarming and arming home only.

Anyway, if you want to use the PIN for all 3 buttons, it is very easy to change: just remove the following if (with corresponding end) and leave the body:

if event_type == EntryControl.event_type.DISARM_ALL or event_type == EntryControl.event_type.ARM_HOME then

You need to create the automation for that, like “IF the alarm is disarmed AND the Arm button was pressed THEN make the device count down, wait N seconds and then arm home/away”. The time for the keypad count-down is also configured by the driver so you need to align it with the automation. FYI: the voice also announces 60 and 30 seconds left. In my case I use the following automation:

name: Arm away
actions:
- if:
    equals:
      left:
        string: pushed
      right:
        device:
          component: armAwayButton
          capability: button
          attribute: button
          devices:
          - myDeviceId......
    then:
    - command:
        commands:
        - component: exitDelay
          capability: tone
          command: beep
        devices:
        - myDeviceId......
    - sleep:
        duration:
          value:
            integer: 30
          unit: Second
    - location:
        security:
          armState: ArmedAway
sequence:
  actions: Serial

The device has the motion sensor but it only reports “motion detected” to SmartThings. You can use it in the automation like IF it is armed AND motion was detected THEN start counting down. SmartThings Home Monitor (STHM) also should use this motion sensor for the armed state and you need to set the reaction delay time in STHM, also aligned to the number of seconds you selected in the driver.

Everytime you enter the wrong PIN, the device makes the sound and blinks. The driver then does not send any event. So it is the same as not entering any PIN.
And after the time has elapsed the STHM starts the alarm procedure (whatever you set there, like sirens, lights, push notification).

Yes, sure. I am using this driver and if I find any bug or the driver stops working after the Edge API update, I’ll fix it and also push it to the repository.

Hope this helped you a little :slight_smile:

Br,
Hmorsti

Hi,

I am looking for guidance on how I load this edge driver manually, I am familiar with the subscribe to channel method, but not clear on how to load this manually from the links you have provided to the source code.

Can you provide a quick how to procedure, or a link to an example if it is available, please forgive me but I have searched in the forums & on the net but have come up short.

Many thanks in advance.

Avvid

Hi @avvid
you can find the tutorial for creating the channel, packaging and uploading the driver here: Tutorial | Creating Drivers for Zigbee Devices with SmartThings Edge

1 Like

Thanks & very much appreciated.

Avvid

Sorry, been offline for a bit but wanted to chime in to say a big thank you for the detailed explanations and answers, I got a keypad and have started work with it, its very smart indeed and is all fairly straight forward, hardest thing was getting the damn thing paired :roll_eyes:

Hey there! I tried following the tutorial, but the command edge:drivers:publish doesn’t seem to be supported anymore- any ideas?

thanks!

Luis

ldrojasm@MacBook-Pro-de-Luis ~ % smartthings edge:drivers:publish
› Warning: edge:drivers:publish is not a smartthings command.
Did you mean edge:drivers:delete? [y/n]:
› Error: Run smartthings help edge for a list of available commands.
ldrojasm@MacBook-Pro-de-Luis ~ %

Nevermind- looking through the code, I believe the updated command would be smartthings edge:channels:assign. I also noted that on my device (just bought it) the model is 0x301. Had to change that on your code :slight_smile:

I too had to change this in both the fingerprints.yml and init.lua files.

In init.lua:

local ZWAVE_RING_GEN2_FINGERPRINTS = {
  {mfr = 0x0346, prod = 0x0101, model = 0x0301}
}

In fingerprints.yml

    manufacturerId: 0x0346
    productType: 0x0101
    productId: 0x0301
1 Like

I got the keypad SRC package setup and the driver installed on the hub without errors.

I edited my fingerprint and modified files to 301 from 401 as above.
then I ran logcat…nothing.

Removed the keypad from the wall.
pressed the reset button on the back for 10 seconds.
until green light flashed every second.

Opened the ST app and add a new device by scanning barcode, seemed to hang forever.
then i pressed the #1 button for 3 seconds and the green light started to flash quickly and it paired and then messages started to show up on the CMD window.

then it worked!

just started to play with it.

Looks good so far, much more capabilities than the one I had before from Rboy.

The good and bad using the OLD rboy keypad code:
I had to hardcode my PIN in webcore to make it work.

Using rboy code and WebCore I could create PIN codes for macros and scenes.
like
PIN 1111 would turn on all lights outside and ignore motion
PIN 0000 would turn off all outside lights and ignore motion
PIN 0001 would turn off all lights and enable motion activation
PIN 7777 would water the lawn
PIN 9999 would shut off the water valve for watering the lawn

I don’t see a method to do that with this edge driver as yet.

I also copied the individual keypad PIN codes from my front door lock into the webcore routine for the keypad.

Kids and parents use their individual doorlock codes to unlock the door and same code can be used at the keypad.

Looks like this keypad can only store ONE pin code, is that so?

1 Like

As I see, the driver is much stable, I decided to create the channel to share it. However I did not add the US version yet (product ID: 0x0301) as I have no access to my keypad now and I am not able to verify if the change does not break anything. I’ll add it after the new year’s eve.

Here is my channel invitation: Hmorsti SmartThings channel

Please verify if EU version works for you with this link.

3 Likes

Damn if this doesn’t work great, EU version. I have everything working except PINs. How/where to set them. Don’t even need for different users, just one PIN will do but can I figure it out?

You need to go to the settings (three dots on the top right corner in the device view. The PIN is the first option on the top.

Haha, wow, how’d I not see that? Cheers.

would be awesome if someone can publish en edge driver for NA that will support multiple codes with basic alarm home, alarm away and disarmed buttons.

1 Like