make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.28k stars 505 forks source link

Request support for HRV KCvents VT501-W #1349

Open bepluy opened 10 months ago

bepluy commented 10 months ago

Log Message

DPS: {"1": true, "101": false, "102": true, "103": false, "104": false, "105": false, "106": false, "107": false, "108": 778, "109": 158, "111": false, "112": false, "113": true} ``` 2023-11-27 14:59:23.180 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches sh07_sprinkler_controller with quality of 54%. DPS: {"updated_at": 1701086357.0082805, "1": true, "101": false, "102": true, "103": false, "104": false, "105": false, "106": false, "107": false, "108": 778, "109": 158, "111": false, "112": false, "113": true} 2023-11-27 14:59:23.181 WARNING (MainThread) [custom_components.tuya_local.config_flow] Report this to https://github.com/make-all/tuya-local/issues/ 2023-11-27 15:16:24.371 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 662, "full_poll": false} 2023-11-27 15:16:26.846 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch new pending updates: {"1": {"value": false, "updated_at": 1701087386.8463442, "sent": false}} 2023-11-27 15:16:26.851 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch sending dps update: {"1": false} 2023-11-27 15:16:26.976 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"1": false, "full_poll": true} 2023-11-27 15:16:27.093 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"1": false, "101": false, "102": true, "103": false, "104": false, "105": false, "106": false, "107": false, "108": 662, "109": 183, "111": false, "112": false, "113": true, "full_poll": false} 2023-11-27 15:16:27.208 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"113": false, "full_poll": false} 2023-11-27 15:16:27.324 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"102": false, "full_poll": false} 2023-11-27 15:16:27.554 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 650, "full_poll": false} 2023-11-27 15:16:29.585 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch new pending updates: {"1": {"value": true, "updated_at": 1701087389.5852993, "sent": false}} 2023-11-27 15:16:29.593 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch sending dps update: {"1": true} 2023-11-27 15:16:29.725 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"1": true, "full_poll": true} 2023-11-27 15:16:29.849 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"1": true, "101": false, "102": false, "103": false, "104": false, "105": false, "106": false, "107": false, "108": 650, "109": 183, "111": false, "112": false, "113": false, "full_poll": false} 2023-11-27 15:16:29.968 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"113": true, "full_poll": false} 2023-11-27 15:16:30.088 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"102": true, "full_poll": false} 2023-11-27 15:16:30.544 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 641, "full_poll": false} 2023-11-27 15:16:33.540 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 636, "full_poll": false} 2023-11-27 15:16:33.658 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"109": 184, "full_poll": false} 2023-11-27 15:16:36.633 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 628, "full_poll": false} 2023-11-27 15:16:36.754 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"109": 183, "full_poll": false} 2023-11-27 15:16:39.722 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 614, "full_poll": false} 2023-11-27 15:16:42.792 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 598, "full_poll": false} 2023-11-27 15:16:45.790 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 584, "full_poll": false} 2023-11-27 15:16:48.872 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 574, "full_poll": false} 2023-11-27 15:16:51.957 DEBUG (MainThread) [custom_components.tuya_local.device] Simple switch received {"108": 567, "full_poll": false} ```
{
  "result": {
    "properties": [
      {
        "code": "switch",
        "custom_name": "",
        "dp_id": 1,
        "time": 1701038599041,
        "value": true
      },
      {
        "code": "speed_one",
        "custom_name": "",
        "dp_id": 101,
        "time": 1701034713524,
        "value": false
      },
      {
        "code": "speed_two",
        "custom_name": "",
        "dp_id": 102,
        "time": 1701038599281,
        "value": true
      },
      {
        "code": "speed_three",
        "custom_name": "",
        "dp_id": 103,
        "time": 1701033408235,
        "value": false
      },
      {
        "code": "sleep_mode",
        "custom_name": "",
        "dp_id": 104,
        "time": 1701033366512,
        "value": false
      },
      {
        "code": "huimidity_one",
        "custom_name": "",
        "dp_id": 105,
        "time": 1701033367380,
        "value": false
      },
      {
        "code": "huimidity_two",
        "custom_name": "",
        "dp_id": 106,
        "time": 1701033368610,
        "value": false
      },
      {
        "code": "huimidity_three",
        "custom_name": "",
        "dp_id": 107,
        "time": 1700814338139,
        "value": false
      },
      {
        "code": "huimi",
        "custom_name": "",
        "dp_id": 108,
        "time": 1701038674130,
        "value": 327
      },
      {
        "code": "temper",
        "custom_name": "",
        "dp_id": 109,
        "time": 1701038674148,
        "value": 216
      },
      {
        "code": "in_mode",
        "custom_name": "",
        "dp_id": 111,
        "time": 1701033369321,
        "value": false
      },
      {
        "code": "out_mode",
        "custom_name": "",
        "dp_id": 112,
        "time": 1700938380962,
        "value": false
      },
      {
        "code": "auto_mode",
        "custom_name": "",
        "dp_id": 113,
        "time": 1701038599198,
        "value": true
      }
    ]
  },
  "success": true,
  "t": 1701038674379,

Information about DPS mappings

{
  "result": {
    "model": "{\"modelId\":\"00000338x2\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[
{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"switch\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power2\"},\"name\":\"ON/OFF\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":101,\"accessMode\":\"rw\",\"code\":\"speed_one\",\"description\":\"\",\"name\":\"Low Speed\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":102,\"accessMode\":\"rw\",\"code\":\"speed_two\",\"description\":\"\",\"name\":\"Medium Speed\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"speed_three\",\"description\":\"\",\"name\":\"High Speed\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":104,\"accessMode\":\"rw\",\"code\":\"sleep_mode\",\"description\":\"\",\"name\":\"Sleep mode\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":105,\"accessMode\":\"rw\",\"code\":\"huimidity_one\",\"description\":\"\",\"name\":\"Low Humidity\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":106,\"accessMode\":\"rw\",\"code\":\"huimidity_two\",\"description\":\"\",\"name\":\"Medium Humidity\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":107,\"accessMode\":\"rw\",\"code\":\"huimidity_three\",\"description\":\"\",\"name\":\"High Humidity\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":108,\"accessMode\":\"ro\",\"code\":\"huimi\",\"description\":\"\",\"name\":\"humidity\",\"typeSpec\":{\"max\":10000,\"min\":0,\"scale\":1,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"\"}},
{\"abilityId\":109,\"accessMode\":\"ro\",\"code\":\"temper\",\"description\":\"\",\"name\":\"temperature\",\"typeSpec\":{\"max\":10000,\"min\":0,\"scale\":1,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"\"}},
{\"abilityId\":111,\"accessMode\":\"rw\",\"code\":\"in_mode\",\"description\":\"\",\"name\":\"Fresh Air Mode\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":112,\"accessMode\":\"rw\",\"code\":\"out_mode\",\"description\":\"\",\"name\":\"Exhausted Air Mode\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},
{\"abilityId\":113,\"accessMode\":\"rw\",\"code\":\"auto_mode\",\"description\":\"\",\"name\":\"Regenerate Mode\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}}]}]}"
  },
  "success": true,
  "t": 1701087659661,
  "tid": "6c4176628d1f11eeb675fa6037e836b7"

Product ID

{
  "result": [
    {
      "active_time": 1687353365,
      "category": "xfj",
      "create_time": 1687353365,
      "custom_name": "HRV",
      "icon": "smart/icon/bay16159719729188XMP/0695dc84d3c32b9a87acfd08d54ea028.png",
      "id": "bfaad9eb32d9507f89avzo",
      "ip": "xxxxxxxxxx",
      "is_online": true,
      "lat": "xxxx",
      "local_key": "",
      "lon": "xxxx",
      "model": "",
      "name": "Heat Recovery Ventilator",
      "product_id": "5p0togo3y3yzgp2p",
      "product_name": "Heat Recovery Ventilator",
      "sub": false,
      "time_zone": "+03:00",
      "update_time": 1701033539,
      "uuid": "065212efd4579d2e"
    }
  ],
  "success": true,
  "t": 1701087730267,
  "tid": "966afcf68d1f11ee98a1b60f6f2e1cb1"
}
make-all commented 9 months ago

The way this device splits its settings across multiple dps makes it difficult to support, unless that rather dipswitch like control interface is just simply copied instead of trying to integrate it as native Home Assistant entities..

bepluy commented 9 months ago

Dps 108 and 109 are just temp. and hum. sensors. Others are like dipswitches - on/off. Global switch - id 1, others are speed, vent. modes. And probably if you set "code": "speed_three" - to true, then other speeds become false. So i think it's ok to integrate this device just with switches - and use it in scenes or automations. Or we need to make it suitable for fan or climate integration ?