ebaauw / homebridge-nb

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

Feature Request: configure which devices to expose #69

Closed lsinger closed 1 year ago

lsinger commented 2 years ago

I have a Nuki Smart Lock and a Nuki Opener. The lock I had added via HomeKit already, but the Opener doesn't have HomeKit support so I'm using this Homebridge plugin -- so now I have two instances of the lock in Apple Home.

Since Homebridge is one more thing that can fail, I'd like to keep using the HomeKit-native lock and remove the Homebridge-provided lock. Unfortunately I cannot remove it manually and also cannot configure this in the plugin or in Apple Home.

For this reason it would be great if I could check / uncheck which devices to expose in the plugin settings.

-- I love that this plugin exists, so thank you for your effort. ❤️

ebaauw commented 2 years ago

I might have a look at this, once I'll have figured out how to do dynamic settings for Homebridge deCONZ, using the Homebridge UI. I won't be supporting this through config.json, as I don't want to support users figuring out and copy/pasting the NukiIDs of their devices.

Note that the native HomeKit feature of the Nuki Smart Lock uses BLE. Make sure the lock is in range of your home hub (Apple TV or Homepod), or it will respond only when your Apple device is in range of the lock.

patricks commented 2 years ago

I also would love this feature 😊

discostur commented 1 year ago

Would also love to see this feature getting implemented :)

pserbanp commented 1 year ago

Same setup and situation here ( as kind of workaround you can hide one from Home View but in the room will still be both) would love to see the option there

dimovic69 commented 1 year ago

Waiting for this feature... need to remove manually some Nuki devices from Home App

Nastras commented 1 year ago

Hi Erik, I would like to switch from homebridge-nuki to your homebridge-nb plugin. I have one lock which is installed on a door bolt. This has therefore no latch and can only be opened or locked.

If I see it correctly in this issue it is currently not possible to hide locks or functions. But this would be very important for my door bolt.

Since the issue is already older I wanted to ask you how the chances are that it will be implemented soon?

Ps. homebridge-deconz including group function runs perfectly since the last update 👌.

ebaauw commented 1 year ago

If I see it correctly in this issue it is currently not possible to hide locks or functions

You don't. You cannot select which devices to expose ("hide locks"), but you can configure whether or not to expose a second Lock Mechanmism for the latch function, in config.json (see the help on the form in the Homebridge UI).

Nastras commented 1 year ago

That is a good hint and should hopefully solve my problem. I will try it out. Thanks!

ebaauw commented 1 year ago

v1.4.2 supports whitelisting devices to be exposed in config.json. See the Settings form in the Homebridge UI for details.

The devices key takes an array of integers. When left empty, all discovered Nuki bridges and connnected devices are exposed. When non-empty, only devices whose Nuki ID are listed are exposed. Note that you need to whitelist the Nuki bridge, in addition to the devices connected to that bridge. For the bridge, use the bridgeId value as returned by nb discover, or the ids/jserverId value as returned by nb info. For Smart Locks and Openers, use the nukiId value, as returned by nb list.

Note that whitelisted devices still need to be discovered before they are exposed.

Nastras commented 1 year ago

Works great! @lsinger @patricks @discostur

francescosabia commented 7 months ago

v1.4.2 supports whitelisting devices to be exposed in config.json. See the Settings form in the Homebridge UI for details.

The devices key takes an array of integers. When left empty, all discovered Nuki bridges and connnected devices are exposed. When non-empty, only devices whose Nuki ID are listed are exposed. Note that you need to whitelist the Nuki bridge, in addition to the devices connected to that bridge. For the bridge, use the bridgeId value as returned by nb discover, or the ids/jserverId value as returned by nb info. For Smart Locks and Openers, use the nukiId value, as returned by nb list.

Note that whitelisted devices still need to be discovered before they are exposed.

please where i need to put the commands like nb discover to obtain lock id? i tried in terminal but doesn't work

ebaauw commented 7 months ago

It should work from the terminal in the Homebridge UI. Otherwise try npx nb discover.

francescosabia commented 7 months ago

It should work from the terminal in the Homebridge UI. Otherwise try npx nb discover.

doesn't work pi@homebridge:/var/lib/homebridge $ npx nb list nb: fatal: Missing host. Set NB_HOST or specify -H. pi@homebridge:/var/lib/homebridge $ nb list nb: fatal: Missing host. Set NB_HOST or specify -H. pi@homebridge:/var/lib/homebridge $

ebaauw commented 7 months ago

But it does work. As the message indicate, you need to specify where to find the Nuki bridge, either by setting the NB_HOST environment variable, or by specifying nb -H x.x.x.x list, replacing the x-s with the IP address of the bridge. Use nb discover to find that.

Next, nb will complain about not having a token. Press the button on the bridge and issue nb -H x.x.x.x auth to obtain it. Then set NB_TOKEN, or specify it through nb -H x.x.x.x -T xxxxx list.