Home Assistant

Window-open climate pause

When a door or window contact stays open past a debounce, save the HVAC mode and setpoint and turn climate off; when it closes stably, restore. Helpers make it restart-safe.

Difficulty · BeginnerSetup · 20–45 minutesHA · current stable (blueprint)
Get the pack · from $19Have us set it up

Some hardware links on this page are affiliate links. As an Amazon Associate I earn from qualifying purchases. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.

An open window plus a running heat pump is a good way to condition the outdoors. This workflow waits until a contact has been open long enough to mean it, stores the current HVAC mode and setpoint in helpers, and turns climate off. When the contact has been closed long enough to mean it, it restores what it saved. A reboot in the middle does not forget the snapshot.

Entity ids are blueprint inputs. Do not copy a live thermostat name into a published automation.

What problem it solves

You want heat or cool to pause while a door or window is actually left open — without killing climate on a two-second latch rattle, and without leaving the system off after you close it because Home Assistant restarted.

How it works

  1. Open debounce — contact goes on and stays on for the open delay (default about a minute). A slam-and-shut does nothing.
  2. Snapshot — write current hvac_mode and temperature setpoint into input_text / input_number helpers, then set a boolean paused_by_window. Helpers survive a restart; a wait_for_trigger variable does not.
  3. Climate off — climate.turn_off (or hvac_mode: off) on the thermostat you picked.
  4. Close debounce — contact goes off and stays off for the close delay so a bouncing reed does not restore mid-swing.
  5. Restore — if paused_by_window is still on, set the saved mode and setpoint, then clear the boolean. If HA restarted while the window was open, the boolean is still on and a later close still restores. If HA restarted while already restored, the boolean is off and nothing is applied.

Optional: a notify when pause or restore fires, using the same helper so you do not get a page on every bounce.

Hardware notes

  • Contact. Any binary sensor that is on when the opening is open. Multiple windows can feed a group binary sensor; the blueprint still takes one entity.
  • Climate. A single HA climate entity with a mode and a setpoint. If heat and cool use different setpoints, the pack stores both numbers.
  • No extra hub. If you already have contacts and a thermostat in HA, this is YAML and helpers only.

Snippet

The pack ships a blueprint. Inputs replace real entity ids:

trigger:
  - platform: state
    entity_id: !input window_contact
    to: "on"
    for:
      seconds: !input open_debounce
    id: opened
  - platform: state
    entity_id: !input window_contact
    to: "off"
    for:
      seconds: !input close_debounce
    id: closed
action:
  - choose:
      - conditions:
          - condition: trigger
            id: opened
        sequence:
          - service: input_text.set_value
            target:
              entity_id: !input saved_hvac_mode
            data:
              value: "{{ states(window_climate) }}"
          - service: climate.turn_off
            target:
              entity_id: !input climate_entity
          - service: input_boolean.turn_on
            target:
              entity_id: !input paused_helper
      - conditions:
          - condition: trigger
            id: closed
          - condition: state
            entity_id: !input paused_helper
            state: "on"
        sequence:
          - service: climate.set_hvac_mode
            target:
              entity_id: !input climate_entity
            data:
              hvac_mode: "{{ states(saved_mode) }}"
          # setpoint restore + clear helper: full blueprint in the pack

Setup outline

  1. Pick the contact (or group) and the climate entity.
  2. Create the three helpers (saved mode, saved setpoint, paused boolean) or let the pack’s helpers do it.
  3. Import the blueprint, fill the !input slots, set open/close debounce.
  4. Test: open the window, wait the delay → climate off and helpers filled; restart HA while still open → helpers unchanged; close and wait → mode and setpoint return; close without a prior pause → no change.

Troubleshooting

  • Climate dies on a quick open. Open debounce is too short. Raise it; a minute is a better default than five seconds.
  • Never restores. paused_by_window never turned on (open debounce not met) or the restore action is writing a mode the thermostat rejects (heat_cool vs heat). Check the saved text helper after a pause.
  • Restores the wrong setpoint after a reboot. You snapshotted into automation variables instead of helpers. Use the pack helpers; they are the restart-safe part.
  • Two windows, one thermostat. OR them in a group. Pause while any is open; restore only when the group is closed for the debounce.

Credits

Based on the community blueprint Window open → climate off, window closed (stable) → restore. This write-up is an original overview of the helper-backed, restart-safe pattern.

Changelog

v1.0 · Oct 15, 2026: First publish.