make-all / tuya-local

Local support for Tuya devices in Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request support for Avatto Curtain +2 Lights Switch

NashHome opened this issue · comments

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.

Model: SYS-CL02

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:

  • id: n76sxga6lyfujuac
    name: Avatto SYS-CL02
    primary_entity:
    entity: cover
    class: curtain
    dps:
    • id: 1
      name: control
      type: string
      mapping:
      • dps_val: open
        value: open
      • dps_val: close
        value: close
      • dps_val: stop
        value: stop
    • id: 2
      name: position
      type: integer
      unit: "%"
      range:
      min: 0
      max: 100
      mapping:
      • step: 10
        secondary_entities:
  • entity: switch
    class: switch
    name: Switch 1
    dps:
    • id: 101
      type: boolean
      name: switch
  • entity: switch
    class: switch
    name: Switch 2
    dps:
    • id: 102
      type: boolean
      name: switch
  • entity: select
    name: Calibration
    icon: "mdi:curtains"
    category: config
    dps:
    • id: 3
      type: string
      name: option
      optional: true
      mapping:
      • dps_val: start
        value: Start
      • dps_val: end
        value: End
  • entity: light
    translation_key: backlight
    category: config
    dps:
    • id: 7
      type: boolean
      name: switch
  • entity: switch
    name: Reverse
    icon: "mdi:arrow-u-down-left"
    category: config
    dps:
    • id: 8
      type: string
      name: switch
      mapping:
      • dps_val: forward
        value: false
      • dps_val: back
        value: true
  • entity: number
    name: Time control
    category: config
    icon: "mdi:timer"
    dps:
    • id: 10
      type: integer
      name: value
      unit: s
      range:
      min: 10
      max: 120