keymaster icon indicating copy to clipboard operation
keymaster copied to clipboard

ISSUE: Keymaster breaks when trying to add a code that's less than 4, or more than 8.

Open Thesinofthetin opened this issue 3 years ago • 2 comments

My Z-wave lock has a minimum and maximum requirement when setting a code. 4-8 digits is the limit. I accidentally set the code to something that was out of that range and it broke the Keymaster integration. I had to completely remove the Keymaster integration and repair my lock to get it to work again.

  • OS: HassOS
  • Type of system that HA is running on: Proxmox
  • Home Assistant version: 6.0
  • Hassio
  • Component version: 0.0.56
  • Z-Wave integration name: Z-Wave JS
  • Lock make and model: Kwikset Smartcode 916

Steps to recreate: Get a functioning install of Keymaster. Set the code to something less than 4 or more than 8. The "PIN Status" will read "Adding" for all eternity. When disabling the "Enabled" boolean, it will read "Deleting" for all eternity. You cant set or delete codes at any code slot.

I have to be more careful when setting codes. Other than this minor issue, I love this integration and it has helped me tremendously.

Thesinofthetin avatar Jul 22 '21 18:07 Thesinofthetin

Hmm is there anything in the logs that indicates what is happening? Under the hood, we are just calling the integrations set code and clear code services, so I'm not sure why this would happen.

We could probably add a guard against anything less than 4 and greater than 10 because that's what the standard specifies as valid lengths for PINs but we can't do much beyond that because it's not readily available to Z-Wave JS what valid PIN lengths are for a given lock. My lock has a configuration parameter to set the number of digits, but another lock I looked at does not.

raman325 avatar Jul 23 '21 03:07 raman325

If the PIN is too long or too short zwavejs should be throwing an error, afaik it should be in the HA log too, but yes a check would be good so we aren't throwing invalid codes at it for eternity.

firstof9 avatar Jul 23 '21 13:07 firstof9