litinoveweedle / SmartIR

⏻ Control Home Assistant climate, media and fan devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome)
MIT License
45 stars 12 forks source link

HVAC action is not updating when HVACMode.AUTO #35

Closed ehedlund76 closed 2 weeks ago

ehedlund76 commented 2 weeks ago

Usually I'm not using HVACMode.AUTO, but lately I've been completing my device codes files with all the HVAC modes my AC supports. Then I've tested them in HA. I then found out that when my device is in HVACMode.AUTO it always reports HVACAction.IDLE. I had a look at climate.py and found that HVACMode.AUTO isn't handled in _async_update_hvac_action. Just to test I altered climate.py. I think HVACMode.AUTO probably should be treated the same way as HVAVMode.HEAT_COOL: elif ( (self._hvac_mode == HVACMode.HEAT or self._hvac_mode == HVACMode.HEAT_COOL or self._hvac_mode == HVACMode.AUTO) and self._current_temperature is not None and self._current_temperature < self._target_temperature ): self._hvac_action = HVACAction.HEATING elif ( (self._hvac_mode == HVACMode.COOL or self._hvac_mode == HVACMode.HEAT_COOL or self._hvac_mode == HVACMode.AUTO) and self._current_temperature is not None and self._current_temperature > self._target_temperature ): self._hvac_action = HVACAction.COOLING

litinoveweedle commented 2 weeks ago

Hello thank you once again, good catch. I will add auto, I agree that this should be probably treated in the same way as heat_cool as it is the way (at least to my knowledge) how the AC units works in Auto mode. This will be added to next release.

ehedlund76 commented 1 week ago

Hi @litinoveweedle While testing presets I've found that HVAC action when drying isn't updating correctly either. This not a big deal, but a small fix/enhancement if you have the time.

Drying is actually a kind of cooling mode, and drying should be active when in dry mode and temperature is above the target temperature. Otherwise it should be idle.

If testet successfully with this change in _async_update_hvac_action in climate.py:

elif (self._hvac_mode == HVACMode.DRY and self._current_temperature is not None and self._current_temperature > self._target_temperature ): self._hvac_action = HVACAction.DRYING