kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
184 stars 36 forks source link

Unlatch not possible , especially when using Homekit (Siri) #49

Open Shoomaan opened 2 years ago

Shoomaan commented 2 years ago

Hey there, I'm quite happy with the integration, running a lot smoother then die official one. But I'm struggling with opening the door when I'm outside:

With the HomeKit Integration from Nuki, the door gets unlatched when I tell Siri to open the door. In both cases, when the door is locked and also when the door is already unlocked. This behavior comes from configuring bar / knob in the Nuki App.

Within the Nuki App, I can select between unlock and open. This would be the best option in HomeKit too, but not possible because of HomeKit restrictions.

With your integration, it always just unlocks the door, it never unlatches.

So I think there is no best way for all use cases but while searching I found this thread on the Nuki Dev board: https://developer.nuki.io/t/homekit-unlock-command-opens-door/533/15

Within this thread someone recommends adopting the way of the homebridge plugin which allows using several customizable options. Perhaps it is possible to implement this function into your integration?

I think an implementation just like the one in homebridge-nuki plugin would be perfect; see: >https://github.com/lukasroegner/homebridge-nuki 31

unlatchFromLockedToUnlocked : If set to true, the door is unlatched when you switch from “locked” to “unlocked” in the Home app. If set to false, the door is just unlocked when you switch from “locked” to “unlocked” in the Home app. (only for SmartLock)

unlatchFromUnlockedToUnlocked : If set to true, the door is unlatched when you switch from “unlocked” to “unlocked” [1] in the Home app (this move is valid and works in the Home app, just hold down the switch, swipe it to “locked” and then “unlocked” without releasing your finger - do not release the finger until you reached the “unlocked” position again). If set to false, nothing is done when you switch from “unlocked” to “unlocked” in the Home app. [2] (only for SmartLock)

unlatchLock : If set to true, a second lock switch is exposed for unlatching the smart lock. (only for SmartLock)

[1] Also works with Siri, you can ask to unlock devices that are already unlocked.

[2] If you use this mode of operation, the separate unlatchLock is not really necessary. Use unlatchFromLockedToUnlocked: true , unlatchFromUnlockedToUnlocked: true and unlatchLock: false to mimic the HomeKit behavior of the lock.

best regards, Lars

alexdelprete commented 2 years ago

Lars, the component supports unlatching, did you read the readme of the component?

image

And in the Useful Tips section there's this:

image

Shoomaan commented 2 years ago

of course i have read the readme. And I also saw that the lock.open command can be used to open the trap. But my problem is that in Homekit I have only unlock and lock. That's why my suggestion / wish was to configure the possibility of what should happen when lock.unlock is triggered. In the linked Homebridge plugin it is even further expanded that you can configure what should happen when the lock has the status locked or unlocked.

Current operation of this integration lock.lock - lock the door lock.unlock - unlock the door lock.open - open the latch

Operation of Nuki App with Homekit Var 1 - door knob configured lock - lock the door unlock - unlock the door and open the latch

Var2. Lever configured lock - lock the door unlock - unlock the door

Wish / Homebridge mode of operation lock - locking the door configurable mode of operation: a) unlock - unlock the door b) unlock - unlock door and open latch c) unlock if status is locked - open latch d) locked if status is locked - unlock door

I hope I could explain better what I mean.

Greetings Lars

alexdelprete commented 2 years ago

Ok, now I understand what you mean.

This would require the implementation of the Bridge API "Simple Lock Actions", described [here]:(https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4#heading--simple-lock-actions):

image

The endpoints would be /lock and /unlock, instead of /lockAction, that is currently used, IIRC.

It could also be implemented in a different way: continue to use /lockAction but with a configurable option that would override the default unlockaction with unlatch. This is what I opted for with my original Nuki Card automation, the user could choose which action the bridge had to send for lock and unlock commands.

This is a Feature Request, could be implemented through a configurable option, but it's up to @kvj to decide.