Climate change to fan for a while when stop cooling

I have 5 mistubishi climates, controlled with esphome module (with cn105). When i turn off climate from cooling i’ve read that it’s a good idea to put it to fan mode for a while in order to dry internal unit from moisture - this way mold is prevented. Currently i have automation in HA to do that, but i wonder, can this be dome inside esphome module? I did find some actions, ľke “on_state”, “on_control” etc..- but i’m too noob to set this up. What i’d need is a condition like “if climate goes from cool to off change to fan for 5 minutes, then off”.

Can this be done? Doing in side esphome i’d eliminate function to be dependant on HA running…

You probably want a period of time without fan to let the condensate drip off the evaporator coils. If you just run the fan it’s just going to evaporate all that moisture back into the room air… increasing the chance of mold in the room itself as well as possibly making the next conditioning cycle less efficient.

Hm… yeah, i guess you’re right… perhaps 1-2 minutes on ‘off’, then say 5 minutes of ‘fan only’. But, then again, stilľ better to let that moisture into the room than let mold to grow…
But i’d still need an esphome script example or some suggestion how to deal with it.

You could try with something like this (not tested)

on_state:
  - lambda: |-
      static auto previous_mode = x.mode;

      if (previous_mode == CLIMATE_MODE_COOL &&
          x.mode == CLIMATE_MODE_OFF) {
        id(my_script).execute();
      }

      previous_mode = x.mode;

Then make script to do your custom power-down:

script:
  - id: my_script
    then:
      - delay: 2min
      - climate.control:
          id: my_climate
          mode: FAN_ONLY
      - delay: 5min
      - climate.control:
          id: my_climate
          mode: OFF

Yeah! It works! Thanks a million times!
I could writer a script, that’s what i’ve done before, but it’s no way i’ve could put together this lambda, not with my knowledge.

It’s just one minor error: OFF must be in quotes, so:

mode: "OFF"

i remember this from “simple thermostat” card :grin:

Thanks again!

That’s not really logical in my opinion.
Nice you made it work.

Well, supposedly you have to tell to the compiler whether ‘OFF’ is a state you’re defining or this is a word, like it is in our case (cool, warm, off…)