Limiting the operating time of the air conditioner (Thermostat Climate Controller)

Hi guys!
I have an air conditioner and would like to limit the amount of time it runs. How can i do this?
Esphome has a min_cooling_off_time setting and I would like a similar one, for example, max_cooling_on_time
Thx!

You can implement your own timers using scripts. If you want to implement a max cool time, something like:

  1. Create a climate.on_control: action block in your Thermostat Climate Controller component
  2. First thing in that block, stop your timer script.
  3. Then test to see if cooling mode activated (there is an example in Climate Core of the lambda)
  4. Start the timer script

In the timer script, simply put in a suitable delay, then an action to turn of the A/C.

Delay is non blocking in ESPHome so other stuff will continue to happen while the timer script is running.

Thanks! I’ll try to do it using timers.