Please help with my below code - I can’t get it debugged.
Basically what I want to do is the following:
When I am home and before 21:00 and one of my 3 windows is open for longer then 10minutes I want to switch off the heating.
If all the windows are closed again, I want to switch on the heating again.
- alias: "Climate - Window Open For 10 Minutes"
trigger:
- platform: time
minutes: '/10'
condition:
- condition: state
entity_id: input_select.dieter_status
state: 'Home'
- condition: time
before: '21:00'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.kitchen_window_120
state: 'on'
- condition: state
entity_id: binary_sensor.sitting_window_109
state: 'on'
- condition: state
entity_id: binary_sensor.tv_room_window_110
state: 'on'
action:
- service: climate.set_away_mode
data:
entity_id: climate.kitchen
away_mode: 'true'
- wait_template: "{{ states.binary_sensor.kitchen_window_120.state == 'off' and states.binary_sensor.sitting_window_109.state == 'off' and states.binary_sensor.tv_room_window_110.state == 'off'}}"
- service: climate.set_away_mode
data:
entity_id: climate.kitchen
away_mode: 'false'
Cool, the only thing I don’t like is the wait template to turn the climate back on once they close.
It works but if you restart HA during that wait your climate maybe left off as the turn on never executes. You might want to set another automation that runs at 9pm and turns on the climate if you are home just to catch that situation.
I am making notifications.
I already have notifications when I an away and a door or a window opens.
But now I also want to have notifications when I am leaving and a door or a window is still open.
I have 11 window/door sensors.
Temporarily I made 11 Automation Notifications as per below, but I was hoping to combine all of them to one automation, that only sends one notification with a list of all window/door sensors that have been left open.
- alias: "Notification Text - Bath Room Window Left Open Leaving Home Mode"
initial_state: true
hide_entity: true
trigger:
- platform: state
entity_id: input_select.dieter_status
from: 'Home'
condition:
- condition: state
entity_id: binary_sensor.bath_window_113
state: 'on'
action:
- service: notify.pushbullet
data_template:
title: "Home Assistant"
message: 'Bath Room Window Has Been Left Open.'
Would this command be possible to limit to a certain group of switches. e.g. If I would make a group “DownStairs Switches” that I can execute a command to only turn off those switches.