AC drying mode with restore option

Blueprint: AC Drying Mode with Restore Option

Description:
This blueprint automates the drying mode for your air conditioner (AC) when it is turned off from ‘cool’ mode. Once the AC is turned off, it will switch to fan_only mode for a specified drying time. After the drying period, the AC can either restore its previous settings (mode, temperature, and fan) or turn off completely. This prevents moisture buildup inside the unit, which can help reduce odors and prolong the life of your AC.

Features:

  • Automatic Drying: When your AC is turned off from cool mode, it automatically switches to fan_only mode for a user-defined period.
  • Restore Settings: Optionally restore the previous settings (mode, temperature, fan) after the drying period ends.
  • Customizable Drying Time: Set the drying time from 1 second up to 1 hour.

How It Works:

  1. Trigger: The blueprint is triggered when the AC changes from cool mode to off.
  2. Action:
    • Switch the AC to fan_only mode for a specified drying time.
    • If restore_last_state is enabled, it restores the previous settings after the drying time.
    • Finally, the AC is turned off unless it was manually interrupted.

Inputs:

  • Climate Entity: The climate entity for your AC (e.g., climate.living_room_ac).
  • Drying Time: The duration (in seconds) for how long the AC should run in fan_only mode before turning off. Defaults to 600 seconds (10 minutes).
  • Restore Last State: Boolean option to restore the AC’s previous settings after the drying period. Defaults to true.

Blueprint YAML:

blueprint:
  name: AC Drying Mode with Restore Option
  description: >
    This blueprint automates the drying mode for your AC. If the AC is turned off from 'cool' mode, it will switch to 'fan_only' mode for a specified drying time and then optionally restore the previous settings before turning off unless interrupted.
  domain: automation
  input:
    climate_entity:
      name: Climate Entity
      description: The climate entity for your AC (e.g., climate.my_ac_name).
      selector:
        entity:
          domain: climate
    drying_time:
      name: Drying Time
      description: Time in seconds to run the AC in fan_only mode before restoring previous settings and turning it off.
      default: 600
      selector:
        number:
          min: 1
          max: 3600
          unit_of_measurement: seconds
          mode: box
    restore_last_state:
      name: Restore Last State
      description: Choose whether to restore the AC's last state (mode, temperature, fan) after the drying period.
      default: true
      selector:
        boolean:

trigger:
  - platform: state
    entity_id: !input climate_entity
    to: 'off'
    from: 'cool'

condition: []

action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 500

  - variables:
      climate_entity: !input climate_entity
      restore_last_state: !input restore_last_state
      previous_hvac_mode: "{{ states(climate_entity) }}"
      previous_temperature: "{{ state_attr(climate_entity, 'temperature') }}"
      previous_fan_mode: "{{ state_attr(climate_entity, 'fan_mode') }}"

  - service: climate.set_hvac_mode
    data:
      hvac_mode: fan_only
    target:
      entity_id: !input climate_entity

  - wait_for_trigger:
      - platform: state
        entity_id: !input climate_entity
        from: 'fan_only'
    timeout: !input drying_time
    continue_on_timeout: true

  - choose:
      - conditions:
          - condition: state
            entity_id: !input climate_entity
            state: 'fan_only'
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ restore_last_state }}"
                sequence:
                  - service: climate.set_temperature
                    data:
                      temperature: "{{ previous_temperature }}"
                    target:
                      entity_id: !input climate_entity

                  - service: climate.set_fan_mode
                    data:
                      fan_mode: "{{ previous_fan_mode }}"
                    target:
                      entity_id: !input climate_entity

                  - service: climate.set_hvac_mode
                    data:
                      hvac_mode: "{{ previous_hvac_mode }}"
                    target:
                      entity_id: !input climate_entity

          - delay: 00:00:01

          - service: climate.turn_off
            target:
              entity_id: !input climate_entity

mode: restart

How to Use:

  • Manually:
  1. Copy the YAML code into a new automation blueprint in your Home Assistant instance.
  2. Configure the inputs according to your setup.
  3. Save and enjoy an automatically maintained AC with drying functionality.
  • Or simply import it:
    Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Notes:

  • Ensure that your climate entity supports fan_only mode for this blueprint to function correctly.
  • The blueprint has been set to restart mode to handle cases where the automation might be triggered multiple times.

Download & Feedback:

Feel free to download, modify, and share feedback on this blueprint. If you encounter any issues or have suggestions for improvements, please comment below!

1 Like

Hi jrbarna,

Welcome to the HA Forum.
This looks very interesting.
Thanks for your contribution to the community!