Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New updates no longer enable heating #78

Closed
brizoo opened this issue Feb 3, 2025 · 6 comments · Fixed by #80
Closed

New updates no longer enable heating #78

brizoo opened this issue Feb 3, 2025 · 6 comments · Fixed by #80
Labels
bug Something isn't working

Comments

@brizoo
Copy link
Contributor

brizoo commented Feb 3, 2025

After updating in HACS to the last version today, my thermostats no longer turn the heating on or off based on temperature. I understand the latest update changed some things, but the readme has not been updated yet. Am I supposed to change something in my configuration yaml?

I am using dual mode heating/ccooling thermostats.
Here is my climate_heater conf.yaml conf file:

########################################

DUAL MODE GENERIC THERMOSTAT

########################################

Heating Thermostat climate.salon
  • platform: dualmode_generic
    name: Thermostat Salon
    unique_id: climate.salon
    heater: switch.chauffage_salon
    cooler: switch.clim_salon
    fan: switch.fan_salon
    fan_behavior: cooler
    dryer: switch.dryer_salon
    dryer_behavior: cooler
    target_sensor: sensor.temperature_moyenne_salon
    min_temp: 14
    max_temp: 30
    cold_tolerance: 0.1
    hot_tolerance: 0.1
    away_temp_heater: 17 #has to be set from here
    away_temp_cooler: 30 #has to be set from here
    precision: 0.1
    reverse_cycle: cooler, heater
    enable_heat_cool: True
    min_cycle_duration:
    minutes: 0
    seconds: 30
Heating Thermostat climate.chambres
  • platform: dualmode_generic
    name: Thermostat Chambres
    unique_id: climate.chambres
    heater: switch.chauffage_chambres
    cooler: switch.clim_chambres
    fan: switch.fan_chambres
    fan_behavior: cooler
    dryer: switch.dryer_chambres
    dryer_behavior: cooler
    target_sensor: sensor.thermometre_couloir_temperature
    min_temp: 14
    max_temp: 30
    cold_tolerance: 0.1
    hot_tolerance: 0.1
    away_temp_heater: 17 #has to be set from here
    away_temp_cooler: 30 #has to be set from here
    precision: 0.1
    reverse_cycle: cooler, heater
    enable_heat_cool: True
    min_cycle_duration:
    minutes: 0
    seconds: 30

I have reverted to the previous version of climate.py and it's working again !

@david-kalbermatten
Copy link
Collaborator

I think I found the culprit already, sorry for the inconvenience!

The better switching of the heating and cooling modes conflicted with the reverse_cycle option. I'll add the necessary checks and push an update asap.

# Check new mode against previous HVAC mode and
if previous_mode is not None and previous_mode != self._hvac_mode:
    if previous_mode == HVAC_MODE_COOL:
        await self._async_cooler_turn_off()
    elif previous_mode == HVAC_MODE_HEAT:
        await self._async_heater_turn_off()
    elif previous_mode == HVAC_MODE_FAN_ONLY:
        await self._async_fan_turn_off()
    elif previous_mode == HVAC_MODE_DRY:
        await self._async_dryer_turn_off()
    elif previous_mode == HVAC_MODE_HEAT_COOL:
        if self._hvac_mode == HVAC_MODE_COOL:
            await self._async_heater_turn_off()
        elif self._hvac_mode == HVAC_MODE_HEAT:
            await self._async_cooler_turn_off()

Tbh. I never understood much, why this integration added this bit of logic as it can easily be implemented with template switches by the user. Do you have any insights on this @zacs ?

Also @brizoo, can you explain to me what your setup looks like, that you use reverse_cycle instead of using templates around it?

@zacs
Copy link
Owner

zacs commented Feb 4, 2025

That option was added by another contributor, so I don't recall the exact reasoning. I believe it was because if you had a single switch for both heater and cooler (a reverse cycle style unit) and wanted to avoid a rapid/inconsistent on-off-on sort of sequence to the switch.

Thanks for putting a fix together so quickly!

@brizoo
Copy link
Contributor Author

brizoo commented Feb 4, 2025

Hey @zacs and @david-kalbermatten
Thanks for your quick answers.

I have air air climate and heater units from Daikin.
They do both heating and cooling. Also I have only one switch per unit so I need to use the reverse_cycle I think.
I have implemented this multiple years ago.

Now what I have done is implemented automations to create a "smart" thermostat for my home that works for heating in winter and cooling in summer.

I use the dual mode thermostat from this page and I found it was the easier solution for my skills and needs.

I don't know if I answer to your question, I'm not sure what is using templates for reverse_cycle, I just used what looked like the easiest way of doing what I needed. I might be wrong!

Thanks

@brizoo
Copy link
Contributor Author

brizoo commented Feb 6, 2025

Hi @david-kalbermatten ,
I have updated to the last version and I still have the bug !
Can you check again please ?

@david-kalbermatten
Copy link
Collaborator

david-kalbermatten commented Feb 6, 2025

Fudge me...
I found the cause. Altough, don't know how that didn't cause issues much sooner xD

The old check only checked for self._target_temp and ignored high and low. Somehow, target_temp was always set and caused the device state to update to active everytime and after my cleanup, this check didn't work anymore for heat/cool.

This is the old check:

 if not self._active and None not in (self._cur_temp, self._target_temp):
      self._active = True
      _LOGGER.info(
          "Obtained current and target temperature. "
          "Generic Dual-mode thermostat active. %s, %s",
          self._cur_temp,
          self._target_temp,
      )

This is the new check

if not self._active and self._cur_temp is not None:
    if self._target_temp is not None or None not in (self._target_temp_high, self._target_temp_low):
        self._active = True
        _LOGGER.info(
            "Obtained current and target temperature(s). "
            "Generic Dual-mode thermostat active. Current: %s, Target: %s, Low: %s, High: %s",
            self._cur_temp,
            self._target_temp,
            self._target_temp_low,
            self._target_temp_high
        )

Created #79 to address the issue

@david-kalbermatten
Copy link
Collaborator

Feel free to reopen if the issue is still not solved after updating (yet again :D)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants