Skip to content

Instantly share code, notes, and snippets.

@danieleparazza
Forked from raffy-ops/hvac_pause.yaml
Last active January 6, 2025 18:33

Revisions

  1. danieleparazza revised this gist Aug 20, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #ver. 1.7
    #ver. 1.7.1
    blueprint:
    name: HVAC Pause V1.7
    name: HVAC Pause V1.7.1
    description: Pauses HVAC when windows/doors open; resumes last state once closed
    domain: automation
    source_url: https://gist.github.com/raffy-ops/2bdf967036d8d274fb1f62572ed5e545
  2. danieleparazza revised this gist Aug 20, 2024. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -129,10 +129,16 @@ action:
    for: !input resume_delay
    continue_on_timeout: true
    timeout: !input timeout
    - choose:
    - conditions: '{{ wait.trigger == none and timeout_action is defined }}'
    sequence: !input timeout_action
    - stop: ''
    - if:
    - condition: template
    value_template: "{{ wait.trigger == none }}"
    then:
    - if:
    - condition: template
    value_template: "{{ timeout_action is defined }}"
    then:
    - sequence: !input timeout_action
    - stop: ''
    else:
    - wait_for_trigger:
    - platform: state
  3. @raffy-ops raffy-ops revised this gist Jan 14, 2024. 1 changed file with 81 additions and 39 deletions.
    120 changes: 81 additions & 39 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,70 +1,93 @@
    # ver 1.6.1
    # created by nickraffy

    #ver. 1.7
    blueprint:
    name: HVAC Pause V1.6.1
    name: HVAC Pause V1.7
    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.
    description: Climate entity used for climate control.
    name: Climate Device
    selector:
    entity:
    domain: climate

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

    - group
    - binary_sensor
    multiple: false
    pause_delay:
    description: Time to wait before pausing the HVAC system.
    name: Pause Delay
    default:
    hours: 00
    minutes: 05
    seconds: 00
    hours: 0
    minutes: 5
    seconds: 0
    selector:
    duration:

    duration: {}
    resume_delay:
    description: Time to wait before resuming the HVAC system.
    name: Resume Delay
    default:
    hours: 00
    minutes: 00
    hours: 0
    minutes: 0
    seconds: 30
    selector:
    duration:

    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:

    action: {}
    resume_action:
    description: Optional additional action to perform when climate entity resumes.
    name: Resume Action (Optional)
    default: []
    selector:
    action:

    action: {}
    timeout_action:
    description: Optional additional action to perform if the timeout value elapses.
    name: Timeout Action (Optional)
    default: []
    selector:
    action: {}
    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
    name_id: "{{ state_attr( climate_device ,'friendly_name')|lower |replace(' ','_') | regex_replace(find='[^\\w]', replace='') ~ '_snapshot' }}"
    doors_windows: !input doors_windows
    timeout: !input timeout
    timeout_empty: {'hours':00, 'minutes':00, 'seconds':00}
    name_id: '{{ state_attr( climate_device ,''friendly_name'')|lower |replace('' '',''_'')
    | regex_replace(find=''[^\w]'', replace='''') ~ ''_snapshot'' }}'

    mode: single
    mode: single
    trigger:
    - platform: state
    entity_id: !input doors_windows
    @@ -79,26 +102,45 @@ condition:
    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 }}"
    scene_id: '{{ name_id }}'
    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 }}'
    - conditions: '{{ pause_action is defined and action_first != true }}'
    sequence: !input pause_action

    - wait_for_trigger:
    - platform: state
    entity_id: !input doors_windows
    from: 'on'
    to: 'off'
    for: !input resume_delay
    continue_on_timeout: false
    - 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
    - choose:
    - conditions: '{{ wait.trigger == none and timeout_action is defined }}'
    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
    @@ -110,7 +152,7 @@ action:
    state: 'off'
    - service: scene.turn_on
    target:
    entity_id: "{{ 'scene.' ~ name_id }}"
    entity_id: '{{ ''scene.'' ~ name_id }}'
    - choose:
    - conditions: '{{ resume_action is defined }}'
    sequence: !input resume_action
    sequence: !input resume_action
  4. @raffy-ops raffy-ops revised this gist Dec 30, 2023. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    # ver 1.6
    # ver 1.6.1
    # created by nickraffy

    blueprint:
    name: HVAC Pause V1.6
    name: HVAC Pause V1.6.1
    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:
  5. @raffy-ops raffy-ops revised this gist Dec 29, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -103,9 +103,9 @@ action:
    entity_id: !input climate_device
    attribute: fan_mode
    state: 'on'
    - condition: state
    entity_id: !input climate_device
    state: 'off'
    - condition: state
    entity_id: !input climate_device
    state: 'off'
    - service: scene.turn_on
    target:
    entity_id: "{{ 'scene.' ~ name_id }}"
  6. @raffy-ops raffy-ops revised this gist Dec 29, 2023. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # ver 1.5
    # ver 1.6

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

    @@ -97,6 +97,15 @@ action:
    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 }}"
  7. @raffy-ops raffy-ops revised this gist Jun 27, 2023. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # ver 1.4
    # ver 1.5

    blueprint:
    name: HVAC Pause
    @@ -59,6 +59,8 @@ blueprint:
    variables:
    pause_action: !input pause_action
    resume_action: !input resume_action
    climate_device: !input climate_device
    name_id: "{{ state_attr( climate_device ,'friendly_name')|lower |replace(' ','_') | regex_replace(find='[^\\w]', replace='') ~ '_snapshot' }}"

    mode: single
    trigger:
    @@ -77,7 +79,7 @@ condition:
    action:
    - service: scene.create
    data:
    scene_id: climate_snapshot
    scene_id: "{{ name_id }}"
    snapshot_entities: !input climate_device
    - service: climate.set_hvac_mode
    target:
    @@ -95,7 +97,9 @@ action:
    to: 'off'
    for: !input resume_delay
    continue_on_timeout: false
    - scene: scene.climate_snapshot
    - service: scene.turn_on
    target:
    entity_id: "{{ 'scene.' ~ name_id }}"
    - choose:
    - conditions: '{{ resume_action is defined }}'
    sequence: !input resume_action
  8. @raffy-ops raffy-ops revised this gist Feb 9, 2023. 1 changed file with 27 additions and 2 deletions.
    29 changes: 27 additions & 2 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # ver 1.3
    # ver 1.4

    blueprint:
    name: HVAC Pause
    @@ -42,6 +42,24 @@ blueprint:
    selector:
    duration:

    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:

    variables:
    pause_action: !input pause_action
    resume_action: !input resume_action

    mode: single
    trigger:
    - platform: state
    @@ -66,11 +84,18 @@ action:
    entity_id: !input climate_device
    data:
    hvac_mode: 'off'
    - choose:
    - conditions: '{{ pause_action is defined }}'
    sequence: !input pause_action

    - wait_for_trigger:
    - platform: state
    entity_id: !input doors_windows
    from: 'on'
    to: 'off'
    for: !input resume_delay
    continue_on_timeout: false
    - scene: scene.climate_snapshot
    - scene: scene.climate_snapshot
    - choose:
    - conditions: '{{ resume_action is defined }}'
    sequence: !input resume_action
  9. @raffy-ops raffy-ops revised this gist Dec 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # ver 1.3

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

  10. @raffy-ops raffy-ops revised this gist Dec 17, 2022. 1 changed file with 23 additions and 47 deletions.
    70 changes: 23 additions & 47 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # ver 1.2
    # ver 1.3

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

    @@ -18,58 +18,37 @@ blueprint:
    name: Door and window sensors.
    selector:
    entity:
    domain: group
    domain:
    - group
    - binary_sensor

    pause_delay_mins:
    description: Time to wait before pausing HVAC in minutes.
    name: Pause Delay Minutes
    default: 5
    pause_delay:
    description: Time to wait before pausing the HVAC system.
    name: Pause Delay
    default:
    hours: 00
    minutes: 05
    seconds: 00
    selector:
    number:
    min: 0
    max: 60
    unit_of_measurement: "Minutes"
    duration:

    pause_delay_secs:
    description: Time to wait before pausing HVAC in seconds.
    name: Pause Delay Seconds
    default: 0
    resume_delay:
    description: Time to wait before resuming the HVAC system.
    name: Resume Delay
    default:
    hours: 00
    minutes: 00
    seconds: 30
    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"
    duration:

    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
    for: !input pause_delay
    id: group_open
    condition:
    - condition: not
    @@ -92,9 +71,6 @@ action:
    entity_id: !input doors_windows
    from: 'on'
    to: 'off'
    for:
    hours: 0
    minutes: !input resume_delay_mins
    seconds: !input resume_delay_secs
    for: !input resume_delay
    continue_on_timeout: false
    - scene: scene.climate_snapshot
  11. @raffy-ops raffy-ops revised this gist Jan 4, 2022. 1 changed file with 29 additions and 36 deletions.
    65 changes: 29 additions & 36 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # ver 1.1
    # ver 1.2

    blueprint:
    name: HVAC Pause
    @@ -59,7 +59,8 @@ blueprint:
    min: 0
    max: 59
    unit_of_measurement: "Seconds"


    mode: single
    trigger:
    - platform: state
    entity_id: !input doors_windows
    @@ -70,38 +71,30 @@ trigger:
    minutes: !input pause_delay_mins
    seconds: !input pause_delay_secs
    id: group_open
    - platform: state
    entity_id: !input doors_windows
    id: group_close
    from: 'on'
    to: 'off'
    for:
    hours: 0
    minutes: !input resume_delay_mins
    seconds: !input resume_delay_mins
    condition: []
    condition:
    - condition: not
    conditions:
    - condition: state
    entity_id: !input climate_device
    state: 'off'
    action:
    - choose:
    - conditions:
    - condition: trigger
    id: group_open
    sequence:
    - service: scene.create
    data:
    snapshot_entities: !input climate_device
    scene_id: climate_snapshot
    - service: climate.turn_off
    target:
    entity_id: !input climate_device
    - conditions:
    - condition: and
    conditions:
    - condition: state
    entity_id: !input climate_device
    state: 'off'
    - condition: trigger
    id: group_close
    sequence:
    - service: scene.turn_on
    target:
    entity_id: scene.climate_snapshot
    - 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
  12. @raffy-ops raffy-ops revised this gist Dec 31, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #ver 1.1
    # ver 1.1

    blueprint:
    name: HVAC Pause
  13. @raffy-ops raffy-ops revised this gist Dec 31, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #ver 1.1

    blueprint:
    name: HVAC Pause
    description: Pauses HVAC when windows/doors open; resumes last state once closed
  14. @raffy-ops raffy-ops revised this gist Dec 31, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -96,8 +96,7 @@ action:
    conditions:
    - condition: state
    entity_id: !input climate_device
    attribute: hvac_action
    state: idle
    state: 'off'
    - condition: trigger
    id: group_close
    sequence:
  15. @raffy-ops raffy-ops revised this gist Dec 31, 2021. 1 changed file with 13 additions and 67 deletions.
    80 changes: 13 additions & 67 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -4,21 +4,6 @@ blueprint:
    domain: automation

    input:

    paused_state:
    description: Paused status input_select.
    name: Paused State Input Select
    selector:
    entity:
    domain: input_select

    hvac_mode:
    description: HVAC mode input_select. (Stores HVAC mode while paused)
    name: HVAC Input Select
    selector:
    entity:
    domain: input_select

    climate_device:
    description: Climate entity used for climate control.
    name: Climate Device
    @@ -40,7 +25,7 @@ blueprint:
    selector:
    number:
    min: 0
    max: 120
    max: 60
    unit_of_measurement: "Minutes"

    pause_delay_secs:
    @@ -60,7 +45,7 @@ blueprint:
    selector:
    number:
    min: 0
    max: 120
    max: 60
    unit_of_measurement: "Minutes"

    resume_delay_secs:
    @@ -73,15 +58,7 @@ blueprint:
    max: 59
    unit_of_measurement: "Seconds"

    # Translates inputs to variables for use in templates.
    variables:
    climate_device: !input climate_device
    hvac_mode: !input hvac_mode
    paused_state: !input paused_state

    mode: single
    trigger:
    # Detects if group entity is on
    - platform: state
    entity_id: !input doors_windows
    from: 'off'
    @@ -91,7 +68,6 @@ trigger:
    minutes: !input pause_delay_mins
    seconds: !input pause_delay_secs
    id: group_open
    # Detects if group entity is 'off'
    - platform: state
    entity_id: !input doors_windows
    id: group_close
    @@ -100,61 +76,31 @@ trigger:
    for:
    hours: 0
    minutes: !input resume_delay_mins
    seconds: !input resume_delay_secs
    seconds: !input resume_delay_mins
    condition: []
    action:
    # Checks if HVAC paused input_select is in 'run', the group entity is 'on'
    # and that the climate entity is not 'off'
    - choose:
    - conditions:
    - condition: and
    conditions:
    - condition: state
    entity_id: !input paused_state
    state: run
    - condition: trigger
    id: group_open
    - condition: not
    conditions:
    - condition: state
    entity_id: !input climate_device
    state: 'off'
    # Sets the HVAC input_select to current state of climate device
    - condition: trigger
    id: group_open
    sequence:
    - service: input_select.select_option
    target:
    entity_id: !input hvac_mode
    - service: scene.create
    data:
    option: '{{ states(climate_device) }}'
    # Sets the climate device to 'off'
    snapshot_entities: !input climate_device
    scene_id: climate_snapshot
    - service: climate.turn_off
    target:
    entity_id: !input climate_device
    # Sets the HVAC paused input_select to 'paused'
    - service: input_select.select_option
    target:
    entity_id: !input paused_state
    data:
    option: paused
    # Checks if HVAC paused input_select is 'paused' and the group entity is 'off'
    - conditions:
    - condition: and
    conditions:
    - condition: state
    entity_id: !input paused_state
    state: paused
    entity_id: !input climate_device
    attribute: hvac_action
    state: idle
    - condition: trigger
    id: group_close
    # Sets the climate device to current state of HVAC input_select and
    # sets the HVAC paused input_select to 'run'
    sequence:
    - service: climate.set_hvac_mode
    - service: scene.turn_on
    target:
    entity_id: !input climate_device
    data:
    hvac_mode: '{{ states(hvac_mode) }}'
    - service: input_select.select_option
    target:
    entity_id: !input paused_state
    data:
    option: run
    entity_id: scene.climate_snapshot
  16. @raffy-ops raffy-ops created this gist Dec 31, 2021.
    160 changes: 160 additions & 0 deletions hvac_pause.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,160 @@
    blueprint:
    name: HVAC Pause
    description: Pauses HVAC when windows/doors open; resumes last state once closed
    domain: automation

    input:

    paused_state:
    description: Paused status input_select.
    name: Paused State Input Select
    selector:
    entity:
    domain: input_select

    hvac_mode:
    description: HVAC mode input_select. (Stores HVAC mode while paused)
    name: HVAC Input Select
    selector:
    entity:
    domain: input_select

    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: 120
    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: 120
    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"

    # Translates inputs to variables for use in templates.
    variables:
    climate_device: !input climate_device
    hvac_mode: !input hvac_mode
    paused_state: !input paused_state

    mode: single
    trigger:
    # Detects if group entity is on
    - 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
    # Detects if group entity is 'off'
    - platform: state
    entity_id: !input doors_windows
    id: group_close
    from: 'on'
    to: 'off'
    for:
    hours: 0
    minutes: !input resume_delay_mins
    seconds: !input resume_delay_secs
    condition: []
    action:
    # Checks if HVAC paused input_select is in 'run', the group entity is 'on'
    # and that the climate entity is not 'off'
    - choose:
    - conditions:
    - condition: and
    conditions:
    - condition: state
    entity_id: !input paused_state
    state: run
    - condition: trigger
    id: group_open
    - condition: not
    conditions:
    - condition: state
    entity_id: !input climate_device
    state: 'off'
    # Sets the HVAC input_select to current state of climate device
    sequence:
    - service: input_select.select_option
    target:
    entity_id: !input hvac_mode
    data:
    option: '{{ states(climate_device) }}'
    # Sets the climate device to 'off'
    - service: climate.turn_off
    target:
    entity_id: !input climate_device
    # Sets the HVAC paused input_select to 'paused'
    - service: input_select.select_option
    target:
    entity_id: !input paused_state
    data:
    option: paused
    # Checks if HVAC paused input_select is 'paused' and the group entity is 'off'
    - conditions:
    - condition: and
    conditions:
    - condition: state
    entity_id: !input paused_state
    state: paused
    - condition: trigger
    id: group_close
    # Sets the climate device to current state of HVAC input_select and
    # sets the HVAC paused input_select to 'run'
    sequence:
    - service: climate.set_hvac_mode
    target:
    entity_id: !input climate_device
    data:
    hvac_mode: '{{ states(hvac_mode) }}'
    - service: input_select.select_option
    target:
    entity_id: !input paused_state
    data:
    option: run