Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Lucas-Steinmann/c2c93df7e91b2bfd8920d56f7c38dc40 to your computer and use it in GitHub Desktop.
Save Lucas-Steinmann/c2c93df7e91b2bfd8920d56f7c38dc40 to your computer and use it in GitHub Desktop.
Homeassistant blueprint to switch heater on or off depending on window or door sensor
blueprint:
name: Window controlled HVAC mode
description: Turn off/on thermostat when opening/closing window or door sensor
domain: automation
source_url: https://gist.github.com/Lucas-Steinmann/c2c93df7e91b2bfd8920d56f7c38dc40/edit
input:
heating_target:
name: Heater
selector:
entity:
domain: climate
#entity is not specified cause it should also be possible to use groups
window_entity:
name: Window Sensor
selector:
entity:
variables:
heating_target: !input heating_target
trigger:
platform: state
entity_id: !input window_entity
from: "off"
to: "on"
condition:
- condition: state
entity_id: !input heating_target
attribute: hvac_action
state: heating
action:
- service: climate.set_hvac_mode
entity_id: !input heating_target
data:
hvac_mode: "off"
- wait_for_trigger:
platform: state
entity_id: !input window_entity
from: "on"
to: "off"
- service: climate.set_hvac_mode
entity_id: !input heating_target
data:
hvac_mode: "heat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment