Closed inode- closed 2 months ago
I'm trying to use lock/unlock from within home assistant and getting the following error:
`Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:245 integration: Home Assistant WebSocket API (documentation, issues) First occurred: 20:57:17 (19 occurrences) Last logged: 22:47:24
[546322394720] Unexpected exception [546462553792] Unexpected exception [546305003088] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/lock/init.py", line 226, in async_handle_lock_service await self.async_lock(**self.add_default_code(kwargs)) File "/config/custom_components/tuya_local/lock.py", line 136, in async_lock raise NotImplementedError() NotImplementedError`
It is expected. The lock does not provide a simple lock/unlock service locally.
It is expected. The lock does not provide a simple lock/unlock service locally.
Is there any way to get it implemented? I can see the following sequence in tuya device debugging, when I unlock it using the tuya app:
I tried to rename "Code-free Remote Unlock" DP to 'name: lock' in _devices/otu_r1o1lock.yaml, but it doesn't unlock. Tuya log for this case look like this:
Log message
Device matches None with quality of 0%. DPS: {"updated_at": 1723186902.2375538, "9": "high", "12": 157, "21": "wrong_finger"}
```text 2024-08-09 09:01:26.936 DEBUG (SyncWorker_20) [custom_components.tuya_local.config_flow] update_token 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'wg2', 'id': 'bff8d4e57a8d5e44d5rs55', 'ip': 'x.y.x.z', 'local_key': "XXXXXXXXXXX", 'name': 'GW002', 'node_id': '', 'online': True, 'product_id': 'harherwxralgjabo', 'product_name': 'GW002', 'uid': 'eu170566063406946yTb', 'uuid': 'c50fd166f6f5ed44', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Adding device: bff8d4e57a8d5e44d5rs55 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'dj', 'id': 'bf280b87ee6ad5ac845pfl', 'ip': '', 'local_key': "XXXXXXXXXXX", 'name': 'Luce_lore', 'node_id': 'a4c1384c4dc90a01', 'online': True, 'product_id': 'uos3hl9x', 'product_name': 'ZS-TY-CXD', 'uid': 'eu170566063406946yTb', 'uuid': 'a4c1384c4dc90a01', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Adding device: bf280b87ee6ad5ac845pfl 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'dj', 'id': 'bf27d0fa60c90863e6jaab', 'ip': '', 'local_key': "XXXXXXXXXXX", 'name': 'Luce_ingresso', 'node_id': 'a4c13826338c1ebe', 'online': True, 'product_id': 'uos3hl9x', 'product_name': 'ZS-TY-CXD', 'uid': 'eu170566063406946yTb', 'uuid': 'a4c13826338c1ebe', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Adding device: bf27d0fa60c90863e6jaab 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'dj', 'id': 'bfed75f8e14db47b43nukk', 'ip': '', 'local_key': "XXXXXXXXXXX", 'name': 'Luce_assicuratore', 'node_id': 'a4c1388f07d89888', 'online': True, 'product_id': 'uos3hl9x', 'product_name': 'ZS-TY-CXD', 'uid': 'eu170566063406946yTb', 'uuid': 'a4c1388f07d89888', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Adding device: bfed75f8e14db47b43nukk 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'dj', 'id': 'bf2174ba1ed5b82f305ooh', 'ip': '', 'local_key': "XXXXXXXXXXX", 'name': 'Luce_stampante', 'node_id': 'a4c13865f47be9e9', 'online': True, 'product_id': 'uos3hl9x', 'product_name': 'ZS-TY-CXD', 'uid': 'eu170566063406946yTb', 'uuid': 'a4c13865f47be9e9', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Device is already registered. 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'wg2', 'id': 'bf637f424161541bd3xzix', 'ip': '79.24.212.21', 'local_key': '', 'name': 'Wireless Bluetooth gateway', 'node_id': '0010', 'online': True, 'product_id': 'mzxmuvrg', 'product_name': 'Wireless Bluetooth gateway', 'uid': 'eu170566063406946yTb', 'uuid': '18c8683e82c635bd', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Adding device: bf637f424161541bd3xzix 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found device: {'category': 'ms', 'id': 'bfcb605b1868a8cb16amgr', 'ip': '', 'local_key': 'XXXXXXXXXXX', 'name': "O'TU R1O1", 'node_id': 'e27c8029e81880a8', 'online': True, 'product_id': 'jqpmkfj7', 'product_name': "O'TU R1O1", 'uid': 'eu170566063406946yTb', 'uuid': 'e27c8029e81880a8', 'support_local': True, 'device_cid': None, 'version': None} 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Adding device: bfcb605b1868a8cb16amgr 2024-08-09 09:01:28.327 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Device count: 5 2024-08-09 09:01:28.328 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Hub count: 2 2024-08-09 09:01:33.974 DEBUG (MainThread) [custom_components.tuya_local.device] Desk Lamp received {"1": false, "2": "white", "3": 200, "4": 500, "full_poll": true} 2024-08-09 09:01:35.068 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Scanning network to get IP address for bf637f424161541bd3xzix. 2024-08-09 09:01:38.279 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found: {'ip': '192.168.1.200', 'version': '3.4', 'id': 'bf637f424161541bd3xzix', 'product_id': 'key7mn9kc48xep73', 'data': {'ip': '192.168.1.200', 'gwId': 'bf637f424161541bd3xzix', 'active': 2, 'encrypt': True, 'productKey': 'key7mn9kc48xep73', 'version': '3.4', 'lan_cap': 500, 'lan_seq': 0, 'lan_ablilty': 1, 'token': True, 'wf_cfg': True, 'clientLink': 3, 'name': '', 'key': '', 'mac': '', 'id': 'bf637f424161541bd3xzix', 'ability': 0, 'dev_type': 'default', 'origin': 'broadcast'}} 2024-08-09 09:01:42.169 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Test 2024-08-09 09:01:42.169 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.4 2024-08-09 09:01:42.237 DEBUG (SyncWorker_32) [custom_components.tuya_local.device] Test refreshed device state: {"dps": {"9": "high", "12": 157, "21": "wrong_finger"}, "cid": "e27c8029e81880a8", "device": "Non-JSON: (Device( 'bf637f424161541bd3xzix', address=None, local_key='', dev_type='default', connection_timeout=5, version=3.4, persist=False, cid='e27c8029e81880a8', parent='bf637f424161541bd3xzix', children={} ))"} 2024-08-09 09:01:42.237 DEBUG (SyncWorker_32) [custom_components.tuya_local.device] new state (incl pending): {"updated_at": 1723186902.2375538, "9": "high", "12": 157, "21": "wrong_finger"} 2024-08-09 09:01:42.261 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config 9in1_airquality_monitor.yaml 2024-08-09 09:01:42.261 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for Air Quality, missing required DPs: [{'1': 'str'}, {'2': 'int'}, {'3': 'int'}, {'4': 'int'}, {'102': 'int'}, {'5': 'int'}, {'6': 'int'}, {'7': 'int'}, {'22': 'int'}, {'23': 'bool'}, {'28': 'str'}] 2024-08-09 09:01:42.261 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for Air Quality, DPs have incorrect type: [{'9': 'int'}] 2024-08-09 09:01:42.269 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config AlecoAir_D25_Traditio.yaml 2024-08-09 09:01:42.269 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for Dehumidifier, missing required DPs: [{'1': 'bool'}, {'2': 'int'}, {'5': 'str'}, {'6': 'int'}, {'19': 'int'}, {'1': 'bool'}, {'4': 'str'}, {'8': 'bool'}, {'10': 'bool'}, {'13': 'bool'}, {'19': 'int'}, {'16': 'bool'}, {'17': 'str'}] [...] 2024-08-09 09:01:47.797 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config zx_gs21_gasmonitor.yaml 2024-08-09 09:01:47.798 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for Gas leak detector, missing required DPs: [{'2': 'int'}, {'1': 'str'}, {'7': 'int'}, {'8': 'bool'}, {'10': 'bool'}, {'16': 'bool'}, {'18': 'str'}, {'19': 'int'}, {'18': 'str'}] 2024-08-09 09:01:47.798 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for Gas leak detector, DPs have incorrect type: [{'12': 'bool'}] 2024-08-09 09:01:47.805 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config zym100_presence_sensor.yaml 2024-08-09 09:01:47.805 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, missing required DPs: [{'1': 'str'}, {'2': 'int'}, {'3': 'int'}, {'4': 'int'}, {'101': 'int'}, {'102': 'int'}, {'104': 'int'}] 2024-08-09 09:01:47.805 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, DPs have incorrect type: [{'9': 'int'}] 2024-08-09 09:01:47.812 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config zym100w_presence_sensor.yaml 2024-08-09 09:01:47.812 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, missing required DPs: [{'1': 'str'}, {'1': 'str'}, {'3': 'int'}, {'4': 'int'}, {'103': 'int'}, {'104': 'str'}, {'105': 'int'}] 2024-08-09 09:01:47.812 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, DPs have incorrect type: [{'9': 'int'}] 2024-08-09 09:01:47.819 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config zym201_presence_sensor.yaml 2024-08-09 09:01:47.819 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, missing required DPs: [{'101': 'str'}, {'1': 'str'}, {'4': 'int'}, {'102': 'int'}, {'104': 'int'}] 2024-08-09 09:01:47.819 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, DPs have incorrect type: [{'9': 'int'}] 2024-08-09 09:01:47.825 WARNING (MainThread) [custom_components.tuya_local.config_flow] Include the previous log message with any new device request to https://github.com/make-all/tuya-local/issues/ ```DPS information
Product ID
jqpmkfj7
Product Name
O'TU R1O1
Information about how the device functions
Tuya APP Fingerprint WIFI RFID Card Bluetooth Euro Cylinder Lock Biometric Electronic Smart Door Lock Keyless Entry for Home
ex. https://www.aliexpress.com/item/1005006594161176.html?src=google