Using the Ring Alarm Keypad with Home Assistant

As I tell the students in my reverse engineering class, assume that these things were designed by sensible people. I saw that the config parameters up tp 24 were defined, so I did a manual get for parameters 25, 26, 27 and 28, assuming that if there were new added ones they’d be there. 25 and 26 came back as existing (watch the debug log), but only 26 actually kept a value that I set to it. So, knowing that a configurable timeout probably exists (it’s a standard motion sensor feature), and it would have been added when the motion sensor feature was added (so, after the documentation was published), the reasonable guess was that it was the one and only config parameter that was both new and accepted a value. And some quick experimentation showed that it seems to work as expected.

2 Likes

@Dast
Using z2m, at the bottom of the configuration section, there is a form to set / get parameter values.

@ImSorryButWho
Its super cool that you teach a reverse engineering course. Seems like that could apply to just about everything! Thanks for your work on this. I wouldn’t have bought these keypads without it.

Thanks, haven’t been using z2m but I’ll take a look.

That sounds ideal for my scenario. I have tried the following to test in Developer tools.

service: zwave_js.set_value
data:
  command_class: 135
  property: 96
  property_key: 9
  value: 100
  endpoint: 0
target:
  device_id: d43a2409a912785c5c745db0848fa7e9

But I just get the unhelpful message “Failed to call service zwave_js.set_value. Unknown error.”

Can you spot something in this code I am doing wrong?

I’m not sure. When I go into developer → serivces, I input this and it fires correctly. Are you trying to fire this from the service or events tab?

service: zwave_js.set_value
data:
  command_class: '135'
  endpoint: '0'
  property: '96'
  property_key: '9'
  value: 10
target:
  device_id: 7712c8803256cf43a64f4a4c41e204cb

Yes, in developer → services. And I also tried with the single quotes you used around your call parameters… Still the error.

My keypad is gen 1 (Alarm Keypad (1st generation) 4AK1S7-0EN0 / 4AK1E9-0EU0 v1.9).

Maybe it works on gen 2s.

Yeah, the two keypads are substantially different. I’m sorry, I don’t have a v1 keypad to experiment with.

Your best bet is going to be to look at the indicator section of the ZwaveJS2MQTT page for the keypad. Try calling the various “sound level” sub-functions of that exist there with a value of 100, and see if you can find whether and where they mapped generic sounds. The standard says they should be starting at indicator 96, but it’s entirely possible they weren’t being standards compliant (or, alternatively, didn’t implement it in v1).

1 Like

Thanks, you are correct ‘96’, on a gen1 does nothing. However I tried your suggestion @ImSorryButWho and 31 = Guitar strum, and 40 = Beep-boop. There are others, ‘Disarmed’ etc. However I still cannot use those numbers (31 and 40) in my test on HA developer->services.

I am missing something in my test harness I guess.

Hmm… if it works in the ZWaveJS2MQTT front end, there’s no reason we can’t make it work from Home Assistant. In Z2M, what’s the label on the indicator that works? It should look like [<node id>-135-0-<property>-<property key>] Description.

Also, does anything relevant show up in the HA log when you try to call it?

@ImSorryButWho : I had a hiccup - moved from rPi3 to 4 and had to get a new Aeotec 5+ controller. Anyway still same problem. To answer your questions.

Firstly, the label is : [9-135-0-value] Indicator value in ZW2MQTT.

When called from there I get a Guitar strum, when called with value 31. And the ZW debug log shows:

022-04-21 20:12:16.961 INFO ZWAVE: Calling api writeValue with args: [
{ nodeId: 9, commandClass: 135, endpoint: 0, property: 'value' },
31,
{},
[length]: 3
]
2022-04-21 20:12:16.963 INFO ZWAVE: Writing 31 to 9-135-0-value
2022-04-21 20:12:17.037 INFO ZWAVE: Node 9: value updated: 135-0-value 31 => 31
2022-04-21 20:12:17.040 INFO ZWAVE: Success zwave api call writeValue true

HA log reports the following, when I try it from the Developer console. (And nothing on the ZW2MQTT debug window)

2022-04-21 20:04:11 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Value 9-135-0-31-9 not found on node Node(node_id=9)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 379, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 582, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1634, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1671, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/components/zwave_js/services.py", line 423, in async_set_value
success = await node.async_set_value(
File "/usr/local/lib/python3.9/site-packages/zwave_js_server/model/node/__init__.py", line 415, in async_set_value
raise NotFoundError(f"Value {val} not found on node {self}")
zwave_js_server.exceptions.NotFoundError: Value 9-135-0-31-9 not found on node Node(node_id=9)
2022-04-21 20:04:11 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546269706128] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 630, in handle_execute_script
await script_obj.async_run(msg.get("variables"), context=context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1275, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 359, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 379, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 582, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1634, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1671, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/components/zwave_js/services.py", line 423, in async_set_value
success = await node.async_set_value(
File "/usr/local/lib/python3.9/site-packages/zwave_js_server/model/node/__init__.py", line 415, in async_set_value
raise NotFoundError(f"Value {val} not found on node {self}")
zwave_js_server.exceptions.NotFoundError: Value 9-135-0-31-9 not found on node Node(node_id=9)

The code in the developer console to call this is :

service: zwave_js.set_value
data:
  command_class: 135
  endpoint: 0
  property: 31
  property_key: 9
  value: 100
target:
  device_id: a41c48fc8d2492ad346f6eee81096c2d

If you have any thoughts/insight, that would be great.

Sorry, the email notification for this got misfiled.

So, it looks like the v1 keypad implements the indicator command class a bit differently than the v2. Try making it property_key: 'value' (instead of 9), or possibly just leaving off the property_key key entirely, and see if it likes either one.

Neither get past that error in the call. Results for 'value' and '' and no property key are :

zwave_js_server.exceptions.NotFoundError: Value 8-135-0-31-value not found on node Node(node_id=8)

and 

zwave_js_server.exceptions.NotFoundError: Value 8-135-0-31- not found on node Node(node_id=8)

and 

zwave_js_server.exceptions.NotFoundError: Value 8-135-0-31 not found on node Node(node_id=8)

I have two v1 keypads (hence the 8 in this test, not the 9 previously)
Never mind, it’s not a big issue, but thanks for trying.

You’re still using the wrong fields. Just plugin exactly what Z2M is showing you. Maybe it’s confusing because the property name is value.

[9-135-0-value][nodeId-command_class-endpoint-property{-property_key}]

nodeId9
command_class135
endpoint0
propertyvalue
property_keyNone

It’s also shown in your log:

022-04-21 20:12:16.961 INFO ZWAVE: Calling api writeValue with args: [
{ nodeId: 9, commandClass: 135, endpoint: 0, property: 'value' }

The property key is not always present, as in this case, so just omit it from your service call. The actual value field in the service call is that value you want to write (31 = Guitar strum).

service: zwave_js.set_value
data:
  command_class: 135
  endpoint: 0
  property: value
  value: 31
target:
  device_id: a41c48fc8d2492ad346f6eee81096c2d
1 Like

Thank you for the clarity @freshcoast , you are correct on all counts. That did confuse me. And the service call you gave me, works fine (with all sounds). :+1:

@ImSorryButWho, this is great! I got a v2 keypad to experiment with and it’s working exactly as you laid out in your writeup. Thanks for publishing this!

I have a question: are the property values in your documentation essentially a complete list, or are there yet to be undiscovered sounds, messages, actions? There seems to be a gap from 3 to 8, and from 20 to 95. I’m wondering what they might be. I tried calling 3 and nothing happened (no error either, like I get with property 1). The lack of error implies that it does something, but no idea what. I’m hesitant to try calling all the numbers in case they change settings. I’d love to hear if these have been attempted.

1 Like

To the best of my knowledge, there’s not likely to be something hiding. They seem to have done a good job of following the specifications, and the specs say it should report what indicators it supports during the interview. ZwaveJS2MQTT will show you what it said in the interview.

The numbering cones from the specs. There’s a spreadsheet on the silicon labs website that lists all the standard indicators, although the link is broken right now.

Trying something else is very unlikely to break anything. Give it a try, but I wouldn’t hold my breath that there’s something hidden there.

1 Like

@ImSorryButWho Thank you so much for putting together your write-up and creating a blueprint. It was very helpful for me and I was able to set up the keypad in little time. The only thing I would recommend is noting somewhere in the documentation about the security requirements. Unfortunately, I could not get the keypad (v2) to pair with my old Aeotec Z-Stick Gen5 (I tried literally everything). Thankfully, I had recently ordered the Aeotec Z-Stick Gen5+ (Plus) model which supports S2 security and I was able to backup my previous settings to the new Z-wave USB stick. I’m guessing this keypad is only compatible with S2 security. Thanks again for your efforts!

@Richsm, I have a regular Gen5 stick that paired with the v2 keypad just fine. I wonder if it’s because I’m not using a Raspberry Pi?

@ImSorryButWho, thanks for clarifying. I only recently migrated my zwave stack to zwavejs2mqtt from the legacy ozw and hadn’t noticed the interview details were visible in the management UI yet.

I got the chime functionality to work first try, thanks! This is helpful with kiddos in the house, to know when the doors are opened. I have Alarmo installed and this Ring Keypad blueprint setup. I was able to create the Door Chime Automation like this:

Here is the YAML code that was generated:

- id: 'REDACTED'
  alias: Door Chime
  description: ''
  trigger:
  - type: unsafe
    platform: device
    device_id: REDACTED
    entity_id: binary_sensor.door1_home_security_intrusion
    domain: binary_sensor
  condition: []
  action:
  - device_id: REDACTED
    domain: zwave_js
    type: set_value
    command_class: 135
    property: '96'
    property_key: '9'
    endpoint: '0'
    value: '100'
  mode: single
1 Like