DavidIlie / tuya-smart-ir-ac

Control Tuya IR based air conditioners from Home Assistant
12 stars 6 forks source link

Error when adding Climate entity #6

Open bchevreau opened 1 month ago

bchevreau commented 1 month ago

I am unsure if I got this right, but added the climate as shown in your git in my configuration.yml document and added all the relevant IDs. I tried with and without quotes as it seemed to have problems. But same result :

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:580
integration: Climate ([documentation](https://www.home-assistant.io/integrations/climate), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+climate%22))
First occurred: 01:36:01 (1 occurrences)
Last logged: 01:36:01

Error adding entity climate.aircon_master_hacked for domain climate with platform tuya_smart_ir_ac
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 890, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1334, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1058, in __async_calculate_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 328, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 519, in state_attributes
    hass, self.current_temperature, temperature_unit, precision
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 328, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_smart_ir_ac/climate.py", line 104, in current_temperature
    return float(sensor_state.state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'

I also get the error that another user get, but as a warning:

Logger: homeassistant.components.climate.const
Source: helpers/deprecation.py:206
integration: Climate ([documentation](https://www.home-assistant.io/integrations/climate), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+climate%22))
First occurred: 01:35:59 (2 occurrences)
Last logged: 01:35:59

SUPPORT_TARGET_TEMPERATURE was used from tuya_smart_ir_ac, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please report it to the author of the 'tuya_smart_ir_ac' custom integration
SUPPORT_FAN_MODE was used from tuya_smart_ir_ac, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.FAN_MODE instead, please report it to the author of the 'tuya_smart_ir_ac' custom integration

And finally, as another user suggested, Climates almost never support 0.5 steps for temperature, and it is known to cause issues in other integrations. Maybe an issue comes from there too ?