make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.07k stars 432 forks source link

Request support for NICE DIGI Smart Lock #1714

Closed dieu closed 1 month ago

dieu commented 4 months ago

Log Message

{"8": 100, "32": false, "33": false, "68": "function2", "78": false} ``` 2024-03-05 23:59:57.779 WARNING (MainThread) [homeassistant.util.async_] Detected blocking call to sleep inside the event loop by custom integration 'tuya_local' at custom_components/tuya_local/device.py, line 74: parent=tinytuya.Device(dev_id, address, local_key),, please create a bug report at https://github.com/make-all/tuya-local/issues 2024-03-05 23:59:57.880 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-05 23:59:58.269 WARNING (SyncWorker_0) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:00:10.610 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:00:10.992 WARNING (SyncWorker_20) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:00:13.963 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:00:14.271 WARNING (SyncWorker_21) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:00:17.708 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:00:18.135 WARNING (SyncWorker_19) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:00:19.354 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:00:19.622 WARNING (SyncWorker_18) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:01:23.940 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:01:24.210 WARNING (SyncWorker_23) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:01:27.383 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.5 2024-03-06 00:01:37.401 WARNING (SyncWorker_16) [custom_components.tuya_local.device] Test protocol error 914: Check device key or version 2024-03-06 00:02:38.202 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.4 2024-03-06 00:02:43.355 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.4 2024-03-06 00:02:48.579 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.4 2024-03-06 00:02:53.794 ERROR (MainThread) [custom_components.tuya_local.device] Failed to refresh device state for Test. 2024-03-06 00:02:53.794 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.4 2024-03-06 00:03:10.402 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.2 2024-03-06 00:03:12.730 WARNING (SyncWorker_2) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:03:16.228 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.1 2024-03-06 00:03:16.523 WARNING (SyncWorker_24) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:03:19.314 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:03:19.608 WARNING (SyncWorker_4) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect 2024-03-06 00:03:21.977 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-03-06 00:03:22.202 WARNING (SyncWorker_6) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect ```

Information about DPS mappings

{
  "result": {
    "model": "{\"modelId\":\"e0vfo8\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[
{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"unlock_method_create\",\"description\":\"【添加开锁方式】设备在线后,添加开锁方式。支持添加指纹】、密码、卡片和人脸的解锁方式;支持管理员标记。\",\"extensions\":{\"iconName\":\"icon-a_up\",\"attribute\":\"1888\"},\"name\":\"添加开门方式\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"unlock_method_delete\",\"description\":\"【删除开锁方式】设备在线后,删除开锁方式。支持删除指纹、密码、卡片和人脸的解锁方式。该dp与添加dp成对出现\",\"extensions\":{\"iconName\":\"icon-dp_rabbish\",\"attribute\":\"1888\"},\"name\":\"删除开门方式\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"unlock_method_modify\",\"description\":\"【修改开锁方式】设备在线后,支持修改开锁方式的名称,以及密码的内容修改。\",\"extensions\":{\"iconName\":\"icon-edit\",\"attribute\":\"1888\"},\"name\":\"修改开锁方式\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":8,\"accessMode\":\"ro\",\"code\":\"residual_electricity\",\"description\":\"【设备状态】用于电量以百分比显示。范围-1~100,当设备上报数值-1时,不显示电量。(与DP9二选一)\",\"extensions\":{\"iconName\":\"icon-dp_battery\",\"attribute\":\"1280\"},\"name\":\"剩余电量\",\"typeSpec\":{\"max\":100,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":12,\"accessMode\":\"ro\",\"code\":\"unlock_fingerprint\",\"description\":\"【上报开锁记录】用于设备上报指纹开锁的记录。仅当本智能锁产品,硬件上带指纹识别功能时启用本dp\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"指纹解锁\",\"typeSpec\":{\"max\":999,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":19,\"accessMode\":\"ro\",\"code\":\"unlock_ble\",\"description\":\"【上报开锁记录】用于设备上报手机app蓝牙开锁产生的开门记录,一般情况下所有蓝牙锁都支持该功能\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"蓝牙开锁\",\"typeSpec\":{\"max\":999,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":20,\"accessMode\":\"rw\",\"code\":\"lock_record\",\"description\":\"【上报关锁记录】用于设备上报门锁关锁的记录。如通过手机app控制关锁,或本地手动关锁都可以使用本dp进行上报\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"320\"},\"name\":\"关锁记录\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":21,\"accessMode\":\"ro\",\"code\":\"alarm_lock\",\"description\":\"【告警记录】本地发生告警时,用于上报设备的告警记录。对应值说明:0=指纹试错报警、1=密码试错报警、2=卡试错报警、3=人脸试错报警、4=假锁(锁舌卡住)、5=高温报警、6=超时未关门、7=电子锁舌未弹出、8=防撬报警 、9=钥匙插入、10=低电报警、11=电量耗尽报警、12=震动报警、13=布防报警,如设备只用到告警dp中的几项,多余的内容也不需要删除。如删除则mcu在上报时的序号需要调整。建议开发者不要改动告警中的枚举值。如遇特殊情况,请在pm的指导下,进行增、删,以及配置多语言等操作\",\"extensions\":{\"iconName\":\"icon-dp_warming\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"门锁告警\",\"typeSpec\":{\"range\":[\"wrong_finger\",\"wrong_password\",\"wrong_card\",\"low_battery\",\"power_off\",\"tongue_bad\",\"unclosed_time\"],\"type\":\"enum\",\"typeDefaultValue\":\"wrong_finger\"}},
{\"abilityId\":32,\"accessMode\":\"rw\",\"code\":\"reverse_lock\",\"description\":\"【设备状态】若设备具有室内反锁检测时,用于上报室内反锁的开关状态。仅当本智能锁产品,硬件上功能检测反锁状态并能将数据上报的情况下选择本dp。本dp仅用于在门锁主页界面对反锁状态的显示,不能进行反锁设置操作\",\"extensions\":{\"iconName\":\"icon-zhuangtai\",\"attribute\":\"1344\",\"trigger\":\"direct\"},\"name\":\"室内反锁\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":33,\"accessMode\":\"rw\",\"code\":\"automatic_lock\",\"description\":\"【自动落锁】用于设置自动落锁功能的开关。通过本dp可以设置“启用自动落锁”与“不自动落锁”即设备不会自动落锁,此时也可作为常开模式。仅在门锁硬件支持该设置时,启用本dp\\n\\n与dp36,“自动落锁延时”搭配使用,可以实现“解锁xx秒后自动落锁”对解锁后自动落锁的等待时长进行设置\",\"extensions\":{\"iconName\":\"icon-power\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"自动关锁\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":36,\"accessMode\":\"rw\",\"code\":\"auto_lock_time\",\"description\":\"【自动落锁】用于设置设备解锁后到执行自动落锁的延迟时间。设置范围1s~30min。\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"自动关锁延迟\",\"typeSpec\":{\"max\":60,\"min\":5,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":5,\"unit\":\"\"}},
{\"abilityId\":46,\"accessMode\":\"rw\",\"code\":\"manual_lock\",\"description\":\"【落锁操作】用于触发设备执行落锁操作,可用于自动落锁和手动落锁的操作。\\n上报落锁(关锁)记录需使用dp=20 关锁记录。需要2个dp组合使用,完整实现关锁操作和关锁记录上报。在这两个dp之外,还需要使用dp47=落锁状态,进行落锁状态的上报,使得app上显示的锁的解锁/落锁状态与硬件本地保持一致\\t\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"手动关锁\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":47,\"accessMode\":\"ro\",\"code\":\"lock_motor_state\",\"description\":\"【设备状态】用于上报设备离合开关的状态,即锁的开关状态。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"锁开合状态\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":54,\"accessMode\":\"rw\",\"code\":\"synch_method\",\"description\":\"【同步开锁方式】用于手机同步设备本地所有的开锁方式。\",\"extensions\":{\"iconName\":\"icon-dp_upload\",\"attribute\":\"1888\"},\"name\":\"同步开锁方式\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":61,\"accessMode\":\"rw\",\"code\":\"remote_no_dp_key\",\"description\":\"【远程开锁】用于触发设备远程开锁操作。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1312\"},\"name\":\"免密远程开锁(带密钥)\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":62,\"accessMode\":\"ro\",\"code\":\"unlock_phone_remote\",\"description\":\"【上报开锁记录】用于设备上报手机远程开锁的记录。\",\"extensions\":{\"iconName\":\"icon-shouji\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"远程手机开锁\",\"typeSpec\":{\"max\":999,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":68,\"accessMode\":\"rw\",\"code\":\"special_function\",\"description\":\"【特殊功能】可根据自身需求用于设置其他特殊功能的开关。对应文案可在IoT平台进行修改。\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"马达方向\",\"typeSpec\":{\"range\":[\"function1\",\"function2\"],\"type\":\"enum\",\"typeDefaultValue\":\"function1\"}},
{\"abilityId\":70,\"accessMode\":\"rw\",\"code\":\"check_code_set\",\"description\":\"【蓝牙开锁】用于配置设备执行蓝牙解锁时需要的校验信息。\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1280\"},\"name\":\"配置蓝牙开锁校验码\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":71,\"accessMode\":\"rw\",\"code\":\"ble_unlock_check\",\"description\":\"【蓝牙开锁】用于触发设备执行蓝牙解锁。触发源可以是手机、配件或靠近解锁。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\"},\"name\":\"蓝牙开锁(带校验码)\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":73,\"accessMode\":\"rw\",\"code\":\"remote_pd_setkey_check\",\"description\":\"【远程开锁】用于配置远程开锁时需要的密钥。若设备需要进行远程开锁,该DP必选。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1792\"},\"name\":\"设置远程开锁(带校验码)\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},
{\"abilityId\":78,\"accessMode\":\"rw\",\"code\":\"special_control\",\"description\":\"【特殊控制】可根据自身需求用于触发其他特殊控制能力。对应文案可在IoT平台进行修改。\",\"extensions\":{\"iconName\":\"icon-dp_power2\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"常开模式\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}}]}]}"
  },
  "success": true,
  "t": 1709712796536,
  "tid": "626c268edb9111eeaf18ce1e08994cdc"
}

Product ID

[
    {
        "name": "Smart Lock",
        "id": "ebdeeeq85f1m7c1c",
        "key": "_~h_`1POa>88t$V<",
        "mac": "DC:23:4F:C9:EA:7E",
        "uuid": "ecb1b7cddb3ae6e0",
        "category": "jtmspro",
        "product_name": "Smart Lock",
        "product_id": "ofwvna43",
        "biz_type": 0,
        "model": "\u6613\u601d\u7ef4T2",
        "sub": true,
        "icon": "https://images.tuyaus.com/smart/icon/ay15724370520156puq6/a3d6a04d38237ddf13208a11feb2efbc.png",
        "node_id": "ecb1b7cddb3ae6e0",
        "mapping": {
            "1": {
                "code": "unlock_method_create",
                "type": "Raw",
                "values": {}
            },
            "2": {
                "code": "unlock_method_delete",
                "type": "Raw",
                "values": {}
            },
            "3": {
                "code": "unlock_method_modify",
                "type": "Raw",
                "values": {}
            },
            "8": {
                "code": "residual_electricity",
                "type": "Integer",
                "values": {
                    "min": 0,
                    "max": 100,
                    "scale": 0,
                    "step": 1
                }
            },
            "12": {
                "code": "unlock_fingerprint",
                "type": "Integer",
                "values": {
                    "min": 0,
                    "max": 999,
                    "scale": 0,
                    "step": 1
                }
            },
            "19": {
                "code": "unlock_ble",
                "type": "Integer",
                "values": {
                    "min": 0,
                    "max": 999,
                    "scale": 0,
                    "step": 1
                }
            },
            "20": {
                "code": "lock_record",
                "type": "Raw",
                "values": {}
            },
            "21": {
                "code": "alarm_lock",
                "type": "Enum",
                "values": {
                    "range": [
                        "wrong_finger",
                        "wrong_password",
                        "wrong_card",
                        "low_battery",
                        "power_off",
                        "tongue_bad",
                        "unclosed_time"
                    ]
                }
            },
            "32": {
                "code": "reverse_lock",
                "type": "Boolean",
                "values": {}
            },
            "33": {
                "code": "automatic_lock",
                "type": "Boolean",
                "values": {}
            },
            "36": {
                "code": "auto_lock_time",
                "type": "Integer",
                "values": {
                    "unit": "",
                    "min": 5,
                    "max": 60,
                    "scale": 0,
                    "step": 1
                }
            },
            "46": {
                "code": "manual_lock",
                "type": "Boolean",
                "values": {}
            },
            "47": {
                "code": "lock_motor_state",
                "type": "Boolean",
                "values": {}
            },
            "54": {
                "code": "synch_method",
                "type": "Raw",
                "values": {}
            },
            "61": {
                "code": "remote_no_dp_key",
                "type": "Raw",
                "values": {}
            },
            "62": {
                "code": "unlock_phone_remote",
                "type": "Integer",
                "values": {
                    "min": 0,
                    "max": 999,
                    "scale": 0,
                    "step": 1
                }
            },
            "68": {
                "code": "special_function",
                "type": "Enum",
                "values": {
                    "range": [
                        "function1",
                        "function2"
                    ]
                }
            },
            "70": {
                "code": "check_code_set",
                "type": "Raw",
                "values": {}
            },
            "71": {
                "code": "ble_unlock_check",
                "type": "Raw",
                "values": {}
            },
            "73": {
                "code": "remote_pd_setkey_check",
                "type": "Raw",
                "values": {}
            },
            "78": {
                "code": "special_control",
                "type": "Boolean",
                "values": {}
            }
        },
        "parent": "",
        "ip": "",
        "version": ""
    },
    {
        "name": "Gateway",
        "id": "eb1b33322dedac9cedszwk",
        "key": "_~h_`1POa>88t$V<",
        "mac": "fc:67:1f:2c:93:f0",
        "uuid": "a94fc55d27ac339e",
        "sn": "10008469800628",
        "category": "wg2",
        "product_name": "Gateway",
        "product_id": "vv5weaudutzsqvai",
        "biz_type": 0,
        "model": "G08Pro(Zigbee+Bluetooth\u7f51\u5173)",
        "sub": true,
        "icon": "https://images.tuyaus.com/smart/icon/ay1525749833414yotNt/26ede3412687c225b9ca020f3340482f.png",
        "mapping": {
            "4": {
                "code": "switch_alarm_sound",
                "type": "Boolean",
                "values": {}
            },
            "32": {
                "code": "master_state",
                "type": "Enum",
                "values": {
                    "range": [
                        "normal",
                        "alarm"
                    ]
                }
            },
            "34": {
                "code": "factory_reset",
                "type": "Boolean",
                "values": {}
            },
            "45": {
                "code": "alarm_active",
                "type": "String",
                "values": "{\"maxlen\":255}"
            }
        },
        "parent": "",
        "ip": "10.0.0.167",
        "version": "3.4"
    }
]

Information about how the device functions

Smart Lock BTE + Getway BTE+ZBE

make-all commented 4 months ago

901: Network Error: Unable to Connect

If you cannot solve the fundamental connection problem with your device, there is no point to make a config for it. If it is a battery powered WiFi device, then this is unlikely to be supportable locally, as battery powered devices spend most of their time asleep to save power, and are only available on WiFi during the short periods that they wake to check-in with the cloud.

dieu commented 4 months ago

@make-all Jason thanks for the help; I was able to connect, and it matched to the BLE Orion Lock but it doesn't work well. The device is a BLE Smart Lock connected to BLE/ZBE/Wifi Getaway.

2024-03-06 00:23:55.610 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches ble_orion_lock with quality of 40%. DPS: {"updated_at": 1709713427.7262652, "8": 100, "32": false, "33": false, "68": "function2", "78": false}
2024-03-06 00:23:55.611 WARNING (MainThread) [custom_components.tuya_local.config_flow] Report this to https://github.com/make-all/tuya-local/issues/
2024-03-06 00:24:06.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config ble_orion_lock.yaml
2024-03-06 00:24:08.576 INFO (MainThread) [homeassistant.setup] Setting up tuya_local
2024-03-06 00:24:08.576 INFO (MainThread) [homeassistant.setup] Setup of domain tuya_local took 0.0 seconds
2024-03-06 00:24:08.578 DEBUG (MainThread) [custom_components.tuya_local] Setting up entry for device: ecb1b7cddb3ae6e0
2024-03-06 00:24:08.579 INFO (MainThread) [custom_components.tuya_local.device] Creating device: ecb1b7cddb3ae6e0
2024-03-06 00:24:08.585 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config ble_orion_lock.yaml
2024-03-06 00:24:08.602 INFO (MainThread) [homeassistant.components.lock] Setting up tuya_local.lock
2024-03-06 00:24:08.608 INFO (MainThread) [homeassistant.components.sensor] Setting up tuya_local.sensor
2024-03-06 00:24:08.615 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config ble_orion_lock.yaml
2024-03-06 00:24:08.616 DEBUG (MainThread) [custom_components.tuya_local.helpers.config] Adding lock for lock
2024-03-06 00:24:08.622 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config ble_orion_lock.yaml
2024-03-06 00:24:08.622 DEBUG (MainThread) [custom_components.tuya_local.helpers.config] Adding sensor for sensor_battery
2024-03-06 00:24:08.624 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new lock.tuya_local entity: lock.orion_ble_lock
2024-03-06 00:24:08.625 DEBUG (MainThread) [custom_components.tuya_local.device] Starting monitor loop for Orion BLE lock
2024-03-06 00:24:08.627 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:08.627 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tuya_local entity: sensor.orion_ble_lock_battery
2024-03-06 00:24:08.630 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:08.645 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Orion BLE lock to 3.4
2024-03-06 00:24:08.662 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:08.740 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"8": 100, "32": false, "33": false, "68": "function2", "78": false, "full_poll": true}
2024-03-06 00:24:08.742 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:08.743 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:08.845 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock persistant connection set to True
2024-03-06 00:24:24.836 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock new pending updates: {"33": {"value": true, "updated_at": 1709713464.8356936, "sent": false}}
2024-03-06 00:24:24.843 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock sending dps update: {"33": true}
2024-03-06 00:24:25.802 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"8": 100, "32": false, "33": false, "68": "function2", "78": false, "full_poll": true}
2024-03-06 00:24:25.805 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:25.805 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:26.213 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"33": true, "full_poll": false}
2024-03-06 00:24:26.214 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:26.215 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:27.596 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock new pending updates: {"33": {"value": false, "updated_at": 1709713467.5963268, "sent": false}}
2024-03-06 00:24:27.600 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock sending dps update: {"33": false}
2024-03-06 00:24:27.769 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"8": 100, "32": false, "33": true, "68": "function2", "78": false, "full_poll": true}
2024-03-06 00:24:27.771 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:27.772 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:27.968 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"33": false, "full_poll": false}
2024-03-06 00:24:27.969 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:27.970 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:29.528 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"33": false, "full_poll": false}
2024-03-06 00:24:29.529 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:29.530 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:30.112 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"68": "function2", "full_poll": false}
2024-03-06 00:24:30.114 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:30.114 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:30.316 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"78": false, "full_poll": false}
2024-03-06 00:24:30.317 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:30.317 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:30.433 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"32": false, "full_poll": false}
2024-03-06 00:24:30.435 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:30.435 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:49.662 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock new pending updates: {"33": {"value": true, "updated_at": 1709713489.6625464, "sent": false}}
2024-03-06 00:24:49.664 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock sending dps update: {"33": true}
2024-03-06 00:24:49.875 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"8": 100, "32": false, "33": false, "68": "function2", "78": false, "full_poll": true}
2024-03-06 00:24:49.876 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:49.876 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:50.069 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock received {"33": true, "full_poll": false}
2024-03-06 00:24:50.071 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:50.071 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 8 (sensor), unable to determine valid values
2024-03-06 00:24:52.156 DEBUG (MainThread) [custom_components.tuya_local.device] Orion BLE lock new pending updates: {"33": {"value": false, "updated_at": 1709713492.1562045, "sent": false}}
dieu commented 3 months ago

Hello @make-all, can I do anything to help support the lock?

dieu commented 2 months ago

@make-all, thanks a lot for your work, testing it now and got an error:

2024-04-27 18:41:58.287 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches nice_digi_lock with quality of 100%. DPS: {"updated_at": 1714268511.6983633, "8": 70, "12": 52, "21": "wrong_finger", "32": false, "33": true, "47": true, "68": "function2", "78": false}
2024-04-27 18:41:58.288 WARNING (MainThread) [custom_components.tuya_local.config_flow] Report this to https://github.com/make-all/tuya-local/issues/
2024-04-27 18:42:04.068 INFO (MainThread) [custom_components.tuya_local.device] Creating device: ecb1b7cddb3ae6e0
2024-04-27 18:42:04.112 INFO (MainThread) [homeassistant.components.sensor] Setting up tuya_local.sensor
2024-04-27 18:42:04.126 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tuya_local entity: sensor.door_lock_battery
2024-04-27 18:42:04.131 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up tuya_local.binary_sensor
2024-04-27 18:42:04.150 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.tuya_local entity: binary_sensor.door_lock_snib
2024-04-27 18:42:04.152 INFO (MainThread) [homeassistant.components.event] Setting up tuya_local.event
2024-04-27 18:42:04.172 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new event.tuya_local entity: event.door_lock_alert
2024-04-27 18:42:04.174 INFO (MainThread) [homeassistant.components.switch] Setting up tuya_local.switch
2024-04-27 18:42:04.190 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.tuya_local entity: switch.door_lock_auto_lock
2024-04-27 18:42:04.192 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.tuya_local entity: switch.door_lock_special_control
2024-04-27 18:42:04.193 INFO (MainThread) [homeassistant.components.number] Setting up tuya_local.number
2024-04-27 18:42:04.217 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new number.tuya_local entity: number.door_lock_auto_lock_delay
2024-04-27 18:42:04.219 INFO (MainThread) [homeassistant.components.lock] Setting up tuya_local.lock
2024-04-27 18:42:04.235 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new lock.tuya_local entity: lock.door_lock
2024-04-27 18:42:04.237 INFO (MainThread) [homeassistant.components.select] Setting up tuya_local.select
2024-04-27 18:42:04.254 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new select.tuya_local entity: select.door_lock_special_function
2024-04-27 18:42:04.259 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Door lock to 3.4
2024-04-27 18:42:04.523 ERROR (MainThread) [custom_components.tuya_local.device] Door lock receive loop terminated by exception Invalid event type wrong_finger for event.door_lock_alert
Traceback (most recent call last):
File "/config/custom_components/tuya_local/device.py", line 212, in receive_loop
entity.on_receive(poll, full_poll)
File "/config/custom_components/tuya_local/event.py", line 80, in on_receive
self._trigger_event(
File "/usr/src/homeassistant/homeassistant/components/event/__init__.py", line 158, in _trigger_event
raise ValueError(f"Invalid event type {event_type} for {self.entity_id}")
ValueError: Invalid event type wrong_finger for event.door_lock_alert