Nuki Smartlock + Openhan 3 configuraation

Hi All,

i’m using OH3 and the Nuki SmartLock with the respective bridge.
Setting up the binding with bridge, and smartlock was pretty much straight forward.
Also the configruation part as described in the bindings manual was no big deal.
However i observed, that when i open the door with follwoing switch:

Switch Frontdoor_Lock "Haustür (Unlock / Lock)" <nukiwhite> ["Blinds"] {ga="Door", channel="nuki:smartlock:haustuer:unlock" }

It opens once including unlatching the door, but when the door gets closed, i cant use the same command agagin. It then locks the door instead of opens it. I also get every time the follwoing errors:

[INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nuki:smartlock:haustuer' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Bad Request
&
[INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nuki:smartlock:haustuer' changed from OFFLINE (COMMUNICATION_ERROR): Bad Request to ONLINE

I understand that a switch has two states, on and off, but how do i manage it from usability perspective.
Do i need to reset the status of the swicht once the door is open, so i can habe one switch only for opening the door?

Any hint is highly appreciated-.

Hi,

I would advise you to use the Lockstate item to control your SmartLock. In order to control each of the functions with a button press, I have Switch items that send the respective command to the Lockstate item:

@rule("NUKI_LOCK", description="NUKI_LOCK", tags=["Nuki", "Doors", "Lock"])# description and tags are optional
@when("Item NUKI_LOCK changed to ON")
def NUKI_LOCK(event):
NUKI_LOCK.log.info("Locking NUKI through NUKI_LOCK")
        events.sendCommand("NukiSmartLock_LockState","4")
        events.sendCommand("NUKI_LOCK","OFF")

Maybe even better implement it with “received command ON”.
The Lockstate feedback from the lock is not immediate, as it tries to save battery and won’t update the state in real time. That’s probably also why your Switch doesn’t work all the time.