Pause climate entity when window/ door open

Simple automation that pauses the climate entity when doors or windows are open and resumes last state once they are closed.

  • Ability to set the time delay that doors/windows must be open or closed prior to automation triggering.
  • Should not affect the system if HVAC is manually turned off prior to opening doors/windows upon reclosure of doors/windows.
  • Should not affect system if HVAC is manually started while windows/doors open upon reclosure of doors/windows.

Needed to work

  • Climate entity
  • Group entity containing binary sensors that you want to pause HVAC system
  • Automation assumes that when the group entity is ‘on’ that HVAC system should be paused.

Information on setting up a group entity: Group - Home Assistant (home-assistant.io)

Updates

1.1

  • Used climate state value instead of Hvac action attribute to determine if automation should resume HVAC.

1.2

  • Re-wrote to include a condition to prevent automation from firing when HVAC is already off.
  • Uses “climate.set_hvac_mode” instead of “climate.turn_off”

Feel free to keep me updated on your experience with this automation if you choose to use it!

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

# ver 1.2

blueprint:
  name: HVAC Pause
  description: Pauses HVAC when windows/doors open; resumes last state once closed
  domain: automation

  input:
    climate_device:
      description: Climate entity used for climate control. 
      name: Climate Device
      selector:
        entity:
          domain: climate

    doors_windows:
      description: Group of entities that will activate automation. (Assumes 'on' means 'open') 
      name: Door and window sensors.
      selector:
        entity:
          domain: group

    pause_delay_mins:
      description: Time to wait before pausing HVAC in minutes.
      name: Pause Delay Minutes
      default: 5
      selector:
        number:
          min: 0
          max: 60
          unit_of_measurement: "Minutes"

    pause_delay_secs:
      description: Time to wait before pausing HVAC in seconds.
      name: Pause Delay Seconds
      default: 0
      selector:
        number:
          min: 0
          max: 59
          unit_of_measurement: "Seconds"

    resume_delay_mins:
      description: Time to wait before resuming HVAC in minutes.
      name: Resume Delay Minutes
      default: 0
      selector:
        number:
          min: 0
          max: 60
          unit_of_measurement: "Minutes"

    resume_delay_secs:
      description: Time to wait before resuming HVAC in seconds.
      name: Resume Delay Seconds
      default: 30
      selector:
        number:
          min: 0
          max: 59
          unit_of_measurement: "Seconds"

mode: single      
trigger:
- platform: state
  entity_id: !input doors_windows
  from: 'off'
  to: 'on'
  for:
    hours: 0
    minutes: !input pause_delay_mins
    seconds: !input pause_delay_secs
  id: group_open
condition:
- condition: not
  conditions:
  - condition: state
    entity_id: !input climate_device
    state: 'off'
action:
- service: scene.create
  data:
    scene_id: climate_snapshot
    snapshot_entities: !input climate_device
- service: climate.set_hvac_mode
  target:
    entity_id: !input climate_device
  data:
    hvac_mode: 'off'
- wait_for_trigger:
  - platform: state
    entity_id: !input doors_windows
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: !input resume_delay_mins
      seconds: !input resume_delay_secs
  continue_on_timeout: false
- scene: scene.climate_snapshot

Thanks, this is excellent.

Is it possible to put in a condition that it only fires if the HVAC is turned on?

My air conditioner can be off but the trigger is still firing.

I wrote this in a way that it uses a snapshot to be able to apply all of the thermostat settings like temperature and hopefully any fan settings without the use of any template sensors as opposed to just a simple ‘on’ or ‘off’ command. Because of this it still needs to create a snapshot even if your HVAC system is already off to prevent it from causing a fault due to a missing snapshot, however when it goes to resume it should simply reapply the ‘off’ settings and not turn anything back on.
Is this actually turning your system back on when it was previously off or is it keeping it off as you had it?

Edit: I might be able to figure something out though. Give me some time.

It’s not turning it back on, it’s just slightly annoying because it will cause my air con to make a ping sound. (Actually it makes three sounds, as if the remote is sending an ‘off’ message three times).

I really do love it though, super clever.

Very good to know! Thank you for making me aware!
There is a simple way for me to make this work without triggering the automation, however I am attempting to come up with something slightly more complex that will allow me to work on implementing a different feature I’ve been trying to tackle.
I will get you set up though, and I would love to hear your feedback once I push the update!

Edit: As for the 3 beeps that is probably caused by this using a scene as opposed to just an ‘on’ or ‘off’ command. So it is probably sending it an ‘on/off’ command, ‘temperature setpoint’ and another command for the mode. I don’t know if all devices would automatically resume to their last state and I have read of issues of some equipment not working with “climate.turn_on” so that’s why I went this route.

1 Like

Awesome, happy to be patient.

Had another weird issue where I went out of sync. Eg., the AC would turn on when the door is opened, and would turn off when the door is closed. Turning it on and off did the trick I think.

When your door is open does the group entity read as ‘on’?
If not, I may know another trick that I will implement either way.

Yep, when a door is opened the group is on.

Any luck with your updates?

Version 1.2 is written to prevent the automation from triggering if the system is already off. Give it a try if you haven’t already