ebaauw / homebridge-nb

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

Feature request: Adding Nuki opener as a switch instead of a lock? #95

Closed kj99999 closed 1 year ago

kj99999 commented 1 year ago

Is it possible to add the Nuki opener as a button switch that automatically turns off with a delay?

A common use-case I have is to be able to tell Siri to "open the door" which triggers a scene that unlocks the nuki opener buzzer, but with HomeKit it doesn't allow Siri to execute scenes that have a lock involved without the user (someone shouting hey Siri open the door through the front-door for example). But for the Nuki opener which opens the ground floor door of the building, this risk isn't valid.

On another case, adding ring-to-open as a switch as well would also be great, then you can create a HomeKit native automation that based on location, turns on the ring to open feature, instead of relying on the nuki app to be running in the background to correctly do it.

Ideally I'd like to add the nuki opener unlock action and ring to open function as a switch button, that through the config would automatically switch back off (do nothing with switch off). Then this can be added to any scene without user intervention.

Super smooth setup with the plugin, you really automated everything!

ebaauw commented 1 year ago

with HomeKit it doesn't allow Siri to execute scenes that have a lock involved without the user

Doesn't ring a bell (pun intended), but I don't think I've ever tried to buzz the front door through a scene triggered by Siri. I do still enjoy it very much when Siri buzzes me in, when I tell her on my Apple watch to open the front door - no scene needed for that.

adding ring-to-open

Ring to Open is already exposed as a custom characteristic on the opener's Lock Mechanism service. Use a decent HomeKit app, like Eve, to see it and add it to a HomeKit scene.

kj99999 commented 1 year ago

Ah meant it doesn't trigger from automations or Siri where it's not triggered directly with the user presence behind a device. Its a security thing so people don't shout the command to open to a HomePod behind a door or someone doesn't just take your phone and unlock your house because of location based automation that unlocks the door. Workaround (not sure it still works) is another automation that reacts to an accessory like a light (when light on, unlock lock). This is all for apple home app automations anyway.

I see, didn't use the Eve app before but might give it a try.

After a bunch of trial and error, I solved my need for now via webhooks on another plugin btw. Managed to expose what I need with the opener as switches using the homebridge webhooks plugin. Leaving my setup for prosperity:

Unlock opener switch, auto off in 5s: Buzzes the opener on command. I can't use a lock accessory on HomePod like this, it would ask me to finish on my personal device. With it as a switch accessory Siri complies with no issues.

RTO Switch: On turns on RTO state, Off turns off RTO state. Just for a control point in HomeKit and I can ask Siri to do them.

RTO as a on toggle, auto off in 5s: When this switch goes on, it automatically goes off in 5 seconds. This works for location automation, since it goes off and is not state aware, it will always work because of the auto off, the automation will always turn it on basically.

Now I don't need to rely on the nuki app running in the background, and works from all my apple devices, and Siri even on HomePod. You can also create an NFC tag automation with this or using the lock workaround.

This of course circumvents the sensible security limitations Apple set.