Hello,
!! UPDATE: This blueprint now supports window sensors and helpers for temperature and times as I now use this not only at home but also for room lettings !!
Unfortunately, this is not compatible with the old first version!
The idea came that we have each radiator in the house fitted with a TRV (Thermostatic Radiator Valve).
Moes TRV
Also the basis is that we don’t want any room to cool down too much in order for the room not to lose too much heat but also for the heating to be efficient and faster spooling up.
Each room is also equipped with a Sonoff or Ikea Tradfri motion sensor to control the lights to some extend and we add the heating purpose to that here
So there are several factors considered in my motion controlled room heating.
The Base (ECO) temperature in my case 18 C, occupied room temperature 21 C or some even 22 C. The time of the day the system should work within and heat up the room as we don’t want it boiling hot at night, but also how long the heating should run for after last motion detected e.g.10min but it depends as with the TV room we don’t necessarily move a lot while watching a movie.
Problems? Yes, pets moving around the rooms. Solution don’t run the system at night and leave doors closed
blueprint:
name: Motion-Activated Heating
description: Turn up heating when motion is detected.
domain: automation
# source_url: https://community.home-assistant.io/t/motion-controlled-room-eco-heating/291322
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
climate_target:
name: Climate Device
selector:
target:
eco_temperature:
name: Eco Temperature
description: Fallback temperature when no motion is detected
selector:
entity:
domain: input_number
comfort_temperature:
name: Comfort Temperature
description: Comfort temperature when motion is detected
selector:
entity:
domain: input_number
time_after:
name: Time After
description: Point from which the motion will control eco heating
selector:
entity:
domain: input_datetime
time_before:
name: Time Before
description: Point from which the motion will not trigger eco heating
selector:
entity:
domain: input_datetime
no_motion_wait:
name: Hold time
description: Time to leave the heating in comfort for after last motion is detected.
default: 600
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
window_sensors:
name: Window Sensors
description: List of window sensor to shut down heating when open
default: []
selector:
entity:
# multiple: true
domain: binary_sensor
device_class: opening
variables:
input_eco: !input eco_temperature
input_comfort: !input comfort_temperature
# If motion or window open is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input motion_entity
- platform: state
entity_id: !input window_sensors
action:
- if:
- condition: state
entity_id: !input window_sensors
state: "on"
then:
- service: climate.set_temperature
data:
temperature: 5
target: !input climate_target
else:
- if:
- condition: time
after: !input time_after
before: !input time_before
then:
- if:
- condition: state
entity_id: !input motion_entity
state: "on"
then:
- service: climate.set_temperature
data:
temperature: "{{ states[input_comfort].state | int }}"
hvac_mode: heat
target: !input climate_target
else:
- delay: !input no_motion_wait
- service: climate.set_temperature
data:
hvac_mode: heat
temperature: "{{ states[input_eco].state | int }}"
target: !input climate_target
else:
- service: climate.set_temperature
data:
hvac_mode: heat
temperature: "{{ states[input_eco].state | int }}"
target: !input climate_target
I have also an automation running to lower the night temperature by a further degree which gets overridden by first movements in a room (or another automation to increase temp in morning).
!! With this new script it’s not needed anymore !!