Skip to content

Commit ba4d33c

Browse files
committed
Various updates :-)
1 parent 8a8f153 commit ba4d33c

29 files changed

+505
-293
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In 2021 I've switched over to using the [Home Assistant Operating System](https:
88

99
Blogposts and write-ups:
1010

11-
- Blogpost: [My Smart Home 2021](https://jorisroovers.com/posts/my-smart-home-2021)
11+
- Blogpost: [My Smart Home 2021](https://jorisroovers.com/posts/my-smart-home-2021) ([featured on Hackernews](https://news.ycombinator.com/item?id=30349767))
1212
- [Details of my conference talk *Creating the Ultimate Morning Routine* at the 2020 Home Assistant Conference](docs/Ultimate-Morning-Routine.md)
1313
- Blogpost: [My Favorite Home Automations](https://jorisroovers.com/posts/my-favorite-home-automations)
1414
- Blogpost: [Window Opener project](https://jorisroovers.com/posts/window-opener)
@@ -335,4 +335,4 @@ Instructions (for myself) when uploading latest homeassistant config.
335335
git clean -fxdn
336336
# Actual deleting ignored (and non-staged) files/dirs
337337
git clean -fxd
338-
```
338+
```

automations/bathroom.yaml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@
2626
to: "off"
2727
for: "00:03:00"
2828
condition:
29-
- condition: and
30-
conditions:
31-
- condition: state
32-
entity_id: binary_sensor.shower_water_present
33-
state: "off"
29+
- condition: state
30+
entity_id: binary_sensor.shower_water_present
31+
state: "off"
3432
action:
3533
- service: scene.turn_on
3634
data:
@@ -49,11 +47,9 @@
4947
condition:
5048
# Let's check whether bathroom light is on, so we don't get cases where we the leak sensor is
5149
# flapping while nobody's in the bathroom
52-
- condition: and
53-
conditions:
54-
- condition: state
55-
entity_id: light.bathroom
56-
state: "on"
50+
- condition: state
51+
entity_id: light.bathroom
52+
state: "on"
5753
action:
5854
- service: script.notify_joris
5955
data:
@@ -119,20 +115,18 @@
119115
entity_id: light.bathroom_group
120116
to: "on"
121117
condition:
122-
- condition: and
123-
conditions:
124-
- condition: state
125-
entity_id: binary_sensor.joris_working
126-
state: "off"
127-
- condition: time
128-
after: "12:00:00"
129-
before: "17:00:00"
130-
weekday:
131-
- mon
132-
- tue
133-
- wed
134-
- thu
135-
- fri
118+
- condition: state
119+
entity_id: binary_sensor.joris_working
120+
state: "off"
121+
- condition: time
122+
after: "12:00:00"
123+
before: "17:00:00"
124+
weekday:
125+
- mon
126+
- tue
127+
- wed
128+
- thu
129+
- fri
136130
action:
137131
- service: scene.turn_on
138132
data:

automations/bedroom_kids.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,20 @@
5959
variables:
6060
kid: "{{ 'mats' if (trigger.to_state.entity_id == 'climate.bedroom_mats') else 'hannah' }}"
6161
action:
62-
- service: notify.notify
62+
- service: script.notify_family
6363
data:
6464
message: >
6565
It's getting warm in {{kid}}'s room.
6666
Bedroom Hannah: {{ state_attr("climate.bedroom_hannah", "current_temperature") }}C
6767
Bedroom Mats: {{ state_attr("climate.bedroom_mats", "current_temperature") }}C
6868
Master Bedroom: {{ state_attr("climate.master_bedroom", "current_temperature") }}C
69-
data:
70-
tag: bedroom-kids-warm
69+
expire: "00:30:00"
7170
- condition: template
7271
value_template: "{{ is_state('input_boolean.heat_bedroom_' + kid, 'on') }}"
7372
- service: script.notify_joris
7473
data:
7574
message: Seems like it's {{kid}} room which has the input boolean on.
76-
expire: "00:05:00"
75+
expire: "00:01:00"
7776
- service: input_boolean.turn_off
7877
data:
7978
entity_id: "{{ 'input_boolean.heat_bedroom_' + kid }}"
@@ -107,7 +106,7 @@
107106
to: "off"
108107
for: "48:00:00"
109108
action:
110-
- service: notify.notify
109+
- service: script.notify_family
111110
data:
112111
message: It's been more than 48hrs since the kids window were last opened. Suggestion to open them :-)
113112

@@ -134,11 +133,12 @@
134133
variables:
135134
action_open: "{{ 'OPEN_' ~ context.id }}"
136135
action_close: "{{ 'CLOSE_' ~ context.id }}"
137-
- service: notify.notify
136+
- service: script.notify_family
138137
data:
139138
message: >
140139
Hannah went to bed, pre-heat bedroom Mats?
141140
Bedroom Hannah: {{ state_attr("climate.bedroom_hannah", "current_temperature") }}C
142141
Bedroom Mats: {{ state_attr("climate.bedroom_mats", "current_temperature") }}C
142+
expire: "00:05:00"
143143
data:
144144
uri: "/lovelace-phone/upstairs"

automations/house_mode.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,12 @@
6060
entity_id: light.office
6161
to: "on"
6262
condition:
63-
- condition: and
64-
conditions:
65-
- condition: state
66-
entity_id: input_select.house_mode
67-
state: "Sleeping"
68-
- condition: time
69-
after: "05:00:00"
70-
before: "18:00:00"
63+
- condition: state
64+
entity_id: input_select.house_mode
65+
state: "Sleeping"
66+
- condition: time
67+
after: "05:00:00"
68+
before: "18:00:00"
7169
action:
7270
- service: input_select.select_option
7371
data:
@@ -151,15 +149,13 @@
151149
entity_id: binary_sensor.front_door_contact
152150
to: "on"
153151
condition:
154-
- condition: and
155-
conditions:
156-
- condition: state
157-
entity_id: input_select.house_mode
158-
state: "Away"
159-
for: "00:05:00"
160-
- condition: state
161-
entity_id: person.joris
162-
state: "home"
152+
- condition: state
153+
entity_id: input_select.house_mode
154+
state: "Away"
155+
for: "00:05:00"
156+
- condition: state
157+
entity_id: person.joris
158+
state: "home"
163159
action:
164160
- service: script.notify_joris
165161
data:

automations/kitchen.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,14 @@
4242
- service: input_boolean.turn_off
4343
data:
4444
entity_id: input_boolean.cooking
45+
46+
- alias: Enable cooking boolean when starting cooking
47+
id: cooking_alert_on_start
48+
trigger:
49+
- platform: state
50+
entity_id: binary_sensor.cooking_started
51+
to: "on"
52+
action:
53+
- service: input_boolean.turn_on
54+
data:
55+
entity_id: input_boolean.cooking

automations/landing.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@
2727
- service: scene.turn_on
2828
data:
2929
entity_id: "{{ scene_entity_id }}"
30+
# When Joris is still in bed, but Ilse is awake (determined when phone is charging)
31+
- condition: "{{ not is_state('input_select.house_mode', 'Sleeping') }}"
32+
- condition: "{{ is_state('sensor.iphone_13_pro_max_battery_state', 'Not Charging') }}"
33+
- condition: "{{ is_state('person.joris', 'Home') }}"
34+
- service: script.notify_joris
35+
data:
36+
message: Joris still sleeping, landing light should be kept off!
37+
38+

automations/laundryroom.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@
1818
to: "off"
1919
for: "00:01:00"
2020
variables:
21+
# This is what I use today, the benefit is that this is pythonic (i.e. "easy" to read if you're used to python)
2122
scene_entity_id: "{{ 'scene.LaundryRoomEnter' + states('input_select.house_mode') if (trigger.to_state.state == 'on') else 'scene.LaundryRoomExit' }}"
23+
# # Same, using new iif jinja filter
24+
# scene_entity_id: "{{ (trigger.to_state.state == 'on') || iif('scene.LaundryRoomEnter' + states('input_select.house_mode'), 'scene.LaundryRoomExit') }}"
25+
# # Same, using new iif homeassistant template function (I like this one the least)
26+
# scene_entity_id: "{{ iif(trigger.to_state.state == 'on', scene.LaundryRoomEnter' + states('input_select.house_mode'), 'scene.LaundryRoomExit') }}"
2227
action:
2328
- service: scene.turn_on
2429
data:
2530
entity_id: "{{ scene_entity_id }}"
2631

32+
2733
################################################################################
2834
# Laundry Status Notifications #
2935
################################################################################

automations/livingroom.yaml

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -232,26 +232,24 @@
232232
entity_id: light.dining_table
233233
to: "on"
234234
condition:
235-
- condition: and
235+
- condition: state
236+
entity_id: media_player.tv_livingroom
237+
state: "off"
238+
- condition: state
239+
entity_id:
240+
- media_player.living_room
241+
- media_player.bathroom
242+
state:
243+
- paused
244+
- idle
245+
- condition: state
246+
entity_id: binary_sensor.joris_working
247+
state: "off"
248+
- condition: not
236249
conditions:
237250
- condition: state
238-
entity_id: media_player.tv_livingroom
239-
state: "off"
240-
- condition: state
241-
entity_id:
242-
- media_player.living_room
243-
- media_player.bathroom
244-
state:
245-
- paused
246-
- idle
247-
- condition: state
248-
entity_id: binary_sensor.joris_working
249-
state: "off"
250-
- condition: not
251-
conditions:
252-
- condition: state
253-
entity_id: input_select.house_mode
254-
state: "Sleeping"
251+
entity_id: input_select.house_mode
252+
state: "Sleeping"
255253
action:
256254
- service: scene.turn_on
257255
data:
@@ -272,17 +270,15 @@
272270
to: "off"
273271
for: "00:15:00"
274272
condition:
275-
- condition: and
276-
conditions:
277-
- condition: state
278-
entity_id: light.dining_table
279-
state: "on"
280-
- condition: state
281-
entity_id: binary_sensor.joris_working
282-
state: "on"
283-
- condition: state
284-
entity_id: person.ilse
285-
state: "not_home"
273+
- condition: state
274+
entity_id: light.dining_table
275+
state: "on"
276+
- condition: state
277+
entity_id: binary_sensor.joris_working
278+
state: "on"
279+
- condition: state
280+
entity_id: person.ilse
281+
state: "not_home"
286282
action:
287283
- service: script.notify_joris
288284
data:

automations/master_bedroom.yaml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,11 @@
179179
below: 16
180180
for: "00:30:00"
181181
condition:
182-
- condition: and
183-
conditions:
184-
- condition: template
185-
value_template: "{{ states('input_select.house_mode') in ['Morning', 'Day', 'Evening'] }}"
186-
- condition: state
187-
entity_id: binary_sensor.bedroom_window
188-
state: "on"
182+
- condition: template
183+
value_template: "{{ states('input_select.house_mode') in ['Morning', 'Day', 'Evening'] }}"
184+
- condition: state
185+
entity_id: binary_sensor.bedroom_window
186+
state: "on"
189187
action:
190188
- service: script.notify_joris
191189
data:
@@ -202,19 +200,17 @@
202200
- platform: time
203201
at: "12:00:00"
204202
condition:
205-
- condition: and
203+
- condition: state
204+
entity_id: binary_sensor.bedroom_window
205+
state: "off"
206+
- condition: not
206207
conditions:
207208
- condition: state
208-
entity_id: binary_sensor.bedroom_window
209-
state: "off"
210-
- condition: not
211-
conditions:
212-
- condition: state
213-
entity_id: binary_sensor.outside_precipitation
214-
state: "on"
215-
- condition: state
216-
entity_id: input_select.house_mode
217-
state: "Away"
209+
entity_id: binary_sensor.outside_precipitation
210+
state: "on"
211+
- condition: state
212+
entity_id: input_select.house_mode
213+
state: "Away"
218214
action:
219215
- service: cover.open_cover
220216
data:

0 commit comments

Comments
 (0)