make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.42k stars 544 forks source link

Request support for A1 PRO MAX #2439

Closed ChrisDes closed 3 weeks ago

ChrisDes commented 1 month ago

Log message

2024-10-24 21:23:05.224 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches otu_r1o1_lock with quality of 33%. DPS: {"updated_at": 1729797769.2820706, "9": "high", "16": 0, "19": 1, "33": false, "36": 1, "46": true, "47": true, "62": 1, "78": true}
2024-10-24 21:23:05.224 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

{
  "result": {
    "model": "{\"modelId\":\"000003hp6s\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[
{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"unlock_method_create\",\"description\":\"【添加开锁方式】设备在线后,添加开锁方式。支持添加指密卡和人脸,以及支持管理员标记。\",\"extensions\":{\"iconName\":\"icon-a_up\",\"attribute\":\"1792\"},\"name\":\"添加开门方式\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"unlock_method_delete\",\"description\":\"【删除开锁方式】设备在线后,删除开锁方式。支持删除指密卡和人脸。\",\"extensions\":{\"iconName\":\"icon-dp_rabbish\",\"attribute\":\"1792\"},\"name\":\"删除开门方式\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"unlock_method_modify\",\"description\":\"【修改开锁方式】设备在线后,支持修改开锁方式的名称,以及密码的内容修改。\",\"extensions\":{\"iconName\":\"icon-edit\",\"attribute\":\"1792\"},\"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\":16,\"accessMode\":\"ro\",\"code\":\"unlock_key\",\"description\":\"【上报开锁记录】若设备本地支持钥匙开锁检测,则用于设备上报机械钥匙开锁的记录。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"本地手动 开锁\",\"typeSpec\":{\"type\":\"value\",\"max\":999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"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\":20,\"accessMode\":\"rw\",\"code\":\"lock_record\",\"description\":\"【上报关锁记录】用于设备上报门锁关锁的记录。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"256\"},\"name\":\"关锁记录\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"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\":[\"low_battery\",\"power_off\"]}},
{\"abilityId\":31,\"accessMode\":\"rw\",\"code\":\"beep_volume\",\"description\":\"【音量】用于设置设备本地导航语音音量大小。\",\"extensions\":{\"iconName\":\"icon-sound\",\"attribute\":\"1280\"},\"name\":\"提示音量\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"mute\",\"normal\"]}},
{\"abilityId\":33,\"accessMode\":\"rw\",\"code\":\"automatic_lock\",\"description\":\"【自动落锁】用于设置自动落锁功能的开关。关闭后即设备不会自动落锁,此时也可作为常开模式。\",\"extensions\":{\"iconName\":\"icon-power\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"自动落锁开关\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":36,\"accessMode\":\"rw\",\"code\":\"auto_lock_time\",\"description\":\"【自动落锁】用于设置设备解锁后到执行自动落锁的延迟时间。设置范围1s~30min。\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"自动落锁延时设置\",\"typeSpec\":{\"type\":\"value\",\"max\":1800,\"min\":1,\"scale\":0,\"step\":1}},
{\"abilityId\":44,\"accessMode\":\"rw\",\"code\":\"rtc_lock\",\"description\":\"【时钟RTC】若设备本地支持RTC功能,则选择该DP,用于校准云端和本地的时间。\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"硬件时钟RTC\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":46,\"accessMode\":\"rw\",\"code\":\"manual_lock\",\"description\":\"【落锁操作】用于触发设备执行落锁操作,可用于自动落锁和手动落锁。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"手动落锁\",\"typeSpec\":{\"type\":\"bool\"}},
{\"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\":\"1792\"},\"name\":\"同步开门方式(全量同步)\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":61,\"accessMode\":\"rw\",\"code\":\"remote_no_dp_key\",\"description\":\"【远程开锁】用于触发设备远程开锁操作。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1280\"},\"name\":\"远程开门(带校验码)\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":62,\"accessMode\":\"ro\",\"code\":\"unlock_phone_remote\",\"description\":\"【上报开锁记录】用于设备上报手机远程开锁的记录。\",\"extensions\":{\"iconName\":\"icon-shouji\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"远程手机解锁\",\"typeSpec\":{\"type\":\"value\",\"max\":999,\"min\":0,\"scale\":0,\"step\":1}},
{\"abilityId\":63,\"accessMode\":\"ro\",\"code\":\"unlock_voice_remote\",\"description\":\"【上报开锁记录】用于设备上报语音语音开锁的记录。\",\"extensions\":{\"iconName\":\"icon-dp_mic\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"远程语音解锁\",\"typeSpec\":{\"type\":\"value\",\"max\":999,\"min\":0,\"scale\":0,\"step\":1}},
{\"abilityId\":68,\"accessMode\":\"rw\",\"code\":\"special_function\",\"description\":\"【特殊功能】可根据自身需求用于设置其他特殊功能的开关。对应文案可在IoT平台进行修改。\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1280\",\"trigger\":\"direct\"},\"name\":\"校准\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"function1\",\"function2\",\"function3\",\"function4\"]}},
{\"abilityId\":69,\"accessMode\":\"rw\",\"code\":\"record\",\"description\":\"【获取开锁记录】用于手机主动获取设备本地存储的开门记录。\",\"extensions\":{\"iconName\":\"icon-dp_book\",\"attribute\":\"1280\"},\"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}},
{\"abilityId\":72,\"accessMode\":\"ro\",\"code\":\"unlock_record_check\",\"description\":\"【上报开锁记录】用于设备上报配件开锁及开关锁的记录。需要包含设备端具体触发开关锁的方式。\",\"extensions\":{\"iconName\":\"icon-tongji2\",\"attribute\":\"1280\"},\"name\":\"(带校验码)开关锁记录\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":73,\"accessMode\":\"rw\",\"code\":\"remote_pd_setkey_check\",\"description\":\"【远程开锁】用于配置远程开锁时需要的密钥。若设备需要进行远程开锁,该DP必选。\",\"extensions\":{\"iconName\":\"icon-dp_lock\",\"attribute\":\"1792\"},\"name\":\"配置远程解锁含校验\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":78,\"accessMode\":\"rw\",\"code\":\"special_control\",\"description\":\"【特殊控制】可根据自身需求用于触发其他特殊控制能力。对应文案可在IoT平台进行修改。\",\"extensions\":{\"iconName\":\"icon-dp_power2\",\"attribute\":\"1280\"},\"name\":\"开关方向\",\"typeSpec\":{\"type\":\"bool\"}}]}]}"
  },
  "success": true,
  "t": 1730035720957,
  "tid": "617139f4946711efad5172ecb0bd0dcf"
}

Product ID

rlyxv7pe

Product Name

A1 PRO MAX

Information about how the device functions

No response

make-all commented 4 weeks ago

What is an A1 PRO MAX?

ChrisDes commented 4 weeks ago

Is like a gimdow a1 pro smart lock, but without brand Gimdow

ChrisDes commented 3 weeks ago

I updated de custom_component folder and restart HA, but still showing me the previous device before. I don´t know if i´m doing something wrong. Thank you so much for your job image

ChrisDes commented 3 weeks ago

I could discover the new device changing some 'optionals', I don´t know if is a good idea. I changed functions name with the correct real function. But there is a bug, i can´t unlock the lock I can lock and manual lock and manual unlock.

name: Door lock
products:
  - id: rlyxv7pe
    name: Raykube A1 Pro Max
primary_entity:
  entity: lock
  dps:
    - id: 1
      type: string
      optional: true
      name: unlock_method_create
    - id: 2
      type: string
      optional: true
      name: unlock_method_delete
    - id: 3
      type: string
      optional: true
      name: unlock_method_modify
    - id: 16
      type: integer
      optional: true
      persist: false
      name: unlock_key
    - id: 19
      type: integer
      optional: true
      persist: false
      name: unlock_ble
    - id: 20
      type: string
      optional: true
      name: lock_record
    - id: 46
      type: boolean
      optional: true
      name: lock
    - id: 47
      type: boolean
      optional: true
      name: open
      readonly: true
    - id: 54
      type: string
      optional: true
      name: sync_method
    - id: 61
      type: string
      optional: true
      name: remote_no_dp_key
    - id: 62
      type: integer
      optional: true
      persist: false
      name: unlock_app
    - id: 63
      type: integer
      optional: true
      persist: false
      name: unlock_voice
    - id: 69
      type: string
      optional: true
      name: record
    - id: 70
      type: string
      optional: true
      name: check_code_set
    - id: 71
      type: string
      optional: true
      name: ble_unlock_check
    - id: 72
      type: string
      optional: true
      name: unlock_record_check
    - id: 73
      type: string
      optional: true
      name: remote_pd_setkey_check
secondary_entities:
  - entity: sensor
    class: battery
    category: diagnostic
    dps:
      - id: 9
        type: string
        name: sensor
        unit: "%"
        mapping:
          - dps_val: high
            value: 90
          - dps_val: medium
            value: 60
          - dps_val: low
            value: 30
          - dps_val: poweroff
            value: 0
  - entity: event
    name: Alert
    dps:
      - id: 21
        type: string
        name: event
        optional: true
        mapping:
          - dps_val: low_battery
            value: low_battery
          - dps_val: power_off
            value: power_off
  - entity: switch
    translation_key: keytone
    category: config
    dps:
      - id: 31
        type: string
        optional: true
        name: switch
        mapping:
          - dps_val: normal
            value: true
          - dps_val: mute
            value: false
  - entity: switch
    name: Auto-lock
    icon: "mdi:lock-clock"
    category: config
    dps:
      - id: 33
        type: boolean
        optional: true
        name: switch
  - entity: number
    name: Auto lock time
    category: config
    icon: "mdi:lock-clock"
    dps:
      - id: 36
        type: integer
        optional: true
        name: value
        unit: s
        range:
          min: 1
          max: 1800
  - entity: button
    name: Sync clock
    icon: "mdi:clock"
    category: config
    dps:
      - id: 44
        type: boolean
        name: button
        optional: true
  - entity: select
    name: Configuration
    icon: "mdi:function"
    category: config
    dps:
      - id: 68
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: function1
            value: Recalibrate
          - dps_val: function2
            value: Unlock more
          - dps_val: function3
            value: Keep retracted
          - dps_val: function4
            value: Add force
  - entity: switch
    name: Change direction
    category: config
    dps:
      - id: 78
        type: boolean
        optional: true
        name: switch
make-all commented 3 weeks ago

Making things optional blindly does not help, as it will end up false matching too many other devices. It is better that you send the logs you are getting using the original config, so the minimal set of optional dps can be worked out.

I mean the same message you sent at the top with the original report (that one is 100% match, so there must be some variation in what the device is reporting each time).