zacs / ha-dualmodegeneric

Generic thermostat capable of heating and cooling
68 stars 26 forks source link

Thermostat does not seem to honor min_cycle_duration #16

Closed scarpazza closed 5 months ago

scarpazza commented 3 years ago

Hi. It appears that the thermostat does not properly honor the min_cycle_duration directive. Below follows a minimalistic example with fake heat and cooler switches. min_cycle_duration is set to 10 seconds, but quick manual operation reveals that it's possible to make either heat or cooler switches trigger off-on-off almost immediately, while the second transition should not occur earlier than 10 seconds after the first one.

Thanks

Minimal demonstrator configuration follows:


switch:
  - platform: command_line
    switches:
      heater_downstairs:
        friendly_name: "Heater Downstairs"
        command_on:  "echo PWR ON heater_downstairs | write myusername"
        command_off: "echo PWR OFF heater_downstairs | write myusername"
      ac_downstairs:
        friendly_name: "Air Conditioner Downstairs"
        command_on:  "echo PWR ON heater_downstairs | write myusername"
        command_off:  "echo PWR OFF heater_downstairs | write myusername"

climate:
 - platform: dualmode_generic
   name: Downstairs Climate
   heater: switch.heater_downstairs
   cooler: switch.ac_downstairs
   target_sensor: sensor.basement_temperature
   min_temp: 32
   max_temp: 80
   min_cycle_duration:
     seconds: 10
   away_temp: 40```
zacs commented 3 years ago

Hmm, I wonder if min_cycle_duration was added after I forked the built-in generic thermostat. I would say I need to rebase to whatever HA's generic is now, but to be honest I don't use the component any more, so I'm not entirely motivated.

PRs are certainly welcome if someone else would like to take a crack at it!

scarpazza commented 3 years ago

Ok. I'm waiting for a couple of Shelly 2.5 relays to replace my Honeywell thermostat. As soon as I have them in place (and I plan to control them with your thermostat) I'll be happy to take a stab. Thanks for your openness.

zacs commented 3 years ago

I imagine it will be straight-forward if you just diff the climate.py in this repo with the generic stat in the main HA repo. I'm happy to CR it.

david-kalbermatten commented 5 months ago

This is by design, the min_cycle_duration is oversteered if the user manually switches the hvac_mode or the temperature.

We may argue whether or not this is sensible but I for one like the thermostat to immediately switch modes on manual request.