benzman81 / homebridge-nukiio

Nuki.io support for Homebridge: https://github.com/nfarina/homebridge
GNU General Public License v3.0
42 stars 5 forks source link

RingToOpen takes 10+ sec to respond #70

Closed DJay-X closed 3 years ago

DJay-X commented 3 years ago

Hi @benzman81 I hope you are doing well.

I notice a while ago that it takes 10+ sec when asking Siri to disable RingToOpen/ContinuousMode. Also via App it's not smooth. After this time it's always is doing it's job and is closed. However, due to the long response time Siri and any HomeKit App "thinks" it was not successful or not responding.

Any chance to fix this from plugin site? Probably it's the Nuki API slowing things down. :/

Thanks in advance for considering any solution.

benzman81 commented 3 years ago

Can you post a snippet of the log. I guess its the bridge taking too long to answer. See #37

DJay-X commented 3 years ago

Of course when I try it now to test, it is working. unlock/lock

[12.12.2020, 14:30:22] [NukiBridge] Send request to Nuki bridge 'http://xxx.xxx.xxx.xx' on '/lockState' with '{"token":"000000","nukiId":"000000000","deviceType":2}'.
[12.12.2020, 14:30:23] [NukiBridge] Request to Nuki bridge 'http://xxx.xxx.xxx.xx' finished with status code '200' and body '{"success": false}'. null
[12.12.2020, 14:30:23] [NukiBridge] Request for lock state aborted. This is no problem and might happen due to canceled request or due to long response time of the Nuki bridge. Using cached value isLocked = 'true'.
[12.12.2020, 14:30:23] [DelaySwitch] Starting the Timer
[12.12.2020, 14:30:23] [NukiBridge] Process lock action '4' for Nuki lock '000000000' (instance id '0') on Nuki bridge 'http://xxx.xxx.xxx.xx'.
[12.12.2020, 14:30:23] [NukiBridge] Send request to Nuki bridge 'http://xxx.xxx.xxx.xx' on '/lockAction' with '{"token":"000000","nukiId":"000000000","deviceType":2,"action":"4"}'.
[12.12.2020, 14:30:26] [NukiBridge] Request to Nuki bridge 'http://xxx.xxx.xxx.xx' finished with status code '503' and body 'HTTP 503 Unavailable'. null
[12.12.2020, 14:30:26] [NukiBridge] An error occured processing lock action. Will retry now...
[12.12.2020, 14:30:26] [NukiBridge] HomeKit state change complete.
[12.12.2020, 14:30:27] [NukiBridge] [INFO Nuki WebHook Server] Updated lock state from webhook to isLocked = 'true' (Nuki state '1' ) for lock '000000000' (instance id '0') with batteryCritical = 'false', battery charging = 'false', battery charge state = '100', contactClosed = 'true' and mode = '2', ringactionState = 'false'.
[12.12.2020, 14:30:27] [NukiBridge] HomeKit state change by webhook complete. New isRingToOpenLocked = 'true' and batteryCritical = 'false', battery charging = 'false', battery charge state = '100' and mode = '2', ringactionState = 'false'.
[12.12.2020, 14:30:29] [NukiBridge] Process lock action '4' for Nuki lock '000000000' (instance id '0') on Nuki bridge 'http://xxx.xxx.xxx.xx'.
[12.12.2020, 14:30:29] [NukiBridge] Send request to Nuki bridge 'http://xxx.xxx.xxx.xx' on '/lockAction' with '{"token":"000000","nukiId":"000000000","deviceType":2,"action":"4"}'.
[12.12.2020, 14:30:29] [NukiBridge] Request to Nuki bridge 'http://xxx.xxx.xxx.xx' finished with status code '200' and body '{"success": true, "batteryCritical": false}'. null
[12.12.2020, 14:30:29] [NukiBridge] HomeKit state change complete.
[12.12.2020, 14:30:30] [NukiBridge] HomeKit change for ring to open back to unlock state complete as continous mode is still active.
[12.12.2020, 14:30:40] [NukiBridge] [INFO Nuki WebHook Server] Updated lock state from webhook to isLocked = 'true' (Nuki state '1' ) for lock '000000000' (instance id '0') with batteryCritical = 'false', battery charging = 'false', battery charge state = '100', contactClosed = 'true' and mode = '3', ringactionState = 'false'.
[12.12.2020, 14:30:40] [NukiBridge] HomeKit state change by webhook complete. New isRingToOpenLocked = 'false' and batteryCritical = 'false', battery charging = 'false', battery charge state = '100' and mode = '3', ringactionState = 'false'.
[12.12.2020, 14:31:13] [NukiBridge] Process lock action '5' for Nuki lock '000000000' (instance id '0') on Nuki bridge 'http://xxx.xxx.xxx.xx'.
[12.12.2020, 14:31:13] [NukiBridge] Send request to Nuki bridge 'http://xxx.xxx.xxx.xx' on '/lockAction' with '{"token":"000000","nukiId":"000000000","deviceType":2,"action":"5"}'.
[12.12.2020, 14:31:15] [NukiBridge] Request to Nuki bridge 'http://xxx.xxx.xxx.xx' finished with status code '200' and body '{"success": true, "batteryCritical": false}'. null
[12.12.2020, 14:31:15] [NukiBridge] HomeKit state change complete.
[12.12.2020, 14:31:15] [NukiBridge] Send request to Nuki bridge 'http://xxx.xxx.xxx.xx' on '/lockState' with '{"token":"000000","nukiId":"000000000","deviceType":2}'.
[12.12.2020, 14:31:15] [NukiBridge] Request to Nuki bridge 'http://xxx.xxx.xxx.xx' finished with status code '200' and body '{"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2020-12-11T19:56:20+00:00", "ringactionState": false, "success": true}'. null
[12.12.2020, 14:31:15] [NukiBridge] Lock state is isLocked = 'true' (Nuki state '1' ) with battery critical = 'false', battery charging = 'false', battery charge state = '100', contactClosed = 'true' and mode = '2'
[12.12.2020, 14:31:16] [NukiBridge] HomeKit change for ring to open back to unlock state complete as continous mode is still active.
benzman81 commented 3 years ago

Whats you lock_state_mode in your config? I use 1 as this is the fastest and not request is done that might block other requests. From the log I assume you use lock_state_mode with value 0 which is default. Try to set it to 1 and monitor if it gets any better. If the issue still occurs, post a log with the existing issue.

DJay-X commented 3 years ago

Checked it for a few days now. Opener and Siri voice command seems to be working better now for me with lock_state_mode 1 Thanks. 👍