New openHAB2 Binding for Nuki Smart Locks

wow! ok… So, the page I linked was lying! :wink:

so, it is more than misleading, but anyways…

Can you please share your solution as I’ve got the same Problem? Thanks

The rules are in Python, would that help you ?

I have the new Nuki lock v3.0. That one has a new device ID, IDs 3 and 4. Thus it will not work properly with the current binding. But the binding just has to recognize these two new IDs, very easy to add.
Could someone please look into this?

I’ll look into it. In the meantime you could try adding the lock manually using its IP address instead of discovery, that should theoretically work fine (although /lock and /lockAction expect deviceType as a parameter, not sure what happens if it does not match).

I’ve created updated binding version with smart door/smartlock 3 support, you can get it here - https://github.com/janvyb/files/raw/main/org.openhab.binding.nuki-3.3.0-SNAPSHOT.jar. Uninstall current nuki binding and drop this into addos folder. I can’t test this properly myself since I don’t own smartlock 3.0, so let me know if it works and I’ll create new PR later.

1 Like

Will do, but takes a few days. Probably by end of next week.

@m0rgoth Works fine! Ready to go with Nuki v3.0

1 Like

Great, I’ve created new PR to add the smartlock 3.0 support - [nuki] Support for SmartLock 3.0 and SmartDoor by janvyb · Pull Request #12005 · openhab/openhab-addons · GitHub. There was also a small change in values of smartlockDoorState channel (just some new values for the new external sensor) so I updated the documentation.

Thanks so much!

Does This only work with the pro version?

No, to use nuki with openhab you need Nuki Bridge (which works with all Nuki versions). As far as I know the pro version does not provide local HTTP API like the bridge does.

So you need the simple Nuki 3.0 (149 €) and the Bridge (99 €) Right?

Because I want to order the nuki

Yep, that one, basically bridge and any nuki version.

Hm is this 3.3.0-SNAPSHOT compatible with OH 3.1 latest? I’ve put the jar into the addons folder and adapted permissions. Also restarted the openhabian pi again. But the addon seems not to be picked up. The old version I deinstalled before. If I try to manually add the binding via UI (+), it shows only 3.1 as offer.

Yes, I’ve tried it with 3.1 and 3.1.1 and it works just fine. Try looking into openhab logs if there’s any error.

Ah, my bad - works for me as well. It was auto-enabled. I was confused because it didn’t appear under installed bindings :).

Hey again. Meanwhile I bought the real bridge - the android software bridge was not so reliable. I have now a combination of the new SmartLock 3.0 (non pro) and the hardware bridge. Unlocking and locking including callbacks seem to work. Thanks for that!

The only issue I have is, although I’ve enabled “Unlatch” in the OH SmartLock thing settings, If I open the door via OH, it only unlocks - but does no unlatch. I called the /unlock API on the bridge manually providing the token and the nukiId, there it unlatches properly. Any idea what might be wrong? I’ve installed the SNAPSHOT version that was mentioned earlier. Also in the app the door is configured with a knob. Also there it unlatches properly.

Yeah, you’re right. There’s a bug and the configuration for smartlock handler is only loaded when the handler is created - which only happens on OH startup, I’ll fix that.
As a workaround for now, every time you change unlatch property you have to either restart openHAB or uninstall and install the binding again (if you have the snapshot jar in addons folder, just move it somewhere else, wait till it’s uninstalled and put it back again).
But to be honest I’m not sure I’d trust openHAB enough to let it open my front door, especially using some rule I’ve written. I use it mainly to lock doors when I leave or at night and unlock it in the morning. For opening (unlatching) I use Nuki app only.

Ah, ic. Thanks!

Yeah I fully agree @ not opening the door automatically :)!

For me it’s a sidedoor from the garage to the house. Since I don’t want to rely on the Nuki app and all boilerplate which comes with it (finding the phone, unlock, start the app, auth, selecting the lock, finally unlatch), I want do go a more pratical way here using a keypad. But since the Nuki keypad is only limited to Nuki itself and not general purpose, it makes it hard/impossible e.g. to disarm an alarm before actually opening the door. Also you can’t trigger any other actions based on different codes since Nuki APIs don’t provide that currently.

So my idea is now to buy one of the Linkind keypads that seem to be able to connect using a zigbee usb stick and zigbee2mqtt. The protocol seems pretty straightforward to be handled by a OH rule. As it seems you can then also provide feedback to the user whether something went wrong etc. And you can trigger whatever you want using keycodes. A zigbee stick plus the keypad in sum is still cheaper than the Nuki keypad and is way more open.

So pressing 6 buttons (or whatever count suits you) is hopefully more quickly than doing the Nuki app thing. Also you can’t forget your keypad :). I know that something like auto-unlock exists if you’re nearby the lock - but I can imagine certain situations, where I maybe want to park in the garage and NOT open the sidedoor door but use the frontdoor. In that case it would most likely open the sidedoor once I’m leaving the car :/.

Long (and hopyfully interesting?) story short: I need a way to unlatch the door using openhab item. Yesterday evening I also found the option to write to the lockState channel right? Maybe that’s a better way to go for me then. WDYT?