Skip to content

Commit

Permalink
Various updates :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisroovers committed Feb 24, 2022
1 parent 8a8f153 commit 2b42b38
Show file tree
Hide file tree
Showing 28 changed files with 503 additions and 291 deletions.
42 changes: 18 additions & 24 deletions automations/bathroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
to: "off"
for: "00:03:00"
condition:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.shower_water_present
state: "off"
- condition: state
entity_id: binary_sensor.shower_water_present
state: "off"
action:
- service: scene.turn_on
data:
Expand All @@ -49,11 +47,9 @@
condition:
# Let's check whether bathroom light is on, so we don't get cases where we the leak sensor is
# flapping while nobody's in the bathroom
- condition: and
conditions:
- condition: state
entity_id: light.bathroom
state: "on"
- condition: state
entity_id: light.bathroom
state: "on"
action:
- service: script.notify_joris
data:
Expand Down Expand Up @@ -119,20 +115,18 @@
entity_id: light.bathroom_group
to: "on"
condition:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.joris_working
state: "off"
- condition: time
after: "12:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: binary_sensor.joris_working
state: "off"
- condition: time
after: "12:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: scene.turn_on
data:
Expand Down
12 changes: 6 additions & 6 deletions automations/bedroom_kids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,20 @@
variables:
kid: "{{ 'mats' if (trigger.to_state.entity_id == 'climate.bedroom_mats') else 'hannah' }}"
action:
- service: notify.notify
- service: script.notify_family
data:
message: >
It's getting warm in {{kid}}'s room.
Bedroom Hannah: {{ state_attr("climate.bedroom_hannah", "current_temperature") }}C
Bedroom Mats: {{ state_attr("climate.bedroom_mats", "current_temperature") }}C
Master Bedroom: {{ state_attr("climate.master_bedroom", "current_temperature") }}C
data:
tag: bedroom-kids-warm
expire: "00:30:00"
- condition: template
value_template: "{{ is_state('input_boolean.heat_bedroom_' + kid, 'on') }}"
- service: script.notify_joris
data:
message: Seems like it's {{kid}} room which has the input boolean on.
expire: "00:05:00"
expire: "00:01:00"
- service: input_boolean.turn_off
data:
entity_id: "{{ 'input_boolean.heat_bedroom_' + kid }}"
Expand Down Expand Up @@ -107,7 +106,7 @@
to: "off"
for: "48:00:00"
action:
- service: notify.notify
- service: script.notify_family
data:
message: It's been more than 48hrs since the kids window were last opened. Suggestion to open them :-)

Expand All @@ -134,11 +133,12 @@
variables:
action_open: "{{ 'OPEN_' ~ context.id }}"
action_close: "{{ 'CLOSE_' ~ context.id }}"
- service: notify.notify
- service: script.notify_family
data:
message: >
Hannah went to bed, pre-heat bedroom Mats?
Bedroom Hannah: {{ state_attr("climate.bedroom_hannah", "current_temperature") }}C
Bedroom Mats: {{ state_attr("climate.bedroom_mats", "current_temperature") }}C
expire: "00:05:00"
data:
uri: "/lovelace-phone/upstairs"
30 changes: 13 additions & 17 deletions automations/house_mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@
entity_id: light.office
to: "on"
condition:
- condition: and
conditions:
- condition: state
entity_id: input_select.house_mode
state: "Sleeping"
- condition: time
after: "05:00:00"
before: "18:00:00"
- condition: state
entity_id: input_select.house_mode
state: "Sleeping"
- condition: time
after: "05:00:00"
before: "18:00:00"
action:
- service: input_select.select_option
data:
Expand Down Expand Up @@ -151,15 +149,13 @@
entity_id: binary_sensor.front_door_contact
to: "on"
condition:
- condition: and
conditions:
- condition: state
entity_id: input_select.house_mode
state: "Away"
for: "00:05:00"
- condition: state
entity_id: person.joris
state: "home"
- condition: state
entity_id: input_select.house_mode
state: "Away"
for: "00:05:00"
- condition: state
entity_id: person.joris
state: "home"
action:
- service: script.notify_joris
data:
Expand Down
11 changes: 11 additions & 0 deletions automations/kitchen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@
- service: input_boolean.turn_off
data:
entity_id: input_boolean.cooking

- alias: Enable cooking boolean when starting cooking
id: cooking_alert_on_start
trigger:
- platform: state
entity_id: binary_sensor.cooking_started
to: "on"
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.cooking
9 changes: 9 additions & 0 deletions automations/landing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@
- service: scene.turn_on
data:
entity_id: "{{ scene_entity_id }}"
# When Joris is still in bed, but Ilse is awake (determined when phone is charging)
- condition: "{{ not is_state('input_select.house_mode', 'Sleeping') }}"
- condition: "{{ is_state('sensor.iphone_13_pro_max_battery_state', 'Not Charging') }}"
- condition: "{{ is_state('person.joris', 'Home') }}"
- service: script.notify_joris
data:
message: Joris still sleeping, landing light should be kept off!


6 changes: 6 additions & 0 deletions automations/laundryroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
to: "off"
for: "00:01:00"
variables:
# This is what I use today, the benefit is that this is pythonic (i.e. "easy" to read if you're used to python)
scene_entity_id: "{{ 'scene.LaundryRoomEnter' + states('input_select.house_mode') if (trigger.to_state.state == 'on') else 'scene.LaundryRoomExit' }}"
# # Same, using new iif jinja filter
# scene_entity_id: "{{ (trigger.to_state.state == 'on') || iif('scene.LaundryRoomEnter' + states('input_select.house_mode'), 'scene.LaundryRoomExit') }}"
# # Same, using new iif homeassistant template function (I like this one the least)
# scene_entity_id: "{{ iif(trigger.to_state.state == 'on', scene.LaundryRoomEnter' + states('input_select.house_mode'), 'scene.LaundryRoomExit') }}"
action:
- service: scene.turn_on
data:
entity_id: "{{ scene_entity_id }}"


################################################################################
# Laundry Status Notifications #
################################################################################
Expand Down
54 changes: 25 additions & 29 deletions automations/livingroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,26 +232,24 @@
entity_id: light.dining_table
to: "on"
condition:
- condition: and
- condition: state
entity_id: media_player.tv_livingroom
state: "off"
- condition: state
entity_id:
- media_player.living_room
- media_player.bathroom
state:
- paused
- idle
- condition: state
entity_id: binary_sensor.joris_working
state: "off"
- condition: not
conditions:
- condition: state
entity_id: media_player.tv_livingroom
state: "off"
- condition: state
entity_id:
- media_player.living_room
- media_player.bathroom
state:
- paused
- idle
- condition: state
entity_id: binary_sensor.joris_working
state: "off"
- condition: not
conditions:
- condition: state
entity_id: input_select.house_mode
state: "Sleeping"
entity_id: input_select.house_mode
state: "Sleeping"
action:
- service: scene.turn_on
data:
Expand All @@ -272,17 +270,15 @@
to: "off"
for: "00:15:00"
condition:
- condition: and
conditions:
- condition: state
entity_id: light.dining_table
state: "on"
- condition: state
entity_id: binary_sensor.joris_working
state: "on"
- condition: state
entity_id: person.ilse
state: "not_home"
- condition: state
entity_id: light.dining_table
state: "on"
- condition: state
entity_id: binary_sensor.joris_working
state: "on"
- condition: state
entity_id: person.ilse
state: "not_home"
action:
- service: script.notify_joris
data:
Expand Down
32 changes: 14 additions & 18 deletions automations/master_bedroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,11 @@
below: 16
for: "00:30:00"
condition:
- condition: and
conditions:
- condition: template
value_template: "{{ states('input_select.house_mode') in ['Morning', 'Day', 'Evening'] }}"
- condition: state
entity_id: binary_sensor.bedroom_window
state: "on"
- condition: template
value_template: "{{ states('input_select.house_mode') in ['Morning', 'Day', 'Evening'] }}"
- condition: state
entity_id: binary_sensor.bedroom_window
state: "on"
action:
- service: script.notify_joris
data:
Expand All @@ -202,19 +200,17 @@
- platform: time
at: "12:00:00"
condition:
- condition: and
- condition: state
entity_id: binary_sensor.bedroom_window
state: "off"
- condition: not
conditions:
- condition: state
entity_id: binary_sensor.bedroom_window
state: "off"
- condition: not
conditions:
- condition: state
entity_id: binary_sensor.outside_precipitation
state: "on"
- condition: state
entity_id: input_select.house_mode
state: "Away"
entity_id: binary_sensor.outside_precipitation
state: "on"
- condition: state
entity_id: input_select.house_mode
state: "Away"
action:
- service: cover.open_cover
data:
Expand Down
48 changes: 21 additions & 27 deletions automations/morning_routine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
entity_id: light.nightstand_joris
to: "on"
condition:
- condition: and
conditions:
- condition: time
after: "07:00:00"
before: "10:00:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: time
after: "07:00:00"
before: "10:00:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
action:
- service: scene.turn_on
data:
Expand All @@ -34,17 +32,15 @@
entity_id: light.bathroom
to: "off"
condition:
- condition: and
conditions:
- condition: time
after: "07:00:00"
before: "10:00:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: state # Only do this automation when the house is still sleeping. This prevents this automation from messing up someone else presets who's already downstairs
entity_id: input_select.house_mode
state: "Sleeping"
- condition: time
after: "07:00:00"
before: "10:00:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: state # Only do this automation when the house is still sleeping. This prevents this automation from messing up someone else presets who's already downstairs
entity_id: input_select.house_mode
state: "Sleeping"
action:
# - service: rest_command.start_morning_tv
# - delay: 00:00:05 # Wait a bit, so TV can turn on fully before we attempt to play music
Expand All @@ -60,14 +56,12 @@
from: "off"
to: "on"
condition:
- condition: and
conditions:
- condition: time
after: "07:00:00"
before: "10:30:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: time
after: "07:00:00"
before: "10:30:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
action:
- service: scene.turn_on
data:
Expand Down
Loading

0 comments on commit 2b42b38

Please sign in to comment.