Correct Z-Wave Lock API Command

Well let’s call in reinforcements in the form of @nayelyz and @andresg

Hello, I am somewhat dubious about the file st/zwave/defaults/lock.lua in the v3 Lua libs, specifically line 78 which reads:

local code_name = lock_codes[code_id] == nil and lock_codes[code_id] or "Code " .. code_id

That is supposed to extract the name of slot code_id, falling back to to ‘Code code_id’ if there isn’t a name. I would suggest that what it actually does is evaluate to ‘Code code_id’ regardless and it probably should be ‘~=’ in the first comparison.

That code is part of the default lock notification routine and it would explain why the code name isn’t making it to the event data for Z-Wave locks, which seems to have been exercising a number of users in this thread. The similar routine for Zigbee locks is expressed differently and correctly and I assume it works fine.

Would you mind running your eyes over it and reporting it if necessary?

2 Likes