make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.16k stars 474 forks source link

Request support for Invisible Bluetooth Smart Lock #2111

Open danieljohngomez opened 1 month ago

danieljohngomez commented 1 month ago

Log Message

2024-07-14 16:03:39.536 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches None with quality of 0%. DPS: {"updated_at": 1720944215.581195, "9": "low", "28": "english", "31": "low", "47": false}
2024-07-14 16:03:39.536 WARNING (MainThread) [custom_components.tuya_local.config_flow] Report this to https://github.com/make-all/tuya-local/issues/

This is using protocol 3.4. Other protocols do not work. Integration shows Sorry, there is no support for this device. after configuring

Information about DPS mappings

Query Things Data Model:

{
  "result": {
    "model": "{\"modelId\":\"000004xfb0\",\"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\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"unlock_method_delete\",\"description\":\"【删除开锁方式】设备在线后,删除开锁方式。支持删除指密卡和人脸。\",\"extensions\":{\"iconName\":\"icon-dp_rabbish\",\"attribute\":\"1888\"},\"name\":\"删除开锁方式\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"unlock_method_modify\",\"description\":\"【修改开锁方式】设备在线后,支持修改开锁方式的名称,以及密码的内容修改。\",\"extensions\":{\"iconName\":\"icon-edit\",\"attribute\":\"1888\"},\"name\":\"修改开门方式\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":9,\"accessMode\":\"ro\",\"code\":\"battery_state\",\"description\":\"【设备状态】用于电量以状态等级显示。范围高中低。(与DP8二选一)\",\"extensions\":{\"iconName\":\"icon-dp_battery\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"电量状态\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"high\",\"medium\",\"low\",\"poweroff\"]}},{\"abilityId\":15,\"accessMode\":\"ro\",\"code\":\"unlock_card\",\"description\":\"【上报开锁记录】用于设备上报门卡开锁的记录。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"门卡开锁\",\"typeSpec\":{\"type\":\"value\",\"max\":999,\"min\":0,\"scale\":0,\"step\":1}},{\"abilityId\":19,\"accessMode\":\"ro\",\"code\":\"unlock_ble\",\"description\":\"【上报开锁记录】用于设备上报手机蓝牙开锁时的记录。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"蓝牙开锁\",\"typeSpec\":{\"type\":\"value\",\"max\":999,\"min\":0,\"scale\":0,\"step\":1}},{\"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\":{\"type\":\"enum\",\"range\":[\"wrong_finger\",\"wrong_password\",\"wrong_card\",\"wrong_face\",\"tongue_bad\",\"too_hot\",\"unclosed_time\",\"tongue_not_out\",\"pry\",\"key_in\",\"low_battery\",\"power_off\",\"shock\",\"defense\",\"wrong_unlock\"]}},{\"abilityId\":28,\"accessMode\":\"rw\",\"code\":\"language\",\"description\":\"【语言】用于设置设备本地导航语音的播放语言。0=简体中文、1=英文、2=日文、3=德文、4=西班牙语、5=拉丁语、6=法语、7=俄语、8=意大利语、9=繁体中文、10=韩语。仅当本智能锁产品,硬件上支持语言切换,且允许用户在app上进行切换操作的情况下,才启用本dp\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1024\",\"trigger\":\"direct\"},\"name\":\"门锁语言\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"chinese_simplified\",\"english\"]}},{\"abilityId\":31,\"accessMode\":\"rw\",\"code\":\"beep_volume\",\"description\":\"【音量】用于设置设备本地导航语音音量大小。\",\"extensions\":{\"iconName\":\"icon-sound\",\"attribute\":\"1280\"},\"name\":\"门锁音量\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"mute\",\"low\",\"normal\",\"high\"]}},{\"abilityId\":47,\"accessMode\":\"ro\",\"code\":\"lock_motor_state\",\"description\":\"【设备状态】用于上报设备离合开关的状态,即锁的开关状态。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"锁开合状态\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":54,\"accessMode\":\"rw\",\"code\":\"synch_method\",\"description\":\"【同步开锁方式】用于手机同步设备本地所有的开锁方式。强烈建议启用本功能\",\"extensions\":{\"iconName\":\"icon-dp_upload\",\"attribute\":\"1888\"},\"name\":\"同步开门方式(全量同步)\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":70,\"accessMode\":\"rw\",\"code\":\"check_code_set\",\"description\":\"【蓝牙开锁】用于配置设备执行蓝牙解锁时需要的校验信息。\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1280\"},\"name\":\"配置蓝牙开锁校验码\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":71,\"accessMode\":\"rw\",\"code\":\"ble_unlock_check\",\"description\":\"【蓝牙开锁】用于触发设备执行蓝牙解锁。触发源可以是手机、配件或靠近解锁。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\"},\"name\":\"蓝牙开锁(带校验码)\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}}]}]}"
  },
  "success": true,
  "t": 1720946618907,
  "tid": "2a7426c941bd11ef840d66df69ab0bc3"
}

Using https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html:

{"1":"Add Unlock Method","2":"Delete Unlock Method","3":"Modify Unlock Method","9":"Battery Level","15":"Card","19":"Bluetooth Unlock","21":"Lock Alerts","28":"Lock Language","31":"Lock Volume","47":"Lock Status","54":"Sync Access Method","70":"Configure Verification Code","71":"Bluetooth Unlock (with Verification Codes)"}

No access to Query

Product ID

kpn4zaf7

Information about how the device functions

danieljohngomez commented 1 month ago

I tried adding a yaml config similar to https://github.com/make-all/tuya-local/pull/1830/files but did not work:

name: Indoor Invisible Lock
products:
  - id: kpn4zaf7
    name: Indoor Invisible Lock
primary_entity:
  entity: lock
  dps:
    - id: 1
      type: string
      name: create_unlock_method
      optional: true
    - id: 2
      type: string
      name: delete_unlock_method
      optional: true
    - id: 3
      type: string
      name: modify_unlock_method
      optional: true
    - id: 6
      type: string
      name: bluetooth_unlock
      optional: true
    - id: 19
      type: integer
      name: unlock_ble
      optional: true
      persist: false
    - id: 47
      type: boolean
      name: lock
      optional: true
      readonly: true
secondary_entities:
  - entity: sensor
    class: battery
    category: diagnostic
    dps:
      - id: 9
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    name: Alert
    class: enum
    category: diagnostic
    dps:
      - id: 21
        type: string
        name: sensor
        optional: true
        persist: false
        mapping:
          - dps_val: null
            value: ok
          - dps_val: wrong_finger
            value: wrong_finger
          - dps_val: wrong_password
            value: wrong_password
          - dps_val: low_battery
            value: low_battery
  - entity: binary_sensor
    class: battery
    category: diagnostic
    dps:
      - id: 21
        type: string
        name: sensor
        mapping:
          - dps_val: low_battery
            value: true
          - value: false
  - entity: select
    name: Language
    icon: "mdi:translate"
    category: config
    dps:
      - id: 28
        type: string
        name: option
        mapping:
          - dps_val: chinese_simplified
            value: 中文
          - dps_val: english
            value: English
  - entity: number
    name: Beep volume
    category: config
    icon: "mdi:volume-high"
    dps:
      - id: 31
        type: string
        name: value
        unit: "%"
        range:
          min: 0
          max: 100
        mapping:
          - dps_val: mute
            step: 33
            value: 0
          - dps_val: low
            step: 33
            value: 33
          - dps_val: normal
            step: 33
            value: 66
          - dps_val: high
            step: 33
            value: 100