Closed switey closed 4 months ago
I can confirm that clicking "identify" fixes current state shown in homekit
So the issue is really that the cached lock state on the Nuki bridge isn’t updated. This is either a firmware bug in the smart lock, or a communication issue between the smart lock and the bridge. You might want to check the signal strength in the Connection State in the Nuki app, or move the bridge closer to the smart lock. Also double-check that the smart lock and bridge are on the latest (non-beta) firmware.
I can confirm that nuki app shows lock state properly at all times
The app probably connects to the smart lock directly over Bluetooth. Does it also show the correct state when away from home? Or at least, outside of the Bluetooth range of the smart lock? Or when you disable Bluetooth on your phone?
here's homebridge log of events described above
The bridge reports the smart lock state as unlocked. I fear there nothing I can do in Homebridge NB, except forcing the bridge to update its cached state every time Homebridge NB polls the bridge. Nuki explicitly warn against this, as it will drain the smart lock battery very quickly.
yeah, nuki app shows lock state correctly even with wifi and bluetooth off the bridge and lock are 1,5 m away from each other, the signal strength is good
a new thing is I've started seeing warnings in homebridge log after using homekit to change lock state
[4/6/2024, 10:06:20 AM] [Nuki] Zamek: Lock Target State: changed to 0 (from 1) [4/6/2024, 10:06:20 AM] [Nuki] Nuki_Bridge_52A47FE9: request 6: GET /lockAction?nukiId=3C8862ED&deviceType=[object Object]&action=1 [4/6/2024, 10:06:23 AM] [Nuki] Nuki_Bridge_52A47FE9: request 6: 200 OK [4/6/2024, 10:06:23 AM] [Nuki] Zamek: Lock Current State: set to 0 (from 1) (node:316) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeMetadataResponse listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit [4/6/2024, 10:06:31 AM] [homebridge-ezviz] Updating info for Salon Sleep Mode (node:316) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit (node:316) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeStatusUpdate listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit (node:316) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit [4/6/2024, 10:06:36 AM] [Nuki] flush cachedAccessories [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: request 7: GET /callback/list [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: request 7: 200 OK [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: subscription: {"id":0,"url":"http://192.168.0.8:53376/notify/52A47FE9"} [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: request 8: GET /info [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: request 8: 200 OK [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: bridge: {"bridgeType":1,"ids":{"hardwareId":1013065235,"serverId":1386512361},"versions":{"firmwareVersion":"2.17.0","wifiFirmwareVersion":"2.4.0"},"uptime":466,"currentTime":"2024-04-06T08:07:03+00:00","wlanConnected":true,"serverConnected":true,"scanResults":[{"deviceType":2,"nukiId":930999314,"name":"Nuki_Opener_377DEC12","rssi":-55,"paired":true},{"deviceType":4,"nukiId":1015571181,"name":"Nuki_3C8862ED","rssi":-52,"paired":true}]} [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: Last Updated: set to "Sat Apr 06 2024 10:07:03" (from "Sat Apr 06 2024 10:06:03") [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: request 9: GET /list [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: request 9: 200 OK [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: device: {"deviceType":4,"nukiId":1015571181,"name":"Zamek","firmwareVersion":"4.2.6","lastKnownState":{"mode":2,"state":3,"stateName":"unlocked","batteryCritical":false,"batteryCharging":false,"batteryChargeState":98,"timestamp":"2024-04-06T08:06:20+00:00"}} [4/6/2024, 10:07:06 AM] [Nuki] Zamek: Last Updated: set to "Sat Apr 06 2024 10:06:20" (from "Sat Apr 06 2024 10:04:44") [4/6/2024, 10:07:06 AM] [Nuki] Nuki_Bridge_52A47FE9: device: {"deviceType":2,"nukiId":930999314,"name":"Domofon","firmwareVersion":"1.10.1","lastKnownState":{"mode":2,"state":1,"stateName":"online","batteryCritical":false,"ringactionTimestamp":"2024-04-05T23:34:28+00:00","ringactionState":false,"timestamp":"2024-04-06T07:59:29+00:00"}}
I think the event listener warnings are caused by Homebridge itself. How many child bridges did you configure? More that 10?
4 child bridges including homebridge nb
testing numerous scenarios I've found that opening nuki app triggers an update on lock state for homebridge-nb
the moment nuki app is opened on my phone these log messages appear
[4/6/2024, 3:01:45 PM] [Nuki] Zamek: Lock Current State: set to 1 (from 0) [4/6/2024, 3:01:45 PM] [Nuki] Zamek: Lock Target State: set to 1 (from 0)
this happens both on local network with bluetooth on and with bluetooth and wifi disabled
further testing lead me to conclusion that it is a nuki firmware bug, here's the message posted on nuki developers forum
Problem: Nuki Smart Lock stopped updating bridge on its current state. In the following scenarios:
pressing the lock button to lock or unlock the door being auto-locked after staying unlocked being auto-locked after initiating lock’n’go Calling http://[IP]:8080/info?token=[TOKEN] doesn’t show actual lock state until one of the following happens:
Nuki app gets opened on my smartphone- calling http://[IP]:8080/lockState?nukiId=[ID]&deviceType=4&token=[TOKEN] This doesn’t happen (meaning the lock state gets updated to the bridge properly) when:
using the app to lock or unlock door calling http://[IP]:8080/[lock/unlock]?nukiId=[ID]&deviceType=4&token=[TOKEN] it seems that it is some kind of internal firmware bug which needs to be fixed it’s a shame given that my lock 4.0 is brand new and there are some many things that are wrong with it, starting with inability to add it to homekit natively via matter. I’ve started to use homebridge as a way of working around it but it relies on api and buggy firmware
Closing as there's nothing more we can do in Homebridge NB.
hello, lock stopped showing its current state properly ever since last update
this happens after regular lock/unlock actions via button presses as well as lock'n'go it works both ways, ie: lock stuck on "locked" even though lock button has been pressed to unlock the door lock stuck on "unlocked" after unlocking via homekit and being auto-relocked after 1 min (internal nuki lock setting) I can confirm that clicking "identify" fixes current state shown in homekit I can confirm that nuki app shows lock state properly at all times
here's homebridge log of events described above 8:00:24 nuki locked is being unlocked via homekit app and remains unlocked at time of me writing this, 24 minutes later