make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.01k stars 405 forks source link

Request support for Avatto Curtain +2 Lights Switch #1892

Open NashHome opened 3 weeks ago

NashHome commented 3 weeks ago

Log Message


Log from the Tuya IoT Query Things Data Model:

{
  "result": {
    "model": "{\"modelId\":\"000002kfz8\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"control\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-a_power\",\"attribute\":\"260\"},\"name\":\"一路窗帘开关\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"open\",\"stop\",\"close\",\"continue\"]}},{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"percent_control\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-icon-percent\"},\"name\":\"一路百分比控制\",\"typeSpec\":{\"type\":\"value\",\"max\":100,\"min\":0,\"scale\":0,\"step\":10,\"unit\":\"%\"}},{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"cur_calibration\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_loop\"},\"name\":\"一路精准校准\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"start\",\"end\"]}},{\"abilityId\":7,\"accessMode\":\"rw\",\"code\":\"switch_backlight\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power3\",\"attribute\":\"4\"},\"name\":\"背光开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":8,\"accessMode\":\"rw\",\"code\":\"control_back\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_loop\"},\"name\":\"一路电机转向切换\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"forward\",\"back\"]}},{\"abilityId\":10,\"accessMode\":\"rw\",\"code\":\"tr_timecon\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time2\"},\"name\":\"一路快捷校准\",\"typeSpec\":{\"type\":\"value\",\"max\":120,\"min\":10,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":12,\"accessMode\":\"rw\",\"code\":\"elec_machinery_mode\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time2\"},\"name\":\"一路电机模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"strong_power\",\"dry_contact\"]}},{\"abilityId\":101,\"accessMode\":\"rw\",\"code\":\"Light_1\",\"description\":\"\",\"extensions\":{\"attribute\":\"5\"},\"name\":\"灯开关1\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":102,\"accessMode\":\"rw\",\"code\":\"Light_2\",\"description\":\"\",\"extensions\":{\"attribute\":\"5\"},\"name\":\"灯开关2\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"countdown_L1\",\"description\":\"\",\"name\":\"灯1倒计时\",\"typeSpec\":{\"type\":\"value\",\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":104,\"accessMode\":\"rw\",\"code\":\"countdown_L2\",\"description\":\"\",\"name\":\"灯2倒计时\",\"typeSpec\":{\"type\":\"value\",\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}}]}]}"
  },
  "success": true,
  "t": 1715073914656,
  "tid": "b5eb6b5c0c5311efbf3eca33718be921"
}

Information about DPS mappings


control | Enum | {   "range": [     "open",     "stop",     "close",     "continue"   ] }
percent_control | Integer | {   "unit": "%",   "min": 0,   "max": 100,   "scale": 0,   "step": 10 }
cur_calibration | Enum | {   "range": [     "start",     "end"   ] }
switch_backlight | Boolean | "{true,false}"
control_back | Enum | {   "range": [     "forward",     "back"   ] }
tr_timecon | Integer | {   "unit": "s",   "min": 10,   "max": 120,   "scale": 0,   "step": 1 }
elec_machinery_mode | Enum | {   "range": [     "strong_power",     "dry_contact"   ] }
Light_1 | Boolean | "{true,false}"
Light_2 | Boolean | "{true,false}"
countdown_L1 | Integer | {   "unit": "s",   "min": 0,   "max": 86400,   "scale": 0,   "step": 1 }
countdown_L2 | Integer | {   "unit": "s",   "min": 0,   "max": 86400,   "scale": 0,   "step": 1 }

DP ID
Curtain Switch 1        code: "1"
Percentage control 1    code: "2"
Accurate Calibration 1  code: "3"
Light 1             code: "101"
Light 2             code: "102"
Backlight switch        code: "7"
灯1倒计时           code: "103"
Motor steering 1        code: "8"
灯2倒计时           code: "104"
Quick Calibration 1     code: "10"
Motor Mode 1        code: "12"

Product ID

"product_id": "n76sxga6lyfujuac", "product_name": "Curtain + 2 Lights Switch"

Information about how the device functions

This device functionality is exactly as the "Avatto curtain and light switch", which's already exists in TuyaLocal, but with an additional Light switch.

NashHome commented 3 weeks ago

Model: SYS-CL02

NashHome commented 3 weeks ago

I wrote the YAML file by myself according to your file for the curtain and 1 switch: avatto_curtain_2lights.yaml

Feel free to close the ticket and broadcast.

Here is the code:

name: Avatto Curtain and 2Lights products: