Generic Thermostat turning off without reaching target temperature

climate:
  - platform: generic_thermostat
    name: Cpu_temp_control
    heater: switch.sonoff_100342342_2
    target_sensor: sensor.cpu_temp
    min_temp: 35
    max_temp: 55
    ac_mode: true
    target_temp: 35
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "off"
    precision: 0.1

I have set up a generic thermostat to control rpi4’s temperature using an external 12V fan, controlled by a sonoff dual R3. As you can see, it turns off the fan without reaching the target temperature, which I deliberately left too low.

You don’t need a keep alive value for your switch. It is only required for heaters and A/C units that shut off if they don’t receive a signal from their remote for a while. Also when keep_alive is set the min_cycle_duration option will be ignored.

1 Like

this is how it should be?

climate:
  - platform: generic_thermostat
    name: Cpu_temp_control
    heater: switch.sonoff_100342342_2
    target_sensor: sensor.cpu_temp
    min_temp: 35
    max_temp: 55
    ac_mode: true
    target_temp: 35
    cold_tolerance: 0.3
    hot_tolerance: 0
    initial_hvac_mode: "cool"
    precision: 0.1

Only if you want to destroy your switch’s relay contacts. Now you don’t have a min_cycle_duration defined.

How long it should be?

3 to 5 minutes should be good for your application.

1 Like
climate:
  - platform: generic_thermostat
    name: Cpu_temp_control
    heater: switch.sonoff_100342342_2
    target_sensor: sensor.cpu_temp
    min_temp: 35
    max_temp: 55
    ac_mode: true
    target_temp: 35
    cold_tolerance: 0.3
    hot_tolerance: 0
    initial_hvac_mode: "cool"
    precision: 0.1
    min_cycle_duration:
      minutes: 5

Final configuration.