tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
879 stars 207 forks source link

Air Purifier: Concept CA3000 #101

Closed vookimedlo closed 3 years ago

vookimedlo commented 3 years ago

Air Purifier

Device info

{
"active_time": 1625521057,
"biz_type": 0,
"category": "kj",
"create_time": 1625521057,
"icon": "smart/icon/ay1540297496816oxc9T/f27419b4d1610a764a8094be2ac655e4.png",
"id": "<REDACTED>",
"ip": "<REDACTED>",
"lat": "",
"local_key": "<REDACTED>",
"lon": "",
"name": "Air Purifier",
"online": true,
"owner_id": "<REDACTED>",
"product_id": "carcnzvstaghvr5s",
"product_name": "K08Air Purifier",
"status": [
{
"code": "switch",
"value": true
},
{
"code": "pm25",
"value": 6
},
{
"code": "mode",
"value": "auto"
},
{
"code": "speed",
"value": "1"
},
{
"code": "anion",
"value": true
},
{
"code": "lock",
"value": false
},
{
"code": "uv",
"value": true
}
],
"sub": false,
"time_zone": "+01:00",
"uid": "<REDACTED>",
"update_time": 1625521077,
"uuid": "<REDACTED>"
}

Device specifications

"result": {
"category": "kj",
"functions": [
{
"code": "switch",
"type": "Boolean",
"values": "{}"
},
{
"code": "mode",
"type": "Enum",
"values": "{\"range\":[\"auto\",\"sleep\",\"manual\"]}"
},
{
"code": "speed",
"type": "Enum",
"values": "{\"range\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]}"
},
{
"code": "anion",
"type": "Boolean",
"values": "{}"
},
{
"code": "lock",
"type": "Boolean",
"values": "{}"
},
{
"code": "uv",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "switch",
"type": "Boolean",
"values": "{}"
},
{
"code": "pm25",
"type": "Integer",
"values": "{\"unit\":\"\",\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"
},
{
"code": "mode",
"type": "Enum",
"values": "{\"range\":[\"auto\",\"sleep\",\"manual\"]}"
},
{
"code": "speed",
"type": "Enum",
"values": "{\"range\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]}"
},
{
"code": "anion",
"type": "Boolean",
"values": "{}"
},
{
"code": "lock",
"type": "Boolean",
"values": "{}"
},
{
"code": "uv",
"type": "Boolean",
"values": "{}"
}
]
},
"success": true,
"t": 1625565768829
}

I did a dirty hack using the switch code to have a temporary solution for controlling the UV, Ionizer and power. However, the real solution would be to map the support to the HA Climate/HVAC.

image

tsutsuku commented 3 years ago

@vookimedlo I think fan + switch will be better, welcome to create a PR. let's make tuya_v2 better together.

vookimedlo commented 3 years ago

@vookimedlo I think fan + switch will be better, welcome to create a PR. let's make tuya_v2 better together.

Sure, I will implement this (this will also resolve another air purifier request - #104 )

vookimedlo commented 3 years ago

Fixed.