ImSorryButWho / HomeAssistantNotes

Notes on setting up various things in Home Assistant
120 stars 23 forks source link

Feature Request: Extend Support For 8 Digit Passcodes #22

Closed clutch70 closed 1 year ago

clutch70 commented 1 year ago

When the passcode is 8 digits, instead of firing one event_type 2 with the event_data filled out, two events of event_type 2 and event_type 1 are fired in immediate succession, resulting in the automation sending a bad passcode sound because the event with event_type 2 has event_data set to NULL.

Request implementation of witchcraft to support 8 digit passcodes.

event_type: zwave_js_notification
data:
  domain: zwave_js
  node_id: stuff
  home_id: stuff
  device_id: stuff
  command_class: 111
  command_class_name: Entry Control
  event_type: 1
  event_type_label: Cached keys
  data_type: 2
  data_type_label: ASCII
  event_data: "12345678"
origin: LOCAL
time_fired: "2023-04-07T06:04:41.115338+00:00"
context:
  id: stuf
  parent_id: null
  user_id: null
event_type: zwave_js_notification
data:
  domain: zwave_js
  node_id: 23
  home_id: stuff
  device_id: stuff
  command_class: 111
  command_class_name: Entry Control
  event_type: 2
  event_type_label: Enter
  data_type: 0
  data_type_label: None
  event_data: null
origin: LOCAL
time_fired: "2023-04-07T06:04:41.530907+00:00"
context:
  id: stuff
  parent_id: null
  user_id: null
ImSorryButWho commented 1 year ago

If you set the entry control key cache size to 10, do things work as expected?

clutch70 commented 1 year ago

Any chance you've already worked out which command parameter that is? Not finding anything related to cache here (https://products.z-wavealliance.org/products/3870/configs).

ImSorryButWho commented 1 year ago

Sorry, it's part of the Entry Control command class, not a config parameter. If you're running ZWaveJS UI, open up the Entry Control v0 pane and set it there. If you're not using ZWaveJS UI, you can do it directly from Home Assistant with a call like:

service: zwave_js.invoke_cc_api
entity_id: sensor.keypad_v2_battery_level
data:
  command_class: 111
  method_name: setConfiguration
  parameters: [10,5]

The parameters are the key cache size, and the key cache timeout (in seconds). The entity_id just has to be any entityassociated with the ZWave device.

clutch70 commented 1 year ago

Worked like a champ! Eight digit passcode comes through no problem. Thanks for the tip.

clutch70 commented 1 year ago

Did you find documentation out there somewhere to get those parameter values or is that from experimentation?

Or maybe I'm misunderstanding, I took your suggestion to mean that I was increasing the cache size of the code. Am I in fact increasing the keypad entry timeout from 5 seconds to 10 seconds?

ImSorryButWho commented 1 year ago

There's extensive documentation on how Zwave devices are supposed to work from the Zwave alliance. See, for example, the Entry Control specs starting at page 241 in Z-Wave Application Command Class Specification

clutch70 commented 1 year ago

whoooo. Lots of reading to do.

Thanks again much appreciated!