make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.21k stars 487 forks source link

Request support for Calibo Cloudfan DC With Light #2186

Open Tallyessin opened 1 month ago

Tallyessin commented 1 month ago

Log message

I'd have to delete my device and try to ad without my developed device Yaml. It gets detected as a switch.

Below I have added a yaml file that works for fan, fan speed, fan direction, fan default mode, light and light dimming. Timers are not supported yet. I'm getting an endless wait wheel from the IOT platform at the moment so can't pull the DPS right now and am very hesitant to muck with the device when I can't get the cloud keys.

The below YAML allows the device to be detected correctly whan commissioning.

This is adapted from the Skyfan DC with light which is a very similar device

DPS information

name: Calibo Cloudfan DC with Light
products:
  - id: 78m2fjtcj26yab5a
    name: Calibo Cloudfan DC with Light
primary_entity:
  entity: fan
  translation_only_key: fan_with_presets
  dps:
    - id: 1
      type: boolean
      name: switch
    - id: 2
      type: string
      name: preset_mode
      mapping:
        - dps_val: Normal
          value: normal
        - dps_val: Nature
          value: nature
        - dps_val: Sleep
          value: sleep
    - id: 3
      type: integer
      name: speed
      range:
        min: 1
        max: 6
    - id: 8
      type: string
      name: direction
      mapping: 
        - dps_val: Forward
          value: forward
        - dps_val: Reverse
          value: reverse
secondary_entities:
  - entity: light
    dps:
      - id: 15
        type: boolean
        name: switch
      - id: 16
        name: brightness
        type: integer
        range:
          min: 0
          max: 100
  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 22
        type: string
        name: option
        mapping:
          - dps_val: cancel
            value: "Off"
          - dps_val: "1h"
            value: "1

Product ID

78m2fjtcj26yab5a

Product Name

Calibo Cloudfan DC with Light

Information about how the device functions

Functions just like the Ventair Skyfan DC

Tallyessin commented 1 month ago

Updated Config. (My previous paste missed the bottom somehow.)

name: Calibo Cloudfan DC with Light products:

Tallyessin commented 1 month ago

IOT platform came back and here's the querydatamodel response:

{ "result": { "model": "{\"modelId\":\"0000042yer\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"switch\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power2\",\"attribute\":\"1024\"},\"name\":\"风扇\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"mode\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1024\"},\"name\":\"运行模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"normal\",\"sleep\",\"nature\"]}},{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"fan_speed\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-FanSpeed\",\"attribute\":\"1024\"},\"name\":\"风速\",\"typeSpec\":{\"type\":\"value\",\"max\":6,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":8,\"accessMode\":\"rw\",\"code\":\"fan_direction\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1024\"},\"name\":\"运行方向\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"forward\",\"reverse\"]}},{\"abilityId\":15,\"accessMode\":\"rw\",\"code\":\"light\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_light2\",\"attribute\":\"1040\"},\"name\":\"灯光\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":16,\"accessMode\":\"rw\",\"code\":\"bright_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-liangdu\",\"attribute\":\"1024\"},\"name\":\"灯光亮度\",\"typeSpec\":{\"type\":\"value\",\"max\":100,\"min\":0,\"scale\":0,\"step\":2,\"unit\":\"\"}},{\"abilityId\":22,\"accessMode\":\"rw\",\"code\":\"countdown_set\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time2\",\"attribute\":\"1152\"},\"name\":\"定时\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"cancel\",\"1h\",\"2h\",\"4h\",\"8h\"]}}]}]}" }, "success": true, "t": 1723091003693, "tid": "f361059d553d11efa251ced150d28e81" }