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

Hybrid mode not working #89

Closed
mluecke09 opened this issue Aug 26, 2022 · 37 comments · Fixed by #90 or #92
Closed

Hybrid mode not working #89

mluecke09 opened this issue Aug 26, 2022 · 37 comments · Fixed by #90 or #92

Comments

@mluecke09
Copy link

Hi,

I've installed the latest version 0.3.8 and provided the bridge and web token. The new sensors are missing and it seems that the integration is only using the bridge.

2022-08-26 12:21:11.720 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nuki_ng which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 12:21:19.609 DEBUG (MainThread) [custom_components.nuki_ng] async_setup_entry: {'address': '192.168.86.47', 'hass_url': 'http://192.168.86.40:8123', 'token': 'XXXXXX', 'web_token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'update_seconds': 30, 'name': '', 'use_hashed': True}
2022-08-26 12:21:20.230 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 12:21:20.230 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 12:21:23.379 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-23T11:09:03+00:00", "ringactionState": false, "timestamp": "2022-08-26T06:47:45+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -63, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 44, "keypadBatteryCritical": false, "doorsensorState": 240, "doorsensorStateName": "tampered", "timestamp": "2022-08-26T06:47:47+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -60, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": XXXXXXXXX}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 790481, "currentTime": "2022-08-26T10:21:23+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXXNuki_XXXXXXXX", "rssi": -60, "paired": true}, {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -63, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 12:21:23.379 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 3.769 seconds (success: True)
2022-08-26 12:21:59.081 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 12:21:59.081 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 12:22:00.504 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-23T11:09:03+00:00", "ringactionState": false, "timestamp": "2022-08-26T06:47:45+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -73, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 44, "keypadBatteryCritical": false, "doorsensorState": 240, "doorsensorStateName": "tampered", "timestamp": "2022-08-26T06:47:47+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -70, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": XXXXXXXXX}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 790520, "currentTime": "2022-08-26T10:22:02+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -70, "paired": true}, {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -73, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 12:22:00.504 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.504 seconds (success: True)
2022-08-26 12:22:30.103 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 12:22:30.103 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 12:22:31.639 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-23T11:09:03+00:00", "ringactionState": false, "timestamp": "2022-08-26T06:47:45+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -63, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 44, "keypadBatteryCritical": false, "doorsensorState": 240, "doorsensorStateName": "tampered", "timestamp": "2022-08-26T06:47:47+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -69, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": XXXXXXXXX}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 790552, "currentTime": "2022-08-26T10:22:34+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -69, "paired": true}, {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -63, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 12:22:31.639 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.637 seconds (success: True)
2022-08-26 12:23:01.157 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 12:23:01.158 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 12:23:02.685 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-23T11:09:03+00:00", "ringactionState": false, "timestamp": "2022-08-26T06:47:45+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -71, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 44, "keypadBatteryCritical": false, "doorsensorState": 240, "doorsensorStateName": "tampered", "timestamp": "2022-08-26T06:47:47+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -60, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": XXXXXXXXX}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 790583, "currentTime": "2022-08-26T10:23:05+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -60, "paired": true}, {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -71, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 12:23:02.685 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.685 seconds (success: True)
2022-08-26 12:23:32.087 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 12:23:32.087 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 12:23:33.622 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-23T11:09:03+00:00", "ringactionState": false, "timestamp": "2022-08-26T06:47:45+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -63, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 44, "keypadBatteryCritical": false, "doorsensorState": 240, "doorsensorStateName": "tampered", "timestamp": "2022-08-26T06:47:47+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -60, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": XXXXXXXXX}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 790614, "currentTime": "2022-08-26T10:23:36+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -60, "paired": true}, {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -63, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 12:23:33.622 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.622 seconds (success: True)

@kvj
Copy link
Owner

kvj commented Aug 26, 2022

Wrong ticket

@kvj kvj reopened this Aug 26, 2022
@sp7dpt
Copy link

sp7dpt commented Aug 26, 2022

Yes, I checked. If you enter token bridge api and token web api, you will only have bridge sensors. Web API sensors are not displayed. If you only enter the web api token, the web api sensors will appear instead of appearing on the bridge.

I don't know if a hybrid is possible.

@mluecke09
Copy link
Author

I think so… 🤔

Supported modes:

  • Nuki Bridge-only, with automatic webhook registration
  • Cloud Web API, without Nuki bridge (Nuki Lock 3.0 Pro). Polling only
  • Hybrid, using best parts of both

@sp7dpt
Copy link

sp7dpt commented Aug 26, 2022

hmm ... @kvj How is it supposed to work?

@kvj
Copy link
Owner

kvj commented Aug 26, 2022

well, the log looks strange. Despite the fact that web_token is present in the config object, no web API specific lines are there. Are you sure that there's no other errors/exceptions in the log?

@mluecke09
Copy link
Author

mluecke09 commented Aug 26, 2022

I've no errors in the log after startup and only get messages for bridge polling every 30 seconds. I also removed and reinstalled the integration without any change.

HA logging is enabled with the following lines.

logger:
  default: warning
  logs:
    custom_components.nuki_ng: debug

@kvj
Copy link
Owner

kvj commented Aug 26, 2022

weird.
I normally run nuki_ng in hybrid mode.
This is what I enter:
Screenshot from 2022-08-26 16-22-02

This is what I get:
Screenshot from 2022-08-26 16-23-04

@mluecke09
Copy link
Author

mluecke09 commented Aug 26, 2022

My lock is a 3.0 Pro which Is connected to the Nuki Bridge (Wifi is disabled). Like you, I also provide the Bridge & Web API Token.

I want to use the new ring suppression configuration switches and didn’t realized the missing switches/sensors before.

This is what I get:
467E288D-1729-4313-B910-D3FBF9220841

@sp7dpt
Copy link

sp7dpt commented Aug 26, 2022

I have web api token and bridge api token entered, but I do not have these sensors as you are.
I have nuki lock 3.0 with bridge.

@kvj
Copy link
Owner

kvj commented Aug 26, 2022

@sp7dpt @mluecke09
if you're familiar with python and local files of your hass install,
you can add to the nuki.py, right after the line async def _update(self):, with proper indent the following line
_LOGGER.debug("_update: can bridge = %s, can web = %s", self.api.can_bridge(), self.api.can_web())

restart your hass with nuki_ng debug log enabled and share the output. this will help us to understand what's happening

@mluecke09
Copy link
Author

I've changed the nuki.py and captured the logs with the following logging configuration.

logger:
  default: warning
  logs:
    custom_components.nuki_ng: debug
2022-08-26 19:26:50.526 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 19:26:50.528 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration watchman which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 19:26:50.529 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration adaptive_lighting which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 19:26:50.530 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration powercalc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 19:26:50.531 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration skyq which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 19:26:50.532 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nuki_ng which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-26 19:26:58.255 DEBUG (MainThread) [custom_components.nuki_ng] async_setup_entry: {'address': '192.168.86.47', 'hass_url': 'http://192.168.86.40:8123', 'token': 'MY_HIDDEN_BRIDGE_TOKEN', 'web_token': 'MY_HIDDEN_WEB_TOKEN', 'update_seconds': 30, 'name': '', 'use_hashed': True}
2022-08-26 19:26:58.256 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: can bridge = True, can web = True
2022-08-26 19:26:58.905 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 19:26:58.905 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 19:27:07.362 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-26T13:21:15+00:00", "ringactionState": false, "timestamp": "2022-08-26T13:34:13+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -70, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 38, "keypadBatteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "timestamp": "2022-08-26T16:32:58+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -62, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": 1635877406}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 13948, "currentTime": "2022-08-26T17:26:52+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -70, "paired": true}, {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -62, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 19:27:07.363 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 9.106 seconds (success: True)
2022-08-26 19:27:37.003 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: can bridge = True, can web = True
2022-08-26 19:27:37.089 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 19:27:37.089 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 19:27:38.550 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-26T13:21:15+00:00", "ringactionState": false, "timestamp": "2022-08-26T13:34:13+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -67, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 38, "keypadBatteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "timestamp": "2022-08-26T16:32:58+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -62, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": 1635877406}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 13986, "currentTime": "2022-08-26T17:27:30+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -67, "paired": true}, {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -62, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 19:27:38.550 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.547 seconds (success: True)
2022-08-26 19:28:08.000 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: can bridge = True, can web = True
2022-08-26 19:28:08.092 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 19:28:08.092 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 19:28:09.534 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-26T13:21:15+00:00", "ringactionState": false, "timestamp": "2022-08-26T13:34:13+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -71, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 38, "keypadBatteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "timestamp": "2022-08-26T16:32:58+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -62, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": 1635877406}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 14017, "currentTime": "2022-08-26T17:28:01+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -71, "paired": true}, {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -62, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 19:28:09.534 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.534 seconds (success: True)
2022-08-26 19:28:39.000 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: can bridge = True, can web = True
2022-08-26 19:28:39.085 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200'}]}, http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200
2022-08-26 19:28:39.085 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set
2022-08-26 19:28:40.518 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"XXXXXXXXX": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Haust\u00fcr", "firmwareVersion": "1.8.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "ringactionTimestamp": "2022-08-26T13:21:15+00:00", "ringactionState": false, "timestamp": "2022-08-26T13:34:13+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -70, "paired": true}}, "XXXXXXXXX": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Wohnungst\u00fcr ", "firmwareVersion": "3.3.5", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 38, "keypadBatteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "timestamp": "2022-08-26T16:32:58+00:00"}, "web_auth": {}, "last_log": {}, "config": null, "advancedConfig": null, "openerAdvancedConfig": null, "bridge_info": {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -61, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": XXXXXXXXX, "serverId": 1635877406}, "versions": {"firmwareVersion": "2.14.0", "wifiFirmwareVersion": "2.3.0"}, "uptime": 14048, "currentTime": "2022-08-26T17:28:32+00:00", "wlanConnected": true, "serverConnected": true, "scanResults": [{"deviceType": 2, "nukiId": XXXXXXXXX, "name": "Nuki_Opener_XXXXXXXX", "rssi": -70, "paired": true}, {"deviceType": 4, "nukiId": XXXXXXXXX, "name": "Nuki_XXXXXXXX", "rssi": -61, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://192.168.86.40:8123/api/webhook/nuki_ng_bridge_hook_9efd9716119438cd15408086768fa200"}]}}
2022-08-26 19:28:40.518 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 1.518 seconds (success: True)

@kvj
Copy link
Owner

kvj commented Aug 26, 2022

That's interesting. So Web API calls are being made, but the responses from Bridge and Web endpoints do not match.
It looks like only Nuki 3.0 devices are affected, as it works for Nuki 2.0.

Can someone affected do the following command and check that smartlockId values from the Web API call match (or not) with nukiId values from Bridge?

curl -H "Authorization: Bearer: <your Web API token>" "https://api.nuki.io/smartlock"

@sp7dpt
Copy link

sp7dpt commented Aug 26, 2022

smartlockId not match with nukiId

@mluecke09
Copy link
Author

mluecke09 commented Aug 26, 2022

Same here - the id's are totally different. The name of the lock and opener is the only similarity in the web api and bridge call. In my case the special characters are encoded to a unicode escape sequence in the bridge.

Web API: Wohnungstür
Bridge: Wohnungst\u00fcr

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

wtf, nuki? that could explain multiple other bugs reported.

so we need an alternative way to link bridge and web entities together

@sp7dpt
Copy link

sp7dpt commented Aug 27, 2022

By entering only the web api token sensors appear, the problem is hybrid work

@alexdelprete
Copy link
Contributor

wtf, nuki? that could explain multiple other bugs reported.

so we need an alternative way to link bridge and web entities together

From the Web API doc:

image

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

🤦

In my case they just simply match. 687210804 in both bridge and web APIs

@alexdelprete
Copy link
Contributor

🤦

In my case they just simply match. 687210804 in both bridge and web APIs

Also in my case, that's why it looks really strange to me.

Would love to see the real outputs of the curl commands, and if confirmed, I would ask Nuki devs on the official forum before coming up with weird stuff. :)

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

@sp7dpt @mluecke09 could you please give us your values? I think those are safe to share via public channels, they don't expose anything (too) private or exploitable

@alexdelprete
Copy link
Contributor

alexdelprete commented Aug 27, 2022

Confirmed: the only difference between nukiId and smartlockId is the prefix and the hex/dec conversion, like I documented previously. That was the 1.3 doc, here's from 1.4 doc:

image

This is the official statement of Nuki dev about the difference between nukiId and smartlockId:

image

@alexdelprete
Copy link
Contributor

If we could check the output of those commands, we could see if they are HEX values. In my case (Nuki 2) it's a decimal value. Maybe in Nuki 3 they introduced HEX, so conversion is needed...and also the prefix for the opener...

@mluecke09
Copy link
Author

Here are my id's.

Lock 3.0 Pro
smartlockId: 17927266540
nukiId: 747397356

Opener
smartlockId: 9298534866
nukiId: 708600274

@sp7dpt
Copy link

sp7dpt commented Aug 27, 2022

Here are my id's.

Lock 3.0 not Pro
smartlockId: 17988169541
nukiId: 808300357

@alexdelprete
Copy link
Contributor

Lock 3.0 not Pro
smartlockId: 17988169541
nukiId: 808300357

Understood how it's working...(crazy stuff):

17988169541 (dec) = 4302DAF45 (hex)

strip the device type of the SmartLock 3 (it's 4) and you have 302DAF45 (hex)

302DAF45 (hex) = 808300357 (dec)

Opener
smartlockId: 9298534866
nukiId: 708600274

9298534866 (dec) = 22A3C61D2 (hex)

strip the device type of the Opener (it's 2) and you have 2A3C61D2 (hex)

2A3C61D2 (hex) = 708600274 (dec)

Dilemma solved...now it's up to @kvj. :)

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

Yeah, quite controversial design decision.

The fix is kinda ready, could you please test the latest main branch?
Later I can release a new build

@kvj kvj reopened this Aug 27, 2022
@alexdelprete
Copy link
Contributor

Installed main branch. Restarted HA, but I don't see the new entities:

image

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

but I don't see the new entities

Auto lock is there. What else do you expect?

@alexdelprete
Copy link
Contributor

alexdelprete commented Aug 27, 2022

That was there also with previous version, because with Lock 2 we didn't have the bug. I thought there were new entities/sensors (last user, etc.)

@sp7dpt
Copy link

sp7dpt commented Aug 27, 2022

I'm not at the computer at the moment, but it seems to me that if I had only the web api token entered, I had more entities

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

I thought there were new entities/sensors (last user, etc.)

Last user should be also there (diagnostic entities).
I own Nuki 2.0 and everything obviously works, but everything also worked before :)

@alexdelprete
Copy link
Contributor

Last user should be also there (diagnostic entities).

image

@alexdelprete
Copy link
Contributor

alexdelprete commented Aug 27, 2022

I'll remove it and reinstall it...maybe it didn't get the main branch update.

UPDATE: I checked the installed nuki.py file and I can see the new code, so I'm sure it's the main branch, but diagnostics doesn't show anything new. I don't know if that's ok, can you show me your diagnostic section? should I have the last user sensor there?

@kvj
Copy link
Owner

kvj commented Aug 27, 2022

The goal of this thread is to make sure that Web API works for Nuki 3.0 users.

If you think Last user entity is missing but should be there, it's probably a different bug

@alexdelprete
Copy link
Contributor

The goal of this thread is to make sure that Web API works for Nuki 3.0 users.

I have an SL2, so I shouldn't have tested anything. :)

If you think Last user entity is missing but should be there, it's probably a different bug

I don't know where it should be, that's why I asked you, since you said it's working with yours, I asked to see the diagnostics.

Let me know if I have to file a new issue for last user or not.

@sp7dpt
Copy link

sp7dpt commented Aug 27, 2022

Yeah, quite controversial design decision.

The fix is kinda ready, could you please test the latest main branch? Later I can release a new build

I checked your code with my Lock 3.0 and it seems to work now.
lock1
lock2
lock3
lock4

@mluecke09
Copy link
Author

I can also confirm that it‘s working now. Thanks! 👍😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants