Bridge API slow to communicate that lock was lock/unlocked

After lots of discussing on some posts here, Facebook and other communities, I could notice that my bridge + may have some problem, for some reason everybody that uses bridge API receives the unlock/lock state change on their plugins (for home assistant or homebridge) super fast, but for me it takes at least 10 seconds, even though my bridge is very very lock to the lock.

Any ideas what can be wrong? I already factory reseted the bridge and also power cycled the lock

Iā€™d have a look at the /log output of the bridge API at the time when an event happens on the Smart Lock until the call back is fired.

Is there an easy way I can access this log? @Juergen

Yes just use an Webbrowser:

https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4/#heading--log

Thanks man!

1 Like

@Juergen I couldnā€™t find any information that could give an insightā€¦ the /log endpoint took a while to load after I locked and then after I unlocked manuallyā€¦ could mean that the endpoint/bridge api is sort ofā€¦ lagging? (not sure if this would be the right term haha)

Here is my log (I removed nukiID though)

        "timestamp": "2023-01-10T21:02:18+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:02:03+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Disconnected",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:02:03+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Disconnect",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:02:03+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-ConnectionTimeout"
    },
    {
        "timestamp": "2023-01-10T21:02:00+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T21:02:00+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T21:01:58+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-CommandComplete",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:58+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerResponse",
        "pairIndex": 0,
        "bytes": 237
    },
    {
        "timestamp": "2023-01-10T21:01:58+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-SendingSSE",
        "pairIndex": 0,
        "bytes": 56
    },
    {
        "timestamp": "2023-01-10T21:01:58+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-TurnOnNotific",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:58+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Connected",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:01:57+00:00",
        "type": "BLE-Connect",
        "macAddr": "54D272B842E4"
    },
    {
        "timestamp": "2023-01-10T21:01:57+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Connect",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:57+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerRequest",
        "pairIndex": 0,
        "bytes": 56
    },
    {
        "timestamp": "2023-01-10T21:01:33+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Disconnected",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:01:33+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Disconnect",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:01:33+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-ConnectionTimeout"
    },
    {
        "timestamp": "2023-01-10T21:01:29+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T21:01:28+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T21:01:28+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-CommandComplete",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:28+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerResponse",
        "pairIndex": 0,
        "bytes": 245
    },
    {
        "timestamp": "2023-01-10T21:01:28+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-AlreadyConnected",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:28+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerRequest",
        "pairIndex": 0,
        "bytes": 56
    },
    {
        "timestamp": "2023-01-10T21:01:27+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:01:26+00:00",
        "type": "SSE-KeyturnerEventResp"
    },
    {
        "timestamp": "2023-01-10T21:01:26+00:00",
        "type": "HTTP-Post",
        "nukiId": "<nuki-id-hidden-intentionally>"
    },
    {
        "timestamp": "2023-01-10T21:01:26+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerEventReq"
    },
    {
        "timestamp": "2023-01-10T21:01:26+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-ReadStates",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:25+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-TurnOnNotific",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:25+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Connected",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:01:24+00:00",
        "type": "BLE-Connect",
        "macAddr": "54D272B842E4"
    },
    {
        "timestamp": "2023-01-10T21:01:24+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Connect",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:24+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-StateChanged",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:01:13+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:00:53+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Disconnected",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:00:53+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Disconnect",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:00:53+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-ConnectionTimeout"
    },
    {
        "timestamp": "2023-01-10T21:00:50+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-CommandComplete",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerResponse",
        "pairIndex": 0,
        "bytes": 237
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-AlreadyConnected",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerRequest",
        "pairIndex": 0,
        "bytes": 56
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "type": "SSE-KeyturnerEventResp"
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "type": "HTTP-Post",
        "nukiId": "<nuki-id-hidden-intentionally>"
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "SSE-KeyturnerEventReq"
    },
    {
        "timestamp": "2023-01-10T21:00:48+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-ReadStates",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:00:47+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-TurnOnNotific",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:00:47+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Connected",
        "pairIndex": 0,
        "bleHandle": "0001"
    },
    {
        "timestamp": "2023-01-10T21:00:47+00:00",
        "type": "BLE-Connect",
        "macAddr": "54D272B842E4"
    },
    {
        "timestamp": "2023-01-10T21:00:47+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-Connect",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:00:47+00:00",
        "nukiId": "<nuki-id-hidden-intentionally>",
        "type": "BLE-StateChanged",
        "pairIndex": 0
    },
    {
        "timestamp": "2023-01-10T21:00:46+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T21:00:45+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:00:45+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T21:00:39+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:00:37+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:00:26+00:00",
        "type": "HTTP-Log"
    },
    {
        "timestamp": "2023-01-10T21:00:15+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T21:00:14+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:59:45+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:59:44+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:59:15+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:59:14+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:58:44+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:58:44+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:58:14+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:58:14+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:57:44+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:57:44+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:57:14+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:57:14+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:56:44+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:56:44+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:56:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:56:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:55:43+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:55:43+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:55:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:55:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:54:43+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:54:43+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:54:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:54:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:53:43+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:53:43+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:53:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:53:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:52:43+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:52:43+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:52:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:52:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:51:43+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:51:43+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:51:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:51:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:50:43+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:50:43+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:50:13+00:00",
        "type": "HTTP-List"
    },
    {
        "timestamp": "2023-01-10T20:50:13+00:00",
        "type": "HTTP-Info"
    },
    {
        "timestamp": "2023-01-10T20:49:43+00:00",
        "type": "HTTP-List"
    }
]
type or paste code here

From the log everything seems ok:
2023-01-10T21:00:47+00:00 Bridge discovered in BLE scan that the state of the Smart Lock changed
ā€¦
2023-01-10T21:00:48+00:00 Bridge sends Callback via HTTP-Post 1s later

You have an integration running which polls the /list & /info endpoints every 30s, which should not cause problems but should not be needed if you work with callbacks anyway.

Got it, but for example if the communication between the lock and bridge delays, I wonā€™t see in the logs right?

Is there a way to increase the speed/frequency that they communicate? Even though it uses more battery

When there is a state change on the Smart Lock side, the Smart Lock changes its BLE advertising. The bridge scans every few seconds for a changed advertising and tries to connect if it finds one. In your case the time from finding it in the scan to connect and send callback was just 1s. Delays could therefore only come from a too late advertising.

You could try to switch off HomeKit and check if that has an impact, because the number of allowed BLE connections is limited and HomeKit has a similar mechanisms which lets all HomeKit devices connect after a state change too.

Gonna test it out, thanks!

@Juergen ok, removing it from Homekit improved it tremendouslyā€¦ sad that I have to choose between the options though :confused: