Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuki Opener Changing Rooms #141

Closed
kloibs opened this issue Aug 30, 2024 · 7 comments
Closed

Nuki Opener Changing Rooms #141

kloibs opened this issue Aug 30, 2024 · 7 comments
Labels
invalid This doesn't seem right

Comments

@kloibs
Copy link

kloibs commented Aug 30, 2024

Hi there!

I’ve been experiencing an issue recently seemingly out of nowhere. Whenever I reboot Homebridge, my Nuki Opener will default back to the same room my bridge is assigned to and also removes itself from automations I have it in.

Any idea as to what may cause this? I’m currently on iOS 18 public beta but this happened before as well.

Thank you!

@ebaauw
Copy link
Owner

ebaauw commented Aug 30, 2024

That happens when Homebridge stops exposing the Opener (for a while) and then re-exposes it, causing HomeKit to treat it as a new accessory. Most likely, this happens when Homebridge starts while the Opener hasn't been saved to cachedAccessories. In theory (I suppose) this could also happen when Homebridge NB removes the Opener because it's no longer exposed by the Nuki bridge.

What system are you running on? In case of a Raspberry Pi: double check the uSD card. They turn read-only when failing, but you won't notice that on a running system due to file system cache.

How do you "reboot Homebridge"? Is Homebridge shutdown cleanly, and is the Opener saved to cachedAccesories.

If those two check out, please capture a debug logfile of Homebridge restarting and attach that here. Make sure to run Homebridge in DEBUG mode, and set Log Level on the Nuki bridge accessory to 2 (using Eve or another decent HomeKit app).

@redeemer666
Copy link

Same here, every time I reboot homebridge or your plugin, all informations about my 2 locks and the opener will reset (room, name etc). Sometime it also happens if I don't reboot HB at all. This is starting since the previous version of the plug-in, and continue with the latest.

@ebaauw
Copy link
Owner

ebaauw commented Sep 2, 2024

Same here

Are you also on iOS 18 beta?

Sometime it also happens if I don't reboot HB at all.

Please capture and attach a debug log of when this is happening.

@redeemer666
Copy link

Same here

Are you also on iOS 18 beta?

Sometime it also happens if I don't reboot HB at all.

Please capture and attach a debug log of when this is happening.

Yes I'm on 18 dev beta. Will post here the log ASAP

@ebaauw
Copy link
Owner

ebaauw commented Sep 2, 2024

Yes I'm on 18 dev beta.

This is worrying - officially, smart lock accessories aren't allowed to be bridged. It has worked so far, but maybe Apple changed that in iOS 18. I might need to expose the locks as standalone accessories instead.

@redeemer666
Copy link

OK I don't have a debug log yet, but looking at it it looks like it's happening randomly during homebridge restart or normal use when device "hangs" on answering to the plugin (this happens more frequently with my "Garage lock", that is connected to the house via a Powerline adapter). Maybe the plugin have too much haste on deleting the cache that cause the issue?

@ebaauw
Copy link
Owner

ebaauw commented Sep 5, 2024

Homebridge NB doesn’t remove accessories while running. It only removes accessories on startup, when 1) they’re no longer reported by the Nuki bridge and 2) removeStaleAccessories has been set in config.json.

There was an issue that Homebridge NB could publish accessories in the wrong order, which would cause the order in cachedAccessories to be wrong. A connected accessory would be restored by Homebridge before the Nuki bridge, but without a restored Nuki bridge accessory, Homebridge NB cannot restore the connected accessory. This issue is fixed in v1.4.23, but I cannot change the order in cachedAccessories if it’s already wrong. I need to see the debug log to access whether you’re suffering from this issue, or from another one. Again this issue would only remove accessories on startup of Homebridge NB. The remedy here is to temporarily disable Homebridge NB, so Homebridge removes all its accessories from cache. After re-enabling Homebridge NB, it will re-publish everything in the right order.

ebaauw added a commit that referenced this issue Sep 18, 2024
Change restore logic.  Might solve an assumed race condition during startup causing accessories to be removed and re-created, see #141.
@ebaauw ebaauw closed this as completed Sep 18, 2024
@ebaauw ebaauw added the invalid This doesn't seem right label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants