make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.43k stars 556 forks source link

Request support for PowerAsia Smart Recessed Ligting RGB 6 Inch #2577

Open Sk1nnyDoc opened 2 days ago

Sk1nnyDoc commented 2 days ago

Log message

2024-11-30 10:25:28.046 WARNING (MainThread) [custom_components.tuya_local.config_flow] Adding Mesh-Gateway device with product id 2gowdgni
2024-11-30 10:25:28.046 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches cct_v1_lightbulb with quality of 17%. DPS: {"updated_at": 1732980325.369748, "1": true, "107": true, "108": true, "119": true, "125": "0", "143": true}

The device is added through Bluetooth Mesh gateway (Product ID : 2gowdgni Product Category: wg2)
End Device being added is the Bluetooth Recessed Light (Product ID: 8ugheslg Product Category: dj)

Product ID

8ugheslg

Product Name

PowerAsia Smart Recessed Ligting RGB 6 Inch

DPS information

{
  "result": {
    "model": "{\"modelId\":\"flrkuo\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"switch_led\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power\",\"attribute\":\"1664\"},\"name\":\"开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":2,\"accessMode\":\"wr\",\"code\":\"work_mode\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1664\"},\"name\":\"工作模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}},{\"abilityId\":3,\"accessMode\":\"wr\",\"code\":\"bright_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-liangdu1\",\"attribute\":\"1152\"},\"name\":\"白光亮度\",\"typeSpec\":{\"type\":\"value\",\"max\":1000,\"min\":10,\"scale\":0,\"step\":1}},{\"abilityId\":4,\"accessMode\":\"wr\",\"code\":\"temp_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_half\",\"attribute\":\"1152\"},\"name\":\"冷暖值\",\"typeSpec\":{\"type\":\"value\",\"max\":1000,\"min\":0,\"scale\":0,\"step\":1}},{\"abilityId\":11,\"accessMode\":\"wr\",\"code\":\"colour_data_raw\",\"description\":\"Beacon mesh照明设备彩光控制\",\"extensions\":{\"iconName\":\"icon-yanse\",\"attribute\":\"128\"},\"name\":\"彩光\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}},{\"abilityId\":107,\"accessMode\":\"rw\",\"code\":\"white_switch\",\"description\":\"\",\"name\":\"白光开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":108,\"accessMode\":\"rw\",\"code\":\"color_switch\",\"description\":\"\",\"name\":\"彩光开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":109,\"accessMode\":\"rw\",\"code\":\"scene_data1\",\"description\":\"Value: ABCD;\\nAA: scene_num\\nBB: effects_num\\nCC: color_num\\nDD: :speed\",\"name\":\"彩光场景\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":112,\"accessMode\":\"wr\",\"code\":\"countdown1\",\"description\":\"\",\"name\":\"倒计时\",\"typeSpec\":{\"type\":\"value\",\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":113,\"accessMode\":\"rw\",\"code\":\"switch_gradient1\",\"description\":\"\",\"name\":\"开关渐变\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":119,\"accessMode\":\"rw\",\"code\":\"main_switch\",\"description\":\"\",\"name\":\"总开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":121,\"accessMode\":\"wr\",\"code\":\"music_data1\",\"description\":\"\",\"name\":\"APP音乐律动\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":123,\"accessMode\":\"rw\",\"code\":\"device_info1\",\"description\":\"\",\"name\":\"设备状态\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":125,\"accessMode\":\"rw\",\"code\":\"separate_control\",\"description\":\"0互斥1全开\",\"name\":\"分控开关\\t\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\"]}},{\"abilityId\":140,\"accessMode\":\"wr\",\"code\":\"timestamp\",\"description\":\"\",\"name\":\"时间戳\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":141,\"accessMode\":\"wr\",\"code\":\"local_timer1\",\"description\":\"\",\"name\":\"通用定时\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":142,\"accessMode\":\"wr\",\"code\":\"timer_mgr\",\"description\":\"\",\"name\":\"定时器管理器\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":143,\"accessMode\":\"rw\",\"code\":\"nightlight_switch\",\"description\":\"\",\"name\":\"小夜灯\",\"typeSpec\":{\"type\":\"bool\"}}]}]}"
  },
  "success": true,
  "t": 1732980839919,
  "tid": "851c03cfaf3011efb0b89e5820c93cc8"
}

Information about how the device functions

PowerAsia Light - Tuya app controls (Small)

Power Asia Recessed light is very similar to existing config of "/custom_components/tuya_local/devices/peteme_smart_recessed_lighting.yaml". I followed instruction as per new device configuration readme.md and cloned the config file and mapped the DP as per the new device's tuya dp list Powerasia_recessed_light_6inch.yaml.json. I was able to add the device to HA and control it. Following DP's worked without issue: on/off, brightness, color temp. But couldn't make the color RGB work. The DP "code": "colour_data_raw", "dp_id": 11 is of type raw. Couldn't figure out if it needs hex or hsv or rgb.

Really hoping the color can be supported. Currently a 12pack of these 6 inch lights is just US $120. What a deal. Amazon Link Power Asia Product Page

Sk1nnyDoc commented 2 days ago

Also attaching the Tuya Query Properties result

{
  "result": {
    "properties": [
      {
        "code": "switch_led",
        "custom_name": "",
        "dp_id": 1,
        "time": 1732985047068,
        "type": "bool",
        "value": true
      },
      {
        "code": "work_mode",
        "custom_name": "",
        "dp_id": 2,
        "time": 1732840694196,
        "type": "enum",
        "value": "white"
      },
      {
        "code": "bright_value",
        "custom_name": "",
        "dp_id": 3,
        "time": 1732840694196,
        "type": "value",
        "value": 10
      },
      {
        "code": "temp_value",
        "custom_name": "",
        "dp_id": 4,
        "time": 1732840694196,
        "type": "value",
        "value": 0
      },
      {
        "code": "colour_data_raw",
        "custom_name": "",
        "dp_id": 11,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "white_switch",
        "custom_name": "",
        "dp_id": 107,
        "time": 1732983162087,
        "type": "bool",
        "value": true
      },
      {
        "code": "color_switch",
        "custom_name": "",
        "dp_id": 108,
        "time": 1732983181441,
        "type": "bool",
        "value": true
      },
      {
        "code": "scene_data1",
        "custom_name": "",
        "dp_id": 109,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "countdown1",
        "custom_name": "",
        "dp_id": 112,
        "time": 1732840694196,
        "type": "value",
        "value": 0
      },
      {
        "code": "switch_gradient1",
        "custom_name": "",
        "dp_id": 113,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "main_switch",
        "custom_name": "",
        "dp_id": 119,
        "time": 1732947279515,
        "type": "bool",
        "value": true
      },
      {
        "code": "music_data1",
        "custom_name": "",
        "dp_id": 121,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "device_info1",
        "custom_name": "",
        "dp_id": 123,
        "time": 1732980945341,
        "type": "raw",
        "value": "EABkMgBkZAAAAAAA"
      },
      {
        "code": "separate_control",
        "custom_name": "",
        "dp_id": 125,
        "time": 1732846323297,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "timestamp",
        "custom_name": "",
        "dp_id": 140,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "local_timer1",
        "custom_name": "",
        "dp_id": 141,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "timer_mgr",
        "custom_name": "",
        "dp_id": 142,
        "time": 1732840694196,
        "type": "raw"
      },
      {
        "code": "nightlight_switch",
        "custom_name": "",
        "dp_id": 143,
        "time": 1732983150505,
        "type": "bool",
        "value": false
      }
    ]
  },
  "success": true,
  "t": 1732985101774,
  "tid": "7168a3b6af3a11ef8dfe260dbde5a634"
}