Thermostat for the cellar

Hi all!
I want to make a thermostat for the cellar.
Heating is expected.
Cooling (fan from outside).
There are supposed to be 2 temperature sensors: in the cellar and outside.
How to set limits in a thermostat:
If heating/cooling or cooling is turned on and the outside temperature is higher than the cellar temperature, then do not cool.
Is it possible to create such a catch in on_state: ?

Uh ya… you are aware esphome has a website with all the documentation you will need. Its very important that you go through the different options available becauase theThermostat component is different from the Climate component and different from the bang-bang component for example. They all do similar things but some are more like an old school thermostat where you set the on/off temps for heat and a/c. Others are much more advanced and you can configure them like crazy and control other devices like humidifiers/dehumidifiers or HVAC valves to open and close certain vents in your house if you wanted to have different settings for the 3rd floor where people dont spend time in. Its important you understand the one you choose.

1 Like

Below is an example of my code.
How do I change the value of fan_with_cooling ?
for example if Pogreb_Temperature > Pogreb_outdoor_temperature then fan_with_cooling =True
else fan_with_cooling = false


  • platform: bme280
    address: 0x76
    name: “Pogreb_Temperature”
    id: Pogreb_Temperature
    oversampling: 16x
    name: “Pogreb_Pressure”
    name: “Pogreb_Humidity”
    id: Pogreb_Humidity
    update_interval: 60s

  • platform: dallasng
    address: 0x970300a27929cc28
    resolution: 12
    name: “Pogreb_outdoor_temperature”
    id: Pogreb_outdoor_temperature

Example dual-point configuration entry


  • platform: thermostat
    name: “Термостат погреба”
    id: th_pogreb
    min_temperature: -2.0
    max_temperature: 10.0
    sensor: Pogreb_Temperature
    min_cooling_off_time: 30s
    min_cooling_run_time: 30s
    min_heating_off_time: 30s
    min_heating_run_time: 30s
    min_fanning_off_time: 30s
    min_fanning_run_time: 30s
    min_idle_time: 3s
    #fan_with_cooling : True


    • logger.log: “State updated!”
    • lambda: |-
      ESP_LOGD(“on_state”,“on_state” );


    • lambda: ESP_LOGD(“cool_action”,“Cooling”);


    • switch.turn_on: pogreb_heater


    • switch.turn_off: pogreb_cooler
    • switch.turn_off: pogreb_heater


    • switch.turn_on: pogreb_cooler

    on_boot_restore_from: memory

Welcome @RustamDzh.

Please take a moment to figure out how to format your yaml properly for the forum. It really does help us help you. The way is here. Cheers.

1 Like

Your asking how to change the value of “fan_with_cooling” but you didnt include your config that has that part. To change the value or state of something, the method depends on what it is. Its a different process if fan_with_cooling is a binary_sensor, gpio switch, button, a template… we dont know what it is.

Besides that, have you looked at tbe documentation? It tells you how in there.

Get yourself familiar with automations and templates. This is how you make the things you want happen.

When switch2 is pressed, what is supposed to happen?
When binary_sensor Door changes state to Open, what happens?
When sensor Living Room temp. Goes above 75, what happens?

Automations and templates are where you learn how to make the these things happen or more specifically its how you learn how to write the instructions for what happens.