- 
      
- 
        Save arthurlockman/0212864757bbe2b5148610714289b4ba to your computer and use it in GitHub Desktop. 
    HA HVAC Pause Blueprint
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #ver. 1.7.3 | |
| # Added manual switch to tell the thing that you have an ecobee | |
| blueprint: | |
| name: HVAC Pause V1.7.3 | |
| description: Pauses HVAC when windows/doors open; resumes last state once closed | |
| domain: automation | |
| source_url: https://gist.github.com/raffy-ops/2bdf967036d8d274fb1f62572ed5e545 | |
| input: | |
| climate_device: | |
| description: Climate entity used for climate control. | |
| name: Climate Device | |
| selector: | |
| entity: | |
| domain: | |
| - climate | |
| multiple: false | |
| doors_windows: | |
| description: Group of entities that will activate automation. (Assumes 'on' | |
| means 'open') | |
| name: Door and window sensors. | |
| selector: | |
| entity: | |
| domain: | |
| - group | |
| - binary_sensor | |
| multiple: false | |
| pause_delay: | |
| description: Time to wait before pausing the HVAC system. | |
| name: Pause Delay | |
| default: | |
| hours: 0 | |
| minutes: 5 | |
| seconds: 0 | |
| selector: | |
| duration: {} | |
| resume_delay: | |
| description: Time to wait before resuming the HVAC system once doors and windows are closed. | |
| name: Resume Delay | |
| default: | |
| hours: 0 | |
| minutes: 0 | |
| seconds: 30 | |
| selector: | |
| duration: {} | |
| timeout: | |
| description: If set, HVAC will ramain off if door/window is not closed prior to timeout value elapsing. | |
| Set to 0 to disable timeout. | |
| name: Timeout (optional) | |
| default: | |
| hours: 0 | |
| minutes: 0 | |
| seconds: 0 | |
| selector: | |
| duration: {} | |
| action_first: | |
| description: When set to On any defined 'Pause Actions' will occur after the pause delay and prior to | |
| any other actions. | |
| name: Action First | |
| selector: | |
| boolean: | |
| pause_action: | |
| description: Optional additional action to perform when climate entity is paused. | |
| name: Pause Action (Optional) | |
| default: [] | |
| selector: | |
| action: {} | |
| resume_action: | |
| description: Optional additional action to perform when climate entity resumes. | |
| name: Resume Action (Optional) | |
| default: [] | |
| selector: | |
| action: {} | |
| timeout_action: | |
| description: Optional additional action to perform if the timeout value elapses. | |
| name: Timeout Action (Optional) | |
| default: [] | |
| selector: | |
| action: {} | |
| ecobee_remove_hold: | |
| description: Optional additional switch to clear holds for Ecobee devices after resuming. | |
| name: Remove Ecobee Holds (Optional) | |
| selector: | |
| boolean: | |
| variables: | |
| action_first: !input action_first | |
| pause_action: !input pause_action | |
| resume_action: !input resume_action | |
| timeout_action: !input timeout_action | |
| climate_device: !input climate_device | |
| doors_windows: !input doors_windows | |
| timeout: !input timeout | |
| ecobee_remove_hold: !input ecobee_remove_hold | |
| timeout_empty: {'hours':00, 'minutes':00, 'seconds':00} | |
| name_id: '{{ state_attr( climate_device ,''friendly_name'')|slugify ~ ''_snapshot'' }}' | |
| button_entity: '{{ ''button.'' ~ name_id ~ ''_clear_hold'' }}' | |
| mode: single | |
| trigger: | |
| - platform: state | |
| entity_id: !input doors_windows | |
| from: 'off' | |
| to: 'on' | |
| for: !input pause_delay | |
| id: group_open | |
| condition: | |
| - condition: not | |
| conditions: | |
| - condition: state | |
| entity_id: !input climate_device | |
| state: 'off' | |
| action: | |
| - choose: | |
| - conditions: '{{ pause_action is defined and action_first == true }}' | |
| sequence: !input pause_action | |
| - service: scene.create | |
| data: | |
| scene_id: '{{ name_id ~ ''_snapshot'' }}' | |
| snapshot_entities: !input climate_device | |
| - service: climate.set_hvac_mode | |
| target: | |
| entity_id: !input climate_device | |
| data: | |
| hvac_mode: 'off' | |
| - choose: | |
| - conditions: '{{ pause_action is defined and action_first != true }}' | |
| sequence: !input pause_action | |
| - if: | |
| - condition: template | |
| value_template: '{{ timeout != timeout_empty }}' | |
| then: | |
| - wait_for_trigger: | |
| - platform: state | |
| entity_id: !input doors_windows | |
| from: 'on' | |
| to: 'off' | |
| for: !input resume_delay | |
| continue_on_timeout: true | |
| timeout: !input timeout | |
| - if: | |
| - condition: template | |
| value_template: "{{ wait.trigger == none and timeout_action is defined}}" | |
| then: | |
| - sequence: !input timeout_action | |
| - stop: '' | |
| else: | |
| - wait_for_trigger: | |
| - platform: state | |
| entity_id: !input doors_windows | |
| from: 'on' | |
| to: 'off' | |
| for: !input resume_delay | |
| continue_on_timeout: false | |
| - condition: not | |
| conditions: | |
| - condition: state | |
| entity_id: !input climate_device | |
| attribute: fan_mode | |
| state: 'on' | |
| - condition: state | |
| entity_id: !input climate_device | |
| state: 'off' | |
| - service: scene.turn_on | |
| target: | |
| entity_id: '{{ ''scene.'' ~ name_id ~ ''_snapshot'' }}' | |
| - choose: | |
| - conditions: '{{ ecobee_remove_hold == true }}' | |
| sequence: | |
| - delay: | |
| seconds: 1 | |
| - service: button.press | |
| metadata: {} | |
| data: {} | |
| target: | |
| entity_id: '{{ button_entity }}' | |
| - choose: | |
| - conditions: '{{ resume_action is defined }}' | |
| sequence: !input resume_action | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment