Skip to content

Instantly share code, notes, and snippets.

@Redblockmasteur
Last active February 26, 2024 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Redblockmasteur/d3602266850016123b55d278f95ba8d4 to your computer and use it in GitHub Desktop.
Save Redblockmasteur/d3602266850016123b55d278f95ba8d4 to your computer and use it in GitHub Desktop.
WindowGuard Climate Control
blueprint:
name: WindowGuard Climate Control
description: This blueprint intelligently manages your heating or cooling systems based on window sensor activity, conserving energy by suspending climate control when a window is open and restoring settings after user-defined delays for opening and closing the window.
domain: automation
input:
window_sensor:
name: Window Sensor
description: Select the sensor that monitors your windows. Useful for controlling heating or cooling based on window status.
selector:
entity:
domain: binary_sensor
device_class: window
target_climate:
name: Climate Control Entity
description: Choose the climate control entity to manage, like your heater, AC, or thermostat.
selector:
entity:
domain: climate
window_open_delay:
name: Delay After Window Opens
description: Time to wait after the window opens before suspending climate control.
default: 0
selector:
number:
min: 0
max: 300
unit_of_measurement: seconds
window_close_delay:
name: Delay After Window Closes
description: Time to wait after the window closes before restoring climate control settings.
default: 0
selector:
number:
min: 0
max: 300
unit_of_measurement: seconds
trigger:
- platform: state
entity_id: !input window_sensor
action:
- choose:
- conditions:
- condition: state
entity_id: !input window_sensor
state: "on"
sequence:
- delay: !input window_open_delay
- service: climate.turn_off
target:
entity_id: !input target_climate
- service: scene.create
data:
scene_id: "{{ target_climate | replace('.', '_') }}_snapshot"
snapshot_entities: !input target_climate
- conditions:
- condition: state
entity_id: !input window_sensor
state: "off"
sequence:
- delay: !input window_close_delay
- service: scene.turn_on
target:
entity_id: "scene.{{ target_climate | replace('.', '_') }}_snapshot"
@andreeanae
Copy link

Hi there. I’ve added this blueprint and my thermostats do turn off. They also turn back on but also the ones that were off before the window was open would turn back on. Can you help fix this please? I need those to stay off. Is there also a way to add a delay to the trigger? Thanks much!! Otherwise it’s a great blueprint!

@Redblockmasteur
Copy link
Author

Redblockmasteur commented Feb 26, 2024

Hi @andreeanae, I just added the ability to add a timer between 0s and 300s.

I did not experience any problems with switching on and off with the automation. You can look at the execution history of the automation created by the blueprint to see exactly where this problem is coming from.
However, I ran into a problem with the Rika integration where sometimes the oven would go from off to auto and after 1 minute the oven would go back to off. This 'debouncing' is an integration issue and not related to the blueprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment