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

"hot_tolerance" not woking as expected when in heat_cool mode #48

Closed
bootloos opened this issue Dec 10, 2022 · 6 comments · Fixed by #58
Closed

"hot_tolerance" not woking as expected when in heat_cool mode #48

bootloos opened this issue Dec 10, 2022 · 6 comments · Fixed by #58
Assignees

Comments

@bootloos
Copy link

Hi,

I've discovered an issue when setting the thermostat in heat_cool mode.
A bit of context first. Until now I've been using ha-dual-smart-thermostat for a room where there's only a heater without issue. I've configured it to reach 20ºC with both "hot_tolerance" and "cold_tolerance" set to 0.3. (full config below). It's been woking as expected, when temperature falls below 19.7ºC the heater starts and when it reaches 20.3 the heater stops, see the graph:
image

Seeing it is working perfectly I'm in the process of implementing it on other rooms in my home using the advantage of heat_cool mode for an HVAC appliance. The issue I've encountered is that this behaviour is not the same. I've configured other thermostat with "target_temp_low: 21" for winter and "target_temp_high: 24" for summer with hot and cold tolerance set to 0.3 as before. My idea is that the thermostat brings online the heater when the temperature is below 20.7ºC and shut it off when temp is above 21.3ºC and the AC should switch on when temp reaches 24.3ºC and shut off when it falls below 23.7ºC. The problem is that the thermostat is not doing that. I've not been able to test the "summer" setting yet but in "winter" setting the thermostat seems to be activating the heater when temp is below 20.7ºC but it shuts the heater off on the next cycle of the temp sensor, at around 20.9ºC. My guess is that tolerances are not working properly. See the screenshot(I configured the thermostat around 14:30)
image

I've been having a look to the code and I think I've find at least part of the problem. (I'm no developer and last time I wrote code was in college in C++ so take this with a grain of salt ;) ). What I found is that tolerances for heat_cool mode are checked on lines 877 and 878 on climate.py using "target_temp_low" and "target_temp_high" as argument but when in heat mode are checked w/o argument, thus checking the same value. I believe on heat_cool mode the heating or cooling mode should be taken into account maybe something like this:
if self._is_heater_active:
too_cold = self._is_too_cold("_target_temp_low")
too_hot = self._is_too_hot("_target_temp_low")
elif self._is_cooler_active:
too_cold = self._is_too_cold("_target_temp_high")
too_hot = self._is_too_hot("_target_temp_high")
else:
too_cold = self._is_too_cold("_target_temp_low")
too_hot = self._is_too_hot("_target_temp_high")

I'm attaching my config for both thermostats so hopefully you can reproduce the issue:

  • platform: dual_smart_thermostat
    name: termostato_dormitorio
    heater: switch.radiador_dormitorio
    target_sensor: sensor.sensor_dormitorio_temperature
    openings:

    • binary_sensor.ventana_de_la_escalera_contact
    • binary_sensor.puerta_de_casa_contact
      target_temp: 20
      cold_tolerance: 0.3
      hot_tolerance: 0.3
      min_cycle_duration:
      seconds: 30
      initial_hvac_mode: heat
      away:
      temperature: 15
      home:
      temperature: 17
      comfort:
      temperature: 20
  • platform: dual_smart_thermostat
    name: termostato_salon
    heater: switch.calefaccion_salon
    cooler: switch.refrigeracion_salon
    target_sensor: sensor.sensor_salon_temperature
    openings:

    • binary_sensor.ventana_de_la_escalera_contact
    • binary_sensor.puerta_de_casa_contact
      heat_cool_mode: true
      target_temp_low: 17
      target_temp_high: 27
      cold_tolerance: 0.3
      hot_tolerance: 0.3
      min_cycle_duration:
      minutes: 10
      initial_hvac_mode: heat_cool
      away:
      target_temp_low: 15
      target_temp_high: 30
      home:
      target_temp_low: 17
      target_temp_high: 27
      comfort:
      target_temp_low: 21
      target_temp_high: 24
@ollo69
Copy link
Contributor

ollo69 commented Dec 21, 2022

I think that the idea, because in this configuration you already have a range for cold to hot, is to use the cold_tollerance to define the lower limit below the target_temp_low when the thermostat is in heater mode and the hot_tollerance to define the higher limit above the target_temp_high when the thermostat is in cooler mode. The others two limits are defined by the 2 target settings. Also your solution can work, but we should also consider that we have to avoid possible overlapping. Are just point of view, and I think that we should wait for the opinion of integration owner.

@Jeffrey-JK
Copy link

I have this same issue when using the heat_cool mode although I am not able to give much insight into the code side of things I could provide info if needed. It has been awhile without any updates, bootloos did you find a workaround or maybe a solution via config?

@bootloos
Copy link
Author

I'm afraid no. After tinkering a bit I found that with

min_cycle_duration:
minutes: 30

The HVAC stays on long enough for the temp to "circle" the desired setting.

Hope this helps

@Jeffrey-JK
Copy link

I'm afraid no. After tinkering a bit I found that with

min_cycle_duration: minutes: 30

The HVAC stays on long enough for the temp to "circle" the desired setting.

Hope this helps

Thank you, I am not sure that would work for me as the outdoor temp varies drastically. I guess for now I will just manually switch between heat and cool. It is a killer feature its a shame its broken but it is still nicer having both in one interface at least.

@swingerman swingerman self-assigned this Jul 3, 2023
@swingerman
Copy link
Owner

I am bout to wrap up this feature. Covered it with a test, and seems to work as described.

swingerman pushed a commit that referenced this issue Jul 4, 2023
enables the termostat to use the tolerancees both for heater and cooler when in heat_cool mode

Fixes #48
swingerman pushed a commit that referenced this issue Jul 4, 2023
enables the termostat to use the tolerancees both for heater and cooler when in heat_cool mode

Fixes #48
swingerman pushed a commit that referenced this issue Jul 4, 2023
enables the termostat to use the tolerancees both for heater and cooler when in heat_cool mode

Fixes #48
swingerman pushed a commit that referenced this issue Jul 4, 2023
enables the termostat to use the tolerancees both for heater and cooler when in heat_cool mode

Fixes #48
swingerman pushed a commit that referenced this issue Jul 4, 2023
enables the termostat to use the tolerancees both for heater and cooler when in heat_cool mode

Fixes #48
swingerman added a commit that referenced this issue Jul 4, 2023
)

enables the termostat to use the tolerancees both for heater and cooler when in heat_cool mode

Fixes #48

Co-authored-by: = <=>
@swingerman
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants