core: Tuya Air Conditioner reporting incorrect temperatures in HA
The problem
I’ve added the Tuya integration for Air Con control but the temperatures on it are in the negatives. Possibly an unnecessary F to C conversion. The Tuya debug and HA integration diagnostic downloads both show the correct temperatures so I think the problem lies in the integration.
What version of Home Assistant Core has the issue?
2022.5.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tuya
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tuya
Diagnostics information
–HA Developer tools State: hvac_modes: off, heat_cool, cool, heat, dry, fan_only min_temp: -8.9 max_temp: -0.6 target_temp_step: 1 min_humidity: 0 max_humidity: 100 fan_modes: 1, 2, 3 current_temperature: 0 temperature: -8.3 humidity: 30 fan_mode: null friendly_name: Portable Air Con supported_features: 13 icon: mdi:air-conditioner
–Integration Diagnostic Output: { “home_assistant”: { “installation_type”: “Home Assistant OS”, “version”: “2022.5.4”, “dev”: false, “hassio”: true, “virtualenv”: false, “python_version”: “3.9.9”, “docker”: true, “arch”: “x86_64”, “timezone”: “Europe/London”, “os_name”: “Linux”, “os_version”: “5.15.38”, “supervisor”: “2022.05.2”, “host_os”: “Home Assistant OS 8.0”, “docker_version”: “20.10.14”, “chassis”: “vm”, “run_as_root”: true }, “custom_components”: { ****** }, “integration_manifest”: { “domain”: “tuya”, “name”: “Tuya”, “documentation”: “https://www.home-assistant.io/integrations/tuya”, “requirements”: [ “tuya-iot-py-sdk==0.6.6” ], “dependencies”: [ “ffmpeg” ], “codeowners”: [ “@Tuya”, “@zlinoliver”, “@frenck” ], “config_flow”: true, “iot_class”: “cloud_push”, “dhcp”: [ ****** ], “loggers”: [ “tuya_iot” ], “is_built_in”: true }, “data”: { “endpoint”: “https://openapi.tuyaeu.com”, “auth_type”: 0, “country_code”: “44”, “app_type”: “tuyaSmart”, “mqtt_connected”: true, “disabled_by”: null, “disabled_polling”: false, “devices”: [ { “name”: “Portable Air Con”, “model”: “A011A.02.010.001”, “category”: “kt”, “product_id”: “4RUISW6Lmtz2u1l8”, “product_name”: “Portable air conditioner”, “online”: true, “sub”: false, “time_zone”: “+00:00”, “active_time”: “2022-05-18T19:05:29+00:00”, “create_time”: “2020-06-23T11:19:34+00:00”, “update_time”: “2022-05-18T19:06:14+00:00”, “function”: { “windspeed”: { “type”: “Enum”, “value”: { “range”: [ “1”, “2”, “3” ] } }, “humidity_set”: { “type”: “Integer”, “value”: { “min”: 0, “unit”: “%”, “scale”: 0, “max”: 100, “type”: “value”, “step”: 1 } }, “temp_set”: { “type”: “Integer”, “value”: { “min”: 16, “unit”: “\u2103”, “scale”: 0, “max”: 31, “type”: “value”, “step”: 1 } }, “switch”: { “type”: “Boolean”, “value”: {} }, “mode”: { “type”: “Enum”, “value”: { “range”: [ “auto”, “cold”, “hot”, “wet”, “wind”, “eco” ] } }, “c_f”: { “type”: “Enum”, “value”: { “range”: [ “C”, “F” ] } }, “temp_set_f”: { “type”: “Integer”, “value”: { “unit”: “\u2109”, “min”: 62, “max”: 90, “scale”: 0, “step”: 1 } } }, “status_range”: { “humidity_current”: { “type”: “”, “value”: { “min”: 0, “scale”: 0, “unit”: “%”, “max”: 100, “step”: 1 } }, “windspeed”: { “type”: “Enum”, “value”: { “range”: [ “1”, “2”, “3” ] } }, “humidity_set”: { “type”: “Integer”, “value”: { “min”: 0, “unit”: “%”, “scale”: 0, “max”: 100, “type”: “value”, “step”: 1 } }, “temp_current”: { “type”: “”, “value”: { “min”: -20, “scale”: 0, “unit”: “\u2103”, “max”: 100, “step”: 1 } }, “temp_set”: { “type”: “”, “value”: { “min”: 16, “unit”: “\u2103”, “scale”: 0, “max”: 31, “type”: “value”, “step”: 1 } }, “switch”: { “type”: “”, “value”: {} }, “mode”: { “type”: “Enum”, “value”: { “range”: [ “auto”, “cold”, “hot”, “wet”, “wind”, “eco” ] } }, “temp_current_f”: { “type”: “Integer”, “value”: { “unit”: “\u2109”, “min”: 32, “max”: 99, “scale”: 0, “step”: 1 } }, “c_f”: { “type”: “Enum”, “value”: { “range”: [ “C”, “F” ] } }, “temp_set_f”: { “type”: “Integer”, “value”: { “unit”: “\u2109”, “min”: 62, “max”: 90, “scale”: 0, “step”: 1 } } }, “status”: { “switch”: false, “temp_set”: 17, “temp_current”: 26, “humidity_set”: 30, “mode”: “hot”, “windspeed”: 3, “c_f”: “C”, “temp_set_f”: 62, “temp_current_f”: 32, “humidity_current”: 47 }, “home_assistant”: { “name”: “Portable Air Con”, “name_by_user”: null, “disabled”: false, “disabled_by”: null, “entities”: [ { “disabled”: false, “disabled_by”: null, “entity_category”: null, “device_class”: null, “original_device_class”: null, “icon”: “mdi:air-conditioner”, “original_icon”: null, “unit_of_measurement”: null, “state”: { “entity_id”: “climate.portable_air_con”, “state”: “off”, “attributes”: { “hvac_modes”: [ “off”, “heat_cool”, “cool”, “heat”, “dry”, “fan_only” ], “min_temp”: -8.9, “max_temp”: -0.6, “target_temp_step”: 1.0, “min_humidity”: 0, “max_humidity”: 100, “fan_modes”: [ “1”, “2”, “3” ], “current_temperature”: 0.0, “temperature”: -8.3, “humidity”: 30, “fan_mode”: null, “icon”: “mdi:air-conditioner”, “friendly_name”: “Portable Air Con”, “supported_features”: 13 }, “last_changed”: “2022-05-18T19:28:42.801437+00:00”, “last_updated”: “2022-05-18T19:52:04.197908+00:00” } } ] } } ] } }
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Only log entry for Tuya:
Logger: homeassistant.components.tuya
Source: components/tuya/climate.py:272
Integration: Tuya (documentation, issues)
First occurred: 20:26:01 (1 occurrences)
Last logged: 20:26:01
Unknown HVAC mode 'eco' for device Portable Air Con; assuming it as off
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 28 (7 by maintainers)
Commits related to this issue
- Update climate.py default unit to be more conistent with region temperature unit. Climate devices in the US don't operate correctly if Tuya API doesn't report the temperature unit. This is because cl... — committed to DellanX/core by DellanX 6 months ago
- Update climate.py default unit to be more conistent with region temperature unit. Climate devices in the US don't operate correctly if Tuya API doesn't report the temperature unit. This is because cl... — committed to DellanX/core by DellanX 6 months ago
Just trying to understand how we can help with this? - there are hundreds of posts across the HA forums for this exact issue.
“data”: { “endpoint”: “https://openapi.tuyaeu.com”, “auth_type”: 0, “country_code”: “44”, “app_type”: “tuyaSmart”, “mqtt_connected”: true, “disabled_by”: null, “disabled_polling”: false, “devices”: [ { “name”: “Cabin Air Conditioner”, “model”: “A011A.02.010.001”, “category”: “kt”, “product_id”: “4RUISW6Lmtz2u1l8”, “product_name”: “Portable air conditioner”, “online”: true, “sub”: false, “time_zone”: “+00:00”, “active_time”: “2022-06-07T14:48:32+00:00”, “create_time”: “2022-06-07T14:48:32+00:00”, “update_time”: “2022-06-07T14:48:55+00:00”, “function”: { “windspeed”: { “type”: “Enum”, “value”: { “range”: [ “1”, “2”, “3” ] } }, “humidity_set”: { “type”: “Integer”, “value”: { “min”: 0, “unit”: “%”, “scale”: 0, “max”: 100, “type”: “value”, “step”: 1 } }, “temp_set”: { “type”: “Integer”, “value”: { “min”: 16, “unit”: “\u2103”, “scale”: 0, “max”: 31, “type”: “value”, “step”: 1 } }, “switch”: { “type”: “Boolean”, “value”: {} }, “mode”: { “type”: “Enum”, “value”: { “range”: [ “auto”, “cold”, “hot”, “wet”, “wind”, “eco” ] } }, “c_f”: { “type”: “Enum”, “value”: { “range”: [ “C”, “F” ] } }, “temp_set_f”: { “type”: “Integer”, “value”: { “unit”: “\u2109”, “min”: 62, “max”: 90, “scale”: 0, “step”: 1 } } }, “status_range”: { “humidity_current”: { “type”: “”, “value”: { “min”: 0, “scale”: 0, “unit”: “%”, “max”: 100, “step”: 1 } }, “windspeed”: { “type”: “Enum”, “value”: { “range”: [ “1”, “2”, “3” ] } }, “humidity_set”: { “type”: “Integer”, “value”: { “min”: 0, “unit”: “%”, “scale”: 0, “max”: 100, “type”: “value”, “step”: 1 } }, “temp_current”: { “type”: “”, “value”: { “min”: -20, “scale”: 0, “unit”: “\u2103”, “max”: 100, “step”: 1 } }, “temp_set”: { “type”: “”, “value”: { “min”: 16, “unit”: “\u2103”, “scale”: 0, “max”: 31, “type”: “value”, “step”: 1 } }, “switch”: { “type”: “”, “value”: {} }, “mode”: { “type”: “Enum”, “value”: { “range”: [ “auto”, “cold”, “hot”, “wet”, “wind”, “eco” ] } }, “temp_current_f”: { “type”: “Integer”, “value”: { “unit”: “\u2109”, “min”: 32, “max”: 99, “scale”: 0, “step”: 1 } }, “c_f”: { “type”: “Enum”, “value”: { “range”: [ “C”, “F” ] } }, “temp_set_f”: { “type”: “Integer”, “value”: { “unit”: “\u2109”, “min”: 62, “max”: 90, “scale”: 0, “step”: 1 } } }, “status”: { “switch”: true, “temp_set”: 21, “temp_current”: 23, “humidity_set”: 90, “mode”: “cold”, “windspeed”: 1, “c_f”: “C”, “temp_set_f”: 62, “temp_current_f”: 32, “humidity_current”: 47 }, “home_assistant”: { “name”: “Cabin Air Conditioner”, “name_by_user”: null, “disabled”: false, “disabled_by”: null, “entities”: [ { “disabled”: false, “disabled_by”: null, “entity_category”: null, “device_class”: null, “original_device_class”: null, “icon”: null, “original_icon”: null, “unit_of_measurement”: null, “state”: { “entity_id”: “climate.cabin_air_conditioner”, “state”: “cool”, “attributes”: { “hvac_modes”: [ “off”, “heat_cool”, “cool”, “heat”, “dry”, “fan_only” ], “min_temp”: -8.9, “max_temp”: -0.6, “target_temp_step”: 1.0, “min_humidity”: 0, “max_humidity”: 100, “fan_modes”: [ “1”, “2”, “3” ], “current_temperature”: 0.0, “temperature”: -6.1, “humidity”: 90, “fan_mode”: null, “friendly_name”: “Cabin Air Conditioner”, “supported_features”: 13 }, “last_changed”: “2022-06-14T13:08:20.342662+00:00”, “last_updated”: “2022-06-14T14:06:26.341000+00:00” }
@RichardMawdsley Please don’t ping contributors and maintainers directly. Thanks 👍
Still an important issue that is unresolved
I have exactly the same issue. I’ve confirmed that the odd values is because it thinks the Celcius figure is a fahrenheit figure, and is trying to convert it to Celcius by using the following formula:
Fahrenheit to Celcius: [℃] = ([℉] − 32) × 5/9
So for example 21 ℃ is converted to (21 - 32) x 5/9 = -6 ℃ (rounded down)