Keypad existence detection

Hi everyone,

I developed an app & drivers to integrate the Bridge/Lock/Opener into the Hubitat hub Nuki Hubitat Integration source at GitHub.

So far it’s working fine at my own home but - always a but, ins’t it? - now I’m revising the integration to use it in a AirBnB that I’ll automate and I’m introducing new features so it would be more robust - and more professional, of course.

One of those new features is to monitor the Keypad battery status, creating a new driver type to monitor it - actually, it’s all it will do (for now) is to monitor the battery. This way, the user could be warned if the Keypad battery status becomes critical.

So, checking the API documentation I saw that there is a return value from the /list command, that includes the Keypad battery critical status ( keypadBatteryCritical). However, the /list command is not returning it, even when there’s a Keypad paired to the Lock.

The json returned:

{deviceType:4, nukiId:799636980, name:TvCarmo10-R/C, firmwareVersion:3.3.5, lastKnownState:{mode:2, state:255, stateName:undefined, batteryCritical:true, timestamp:2022-06-05T20:59:47+00:00}}

Am I doing something wrong?

Additionally, I don’t know if the keypadBatteryCritical return value would be present only if there’s a Keypad paired. This way I could determine if there’s a Keypad and act accordingly.

Thanks in advance!

This might be, because it takes some time to update the Smart Locks capabilities. At least one state change of the Smart Lock is required for the Keypad battery state to appear. Did you check if it is included now in your /list response?

Yes, it is only present when a Keypad has been paired.

Well, it’s working … as intended.

I really don’t know what I did wrong before - I just repaired the Keypad.

So, thank you and sorry for the trouble.

Now, back to the code!