Add humidity_value support for climate sensors#4
Add humidity_value support for climate sensors#4evaldnet wants to merge 1 commit intoDrenso:mainfrom
Conversation
|
We will need the device specification to be able to verify this change; you can use https://github.com/Drenso/com.tuya2/blob/main/docs/device-request.md to see how to retrieve the specification. As is, it will add a duplicate setting, which is undesirable as it makes the interaction completely unclear for the user. We will need some additional alias mapping for |
|
Here is the device specification for my T & H Sensor: {
"device": {
"category": "wsdcg",
"product_id": "7akwzwfwhukkdsib",
"product_name": "T & H Sensor",
"name": "T & H Sensor",
"online": true,
"status": [
{ "code": "va_temperature", "value": 183 },
{ "code": "humidity_value", "value": 56 },
{ "code": "temp_unit_convert", "value": "c" }
]
},
"specifications": {
"category": "wsdcg",
"functions": [
{
"code": "temp_unit_convert",
"type": "Enum",
"values": "{\"range\":[\"c\",\"f\"]}"
}
],
"status": [
{
"code": "va_temperature",
"type": "Integer",
"values": "{\"unit\":\"℃\",\"min\":-200,\"max\":600,\"scale\":1,\"step\":1}"
},
{
"code": "humidity_value",
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
},
{
"code": "temp_unit_convert",
"type": "Enum",
"values": "{\"range\":[\"c\",\"f\"]}"
}
]
}
}Note: Regarding the duplicate setting concern - I understand. Happy to update the PR if you'd like me to implement the alias mapping, or I can wait for your guidance on the preferred approach. |
|
Apologies, here is the full device specification from Homey (my.homey.app → Device Settings → Device Specification): {
"device": {
"active_time": 1713609335,
"biz_type": 0,
"category": "wsdcg",
"create_time": 1713609335,
"icon": "smart/icon/ay1525749833414yotNt/60d869bb20b0e1b0f0347a9fd8781a3c.png",
"id": "<redacted>",
"ip": "<redacted>",
"lat": "<redacted>",
"local_key": "<redacted>",
"lon": "<redacted>",
"name": "T & H Sensor",
"online": true,
"owner_id": "<redacted>",
"product_id": "7akwzwfwhukkdsib",
"product_name": "T & H Sensor",
"status": [
{ "code": "va_temperature", "value": 183 },
{ "code": "humidity_value", "value": 56 },
{ "code": "temp_unit_convert", "value": "c" }
],
"sub": false,
"time_zone": "+02:00",
"uid": "<redacted>",
"update_time": 1713609335,
"uuid": "<redacted>"
},
"specifications": {
"category": "wsdcg",
"functions": [
{
"code": "temp_unit_convert",
"type": "Enum",
"values": "{\"range\":[\"c\",\"f\"]}"
}
],
"status": [
{
"code": "va_temperature",
"type": "Integer",
"values": "{\"unit\":\"℃\",\"min\":-200,\"max\":600,\"scale\":1,\"step\":1}"
},
{
"code": "humidity_value",
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
},
{
"code": "temp_unit_convert",
"type": "Enum",
"values": "{\"range\":[\"c\",\"f\"]}"
}
]
},
"data_points": "<not available>"
} |
Some Tuya climate sensors report humidity using the 'humidity_value' status code instead of 'va_humidity'. This adds support for both codes by mapping humidity_value to measure_humidity capability. Tested with T & H Sensor (product_id: 7akwzwfwhukkdsib). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d5ca1b3 to
3872bfe
Compare
|
Thank you for the specification. We have put this on our internal backlog for review as soon as possible. |
Summary
humidity_valueas an alternative Tuya status code for humidity (maps tomeasure_humidity)humidity_valueinstead ofva_humidityDevice tested
Device status codes:
{ "code": "va_temperature", "value": 183 }, { "code": "humidity_value", "value": 56 }, { "code": "temp_unit_convert", "value": "c" }Changes
TuyaClimateSensorConstants.ts: Addedhumidity_valueto capabilities and mappingdriver.settings.compose.json: Added scaling setting forhumidity_value🤖 Generated with Claude Code