ebaauw / homebridge-nb

Homebridge plugin for Nuki Bridge
Apache License 2.0
51 stars 3 forks source link

Possible to expose Keypad #108

Closed MirkoKas closed 1 year ago

MirkoKas commented 1 year ago

Bought the new Keypad 2.0 the other day and I connected it with my Opener. was wondering if it’s possible to expose the keypad as a device within HomeKit!?

I would love to do an automation that when the keypad is used it will also open another door. Within Nuki that’s not possible as a keypad is always connected to one lock or opener at the time.

ebaauw commented 1 year ago

I didn’t know the keypad connects to the Opener. I’ve only seen it connected to a Smart Lock. Indeed, it connects over Bluetooth to the Smart Lock (or Opener apparently), and not to the Nuki bridge.

Could you please list the output of nb list, so I can see if/how the keypad is exposed through the Opener by the Nuki bridge? Last time I checked, for a keypad connected through a Smart Lock, the Nuki bridge only exposed whether the keypad’s battery level is critical. I don’t think HomeKit will like an accessory with only a Battery service, see https://github.com/ebaauw/homebridge-nb/issues/2#issuecomment-729567523.

MirkoKas commented 1 year ago

homebridge@raspberrypi:/var/lib/homebridge $ nb list [ { "deviceType": 0, "firmwareVersion": "2.14.5", "lastKnownState": { "batteryChargeState": 94, "batteryCharging": false, "batteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "mode": 2, "state": 1, "stateName": "locked", "timestamp": "2023-05-27T17:00:11+00:00" }, "name": "Fahrradgarage", "nukiId": 475783964 }, { "deviceType": 2, "firmwareVersion": "1.10.1", "lastKnownState": { "batteryCritical": false, "keypadBatteryCritical": false, "mode": 2, "ringactionState": false, "ringactionTimestamp": "2023-05-27T10:05:12+00:00", "state": 1, "stateName": "online", "timestamp": "2023-05-27T16:42:04+00:00" }, "name": "Haustür", "nukiId": 707720706 }, { "deviceType": 4, "firmwareVersion": "3.6.9", "lastKnownState": { "batteryChargeState": 58, "batteryCharging": false, "batteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "keypadBatteryCritical": false, "mode": 2, "state": 3, "stateName": "unlocked", "timestamp": "2023-05-27T17:22:24+00:00" }, "name": "Wohnungstür", "nukiId": 819023860 } ]

MirkoKas commented 1 year ago

Looks to me like the keypad only shows with the battery status…

ebaauw commented 1 year ago

Yeah, same as when paired with a smart lock.

If you just want to control two locks with one keypad, you could trigger an automation when the lock / opener connected to the keypad opens. Unfortunately, there is no way to detect whether the lock / opener was actually opened with the keypad.

MirkoKas commented 1 year ago

Thx for your help.

ebaauw commented 1 year ago

v1.4.6 adds an accessory for a keypad (connected to a Smart Lock or to an Opener), with a (dummy) stateless programmable switch and a Battery service.