Skip to content

Instantly share code, notes, and snippets.

@rhl2401
Forked from AlexanderBabel/smart-thermostat.yaml
Last active January 17, 2024 10:48
Show Gist options
  • Save rhl2401/f15d67263a949bbd5d6e374a3815a60d to your computer and use it in GitHub Desktop.
Save rhl2401/f15d67263a949bbd5d6e374a3815a60d to your computer and use it in GitHub Desktop.
blueprint:
name: Smart Thermostat off/heat (LUMI/Aqara)
description: 'Forked from: https://community.home-assistant.io/t/smart-thermostat-2-0-blueprint/478348
and made compatible with thermostats supporting the states "off" and "heat" instead of "off" and "auto" in the
original blueprint.'
domain: automation
source_url: https://gist.github.com/rhl2401/f15d67263a949bbd5d6e374a3815a60d
input:
window_sensor:
name: Window / Door Sensor Group
selector:
entity:
domain: binary_sensor
multiple: false
window_delay:
name: Window / Door Sensor Delay
description: Time the sensor needs to stay the same after change to trigger
the automation. This is done to avoid retriggering. (Default = 5s)
default: 5
selector:
number:
mode: box
min: 0.0
max: 3600.0
unit_of_measurement: seconds
step: 1.0
weather:
name: Weather
description: Specify your weather to get the current outside temperature from.
selector:
entity:
domain: weather
multiple: false
wintermode:
name: Wintermode
description: The ouside temperature needs to be below this to activate wintermode.
(Default = 16°C)
default: 16
selector:
number:
step: 0.5
min: 0.0
max: 150.0
unit_of_measurement: °C or °F
mode: slider
wintermode_delay:
name: Wintermode Delay
description: Time the outside temperature neeeds to stay above the wintermode
temperature to turn the heating off.
default: 30
selector:
number:
mode: box
min: 1.0
max: 86400.0
unit_of_measurement: minutes
step: 1.0
on_mode:
name: ON Mode Name
description: The name of the state for the thermostat to be on. Usually: auto, LUMI/Aqara: heat
default: 'auto'
off_mode:
name: OFF Mode Name
description: The name of the state for the thermostat to be off.
default: 'off'
thermostat:
name: Thermostat
selector:
entity:
domain: climate
multiple: false
trigger:
- platform: state
entity_id: !input window_sensor
to: 'off'
from: 'on'
for: !input window_delay
- platform: state
entity_id: !input window_sensor
to: 'on'
from: 'off'
for: !input window_delay
- platform: numeric_state
entity_id: !input weather
attribute: temperature
below: !input wintermode
for: !input wintermode_delay
- platform: numeric_state
entity_id: !input weather
attribute: temperature
above: !input wintermode
for: !input wintermode_delay
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: !input window_sensor
state: 'off'
- condition: numeric_state
entity_id: !input weather
attribute: temperature
below: !input wintermode
sequence:
- service: climate.set_hvac_mode
data:
hvac_mode: !input on_mode
entity_id: !input thermostat
- conditions:
- condition: or
conditions:
- condition: state
entity_id: !input window_sensor
state: 'on'
- condition: numeric_state
entity_id: !input weather
attribute: temperature
above: !input wintermode
sequence:
- service: climate.set_hvac_mode
data:
hvac_mode: !input off_mode
entity_id: !input thermostat
default: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment