mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-10 02:50:12 -04:00
initial push
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
alias: Bridget Asleep
|
||||
id: automation_bridget_asleep
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: in_bed
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
to: 'on'
|
||||
for: '00:20:00'
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.kids_bedtime
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
state: 'on'
|
||||
- condition: trigger
|
||||
id: "in_bed"
|
||||
|
||||
action:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
@@ -0,0 +1,21 @@
|
||||
alias: "Bridget Away"
|
||||
id: automation_bridget_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.bridget_home
|
||||
to: "off"
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.bridget_home
|
||||
state: "off"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.bridget_home
|
||||
@@ -0,0 +1,23 @@
|
||||
alias: "Bridget Home"
|
||||
id: automation_bridget_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.bridget_home
|
||||
to: "on"
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.bridget_home
|
||||
state: "on"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.bridget_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.bridget_home
|
||||
@@ -0,0 +1,38 @@
|
||||
alias: Bridget In Bed
|
||||
id: automation_bridget_in_bed
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:10:00'
|
||||
- platform: state
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
to: 'on'
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.kids_bedtime
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.white_bed_occupied
|
||||
state: 'on'
|
||||
for: '00:10:00'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
state: 'off'
|
||||
#- condition: state
|
||||
# entity_id: binary_sensor.white_bed_occupied
|
||||
# state: 'on'
|
||||
# for:
|
||||
# minutes: 5
|
||||
|
||||
action:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
@@ -0,0 +1,26 @@
|
||||
initial_state: "on"
|
||||
alias: "Bridget Location Update"
|
||||
id: automation_bridget_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# Bridget moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.bridget_status_dropdown
|
||||
- input_boolean.bridget_home
|
||||
# Clint moved
|
||||
- input_select.clint_status_dropdown
|
||||
- input_boolean.clint_home
|
||||
# Custody changed
|
||||
- binary_sensor.have_custody
|
||||
# Sleeping status changed
|
||||
- input_boolean.bridget_is_awake
|
||||
- input_boolean.bridget_in_bed
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.bridget_travel_sensor
|
||||
@@ -0,0 +1,47 @@
|
||||
alias: Bridget Status at Startup
|
||||
id: automation_bridget_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '20:00:00'
|
||||
before: '21:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.bridget_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.bridget_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '21:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.bridget_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.bridget_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.bridget_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.bridget_is_awake
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
alias: Clint WFH
|
||||
id: automation_clint_wfh
|
||||
mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.clint_work_from_home
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.clint_work_from_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.clint_work_from_home
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.clint_work_from_home
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.clint_work_from_home
|
||||
@@ -0,0 +1,26 @@
|
||||
alias: Clint Asleep
|
||||
id: automation_clint_asleep
|
||||
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
to: 'on'
|
||||
for:
|
||||
minutes: 15
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: time
|
||||
after: '21:00:00'
|
||||
before: '04:00:00'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
alias: Clint at Work
|
||||
id: automation_clint_at_work
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
to: 'AGH'
|
||||
action:
|
||||
- service: automation.turn_on
|
||||
entity_id: automation.clint_home_after_work
|
||||
- service: input_text.set_value
|
||||
data:
|
||||
entity_id: input_text.person_clint
|
||||
value: at work
|
||||
@@ -0,0 +1,15 @@
|
||||
alias: Clint Awake
|
||||
id: automation_clint_awake
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
to: 'off'
|
||||
for: '00:00:30'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
|
||||
- service: script.turn_on
|
||||
entity_id: script.clint_travel_sensor
|
||||
@@ -0,0 +1,39 @@
|
||||
alias: Clint Away
|
||||
id: automation_clint_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- device_tracker.pixel_7
|
||||
- person.clint
|
||||
- group.person_clint
|
||||
from: 'home'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: person.clint
|
||||
state: 'home'
|
||||
- condition: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
state: 'home'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: person.clint
|
||||
state: 'home'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_home
|
||||
|
||||
- delay: '00:00:30'
|
||||
@@ -0,0 +1,58 @@
|
||||
alias: Clint Home
|
||||
id: automation_clint_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- device_tracker.pixel_7
|
||||
- person.clint
|
||||
- group.person_clint
|
||||
- device_tracker.pixel_7_wifi
|
||||
to: 'home'
|
||||
|
||||
- platform: state
|
||||
id: car_home
|
||||
entity_id:
|
||||
- binary_sensor.gray_suv_east_side
|
||||
- binary_sensor.gray_suv_west_side
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: group.person_clint
|
||||
above: 0
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_clint', 'entity_id'))|list)|groupby('state'))['home']|count }}"
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'DreamWeaver'
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'DreamIoT-2G'
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'pozfam'
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'pozfam-2.4G'
|
||||
- condition: trigger
|
||||
id: "car_home"
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_home
|
||||
- service: automation.turn_on
|
||||
entity_id: automation.clint_at_work
|
||||
|
||||
- delay: '00:00:30'
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
initial_state: 'off'
|
||||
alias: 'clint home after work'
|
||||
id: automation_home_after_work
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
to: 'home'
|
||||
for:
|
||||
minutes: 10
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.notify_clint_work
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: time
|
||||
after: '15:00:00'
|
||||
weekday:
|
||||
- mon
|
||||
- tue
|
||||
- wed
|
||||
- thu
|
||||
- fri
|
||||
action:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: automation.clint_home_after_work
|
||||
@@ -0,0 +1,70 @@
|
||||
alias: Clint in Bed
|
||||
id: automation_clint_in_bed
|
||||
|
||||
trigger:
|
||||
# Bed in master bedroom is occupied
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
# Radio playing
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: 'playing'
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: 'idle'
|
||||
# Light on
|
||||
- platform: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
to: 'on'
|
||||
# Front room unoccupied for at least 5 minutes
|
||||
- platform: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
to: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
# Something gets plugged in
|
||||
- platform: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
to: "Wireless"
|
||||
- platform: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
to: "wireless"
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_tablet_charging
|
||||
to: 'on'
|
||||
condition:
|
||||
- alias: "An adult is home and not in bed"
|
||||
condition: or
|
||||
conditions:
|
||||
- alias: "Clint is home and not in bed"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- alias: "Kristy is home and not in bed"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- alias: "Its between 8:30PM and 5AM"
|
||||
condition: time
|
||||
after: '20:30:00'
|
||||
before: '05:00:00'
|
||||
|
||||
- alias: "The bed is occupied"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
initial_state: 'on'
|
||||
alias: 'Clint Location Update'
|
||||
id: automation_clint_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# I've moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.clint_status_dropdown
|
||||
- input_boolean.clint_home
|
||||
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.clint_travel_sensor
|
||||
@@ -0,0 +1,15 @@
|
||||
alias: Clint Travelling
|
||||
id: automation_clint_travelling
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: time
|
||||
at: '21:00:00'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_travelling
|
||||
@@ -0,0 +1,44 @@
|
||||
alias: 'Clint Up'
|
||||
id: automation_clint_up
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.great_room
|
||||
to: 'playing'
|
||||
- platform: state
|
||||
entity_id: media_player.great_room
|
||||
to: 'idle'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.master_bedroom_door_contact
|
||||
- binary_sensor.master_suite_door_contact
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.pixel_7_is_charging
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
for: '00:10:00'
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'on'
|
||||
- condition: time
|
||||
after: '04:00:00'
|
||||
before: '22:00:00'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
for: '00:01:00'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
alias: Clint Wakeup
|
||||
id: automation_clint_wake_up
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.morning
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.morning
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.work_day
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
option: 'Auto'
|
||||
|
||||
- service: homeassistant.turn_on
|
||||
data:
|
||||
entity_id: light.master_bedroom_hue
|
||||
|
||||
- delay: '00:30:00'
|
||||
@@ -0,0 +1,19 @@
|
||||
initial_state: 'on'
|
||||
alias: 'Clint changing zones'
|
||||
id: automation_clint_changing_zones
|
||||
trigger:
|
||||
# Been away for a few minutes
|
||||
- platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
to: 'not_home'
|
||||
for: '00:05:00'
|
||||
# Arrived in a zone
|
||||
- platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
from: 'not_home'
|
||||
condition:
|
||||
# Been at least 5 minutes
|
||||
- condition: template
|
||||
value_template: "{{ ( as_timestamp(now()) - as_timestamp(state_attr('script.clint_traveltime','last_triggered'))|float)|float > 300 }}"
|
||||
action:
|
||||
- service: script.clint_traveltime
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Clint Status at Startup
|
||||
id: automation_clint_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '23:30:00'
|
||||
before: '00:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '00:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
@@ -0,0 +1,41 @@
|
||||
alias: Set Clint Next Alarm
|
||||
id: automation_set_clint_next_alarm
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.work_day
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.work_day
|
||||
to: 'on'
|
||||
|
||||
- platform: time
|
||||
at: '01:00:00'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.work_day
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.clint_next_alarm
|
||||
data:
|
||||
time: "09:00:00"
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.work_day
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.clint_next_alarm
|
||||
data:
|
||||
time: "06:00:00"
|
||||
@@ -0,0 +1,40 @@
|
||||
alias: 'Wake Clint'
|
||||
|
||||
id: automation_wake_clint
|
||||
initial_state: on
|
||||
trigger:
|
||||
platform: time
|
||||
at: input_datetime.clint_next_alarm
|
||||
# condition:
|
||||
# - condition: state
|
||||
# entity_id: binary_sensor.work_day
|
||||
# state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
volume_level: 0.95
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Energize
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Energize
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
|
||||
- service: script.wake_up_the_master_bedroom
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Ebin Away'
|
||||
id: automation_ebin_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.ebin_home
|
||||
to: "off"
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.ebin_home
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: 'Ebin Home'
|
||||
id: automation_ebin_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.ebin_home
|
||||
to: "on"
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.have_custody
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: person.kristy
|
||||
state: 'home'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.ebin_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.ebin_home
|
||||
@@ -0,0 +1,41 @@
|
||||
alias: Ebin In Bed
|
||||
id: automation_ebin_in_bed
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:05:00'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:05:00'
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- input_boolean.ebin_home
|
||||
- input_boolean.kids_bedtime
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
|
||||
action:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
@@ -0,0 +1,17 @@
|
||||
alias: 'Ebin Location Update'
|
||||
id: automation_ebin_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# I've moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.ebin_status_dropdown
|
||||
- input_boolean.ebin_home
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.ebin_travel_sensor
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Ebin Status at Startup
|
||||
id: automation_ebin_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '20:00:00'
|
||||
before: '21:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.ebin_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.ebin_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '21:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.ebin_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.ebin_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.ebin_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.ebin_is_awake
|
||||
@@ -0,0 +1,28 @@
|
||||
alias: Emmett Asleep
|
||||
id: automation_emmett_asleep
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: in_bed
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
to: 'on'
|
||||
for: '00:20:00'
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.kids_bedtime
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
state: 'on'
|
||||
- condition: trigger
|
||||
id: "in_bed"
|
||||
|
||||
action:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
@@ -0,0 +1,20 @@
|
||||
alias: 'Emmett Away'
|
||||
id: automation_emmett_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.emmett_home
|
||||
to: 'off'
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.emmett_home
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.emmett_home
|
||||
@@ -0,0 +1,22 @@
|
||||
alias: 'Emmett Home'
|
||||
id: automation_emmett_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.emmett_home
|
||||
to: 'on'
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.emmett_home
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.emmett_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.emmett_home
|
||||
@@ -0,0 +1,38 @@
|
||||
alias: Emmett In Bed
|
||||
id: automation_emmett_in_bed
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:10:00'
|
||||
- platform: state
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
to: 'on'
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.kids_bedtime
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.black_bed_occupied
|
||||
state: 'on'
|
||||
for: '00:10:00'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
state: 'off'
|
||||
#- condition: state
|
||||
# entity_id: binary_sensor.black_bed_occupied
|
||||
# state: 'on'
|
||||
# for:
|
||||
# minutes: 5
|
||||
|
||||
action:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: Emmett Location Update
|
||||
id: automation_emmett_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# Emmett moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.emmett_status_dropdown
|
||||
- input_boolean.emmett_home
|
||||
# Clint moved
|
||||
- input_select.clint_status_dropdown
|
||||
- input_boolean.clint_home
|
||||
# Custody changed
|
||||
- binary_sensor.have_custody
|
||||
# Sleeping status changed
|
||||
- input_boolean.emmett_is_awake
|
||||
- input_boolean.emmett_in_bed
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.emmett_travel_sensor
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Emmett Status at Startup
|
||||
id: automation_emmett_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '20:00:00'
|
||||
before: '21:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.emmett_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.emmett_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '21:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.emmett_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.emmett_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.emmett_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.emmett_is_awake
|
||||
@@ -0,0 +1,20 @@
|
||||
alias: 'Guest Location Update'
|
||||
id: automation_guest_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# Guest moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.guest_status_dropdown
|
||||
- input_boolean.guest_home
|
||||
# Sleeping status changed
|
||||
- input_boolean.guest_is_awake
|
||||
- input_boolean.guest_in_bed
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.guest_travel_sensor
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Guest Status at Startup
|
||||
id: automation_guest_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '23:30:00'
|
||||
before: '00:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.guest_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.guest_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '00:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.guest_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.guest_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.guest_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.guest_is_awake
|
||||
@@ -0,0 +1,26 @@
|
||||
alias: Kristy Asleep
|
||||
id: automation_kristy_asleep
|
||||
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
to: 'on'
|
||||
for:
|
||||
minutes: 15
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- condition: time
|
||||
after: '20:30:00'
|
||||
before: '04:00:00'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
alias: Kristy Awake
|
||||
id: automation_kristy_awake
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
|
||||
- service: script.turn_on
|
||||
entity_id: script.kristy_travel_sensor
|
||||
@@ -0,0 +1,37 @@
|
||||
alias: 'Kristy Away'
|
||||
id: automation_kristy_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- device_tracker.kristy_s_phone
|
||||
from: 'home'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: device_tracker.kristy_s_phone
|
||||
state: 'not_home'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: device_tracker.kristy_s_phone
|
||||
state: 'not_home'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.kristy_home
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.allow_announcements
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.out_of_bed_alert
|
||||
|
||||
- delay: '00:00:30'
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
alias: 'Kristy Home'
|
||||
id: automation_kristy_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- group.person_kristy
|
||||
- device_tracker.kristy_s_phone
|
||||
to: 'home'
|
||||
|
||||
- platform: event
|
||||
event_type: automation_reloaded
|
||||
|
||||
condition:
|
||||
- alias: 'They were previously considered away'
|
||||
condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'off'
|
||||
|
||||
- alias: 'At least one tracker is home'
|
||||
condition: numeric_state
|
||||
entity_id: group.person_kristy
|
||||
above: 0
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_kristy', 'entity_id'))|list)|groupby('state'))['home']|count }}"
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.kristy_travelling
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.kristy_home
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.allow_announcements
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.out_of_bed_alert
|
||||
@@ -0,0 +1,39 @@
|
||||
alias: Kristy in Bed
|
||||
id: automation_kristy_in_bed
|
||||
|
||||
trigger:
|
||||
# Bed in master bedroom is occupied
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
# Radio playing
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: 'playing'
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: 'idle'
|
||||
# Light on
|
||||
- platform: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- alias: "Its between 8:30PM and 5AM"
|
||||
condition: time
|
||||
after: '20:30:00'
|
||||
before: '05:00:00'
|
||||
|
||||
- alias: "The bed is occupied"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Kristy Location Update'
|
||||
id: automation_kristy_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# I've moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.kristy_status_dropdown
|
||||
- input_boolean.kristy_home
|
||||
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.kristy_travel_sensor
|
||||
@@ -0,0 +1,49 @@
|
||||
alias: Kristy Status at Startup
|
||||
id: automation_kristy_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '23:30:00'
|
||||
before: '00:00:00'
|
||||
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.kristy_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.kristy_is_awake
|
||||
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '00:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.kristy_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.kristy_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.kristy_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.kristy_is_awake
|
||||
@@ -0,0 +1,17 @@
|
||||
alias: 'Marshall Away'
|
||||
id: automation_marshall_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: device_tracker.nmap_tracker_fe_cf_82_b2_22_e0
|
||||
to: 'not_home'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.marshall_home
|
||||
@@ -0,0 +1,34 @@
|
||||
alias: 'Marshall Home'
|
||||
id: automation_marshall_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- group.person_marshall
|
||||
- device_tracker.nmap_tracker_fe_cf_82_b2_22_e0
|
||||
to: 'home'
|
||||
|
||||
- platform: event
|
||||
event_type: automation_reloaded
|
||||
|
||||
condition:
|
||||
- alias: 'They were previously considered away'
|
||||
condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'off'
|
||||
|
||||
- alias: 'At least one tracker is home'
|
||||
condition: numeric_state
|
||||
entity_id: group.person_marshall
|
||||
above: 0
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_marshall', 'entity_id'))|list)|groupby('state'))['home']|count }}"
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.marshall_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.marshall_home
|
||||
@@ -0,0 +1,20 @@
|
||||
alias: 'Marshall Location Update'
|
||||
id: automation_marshall_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# I've moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.marshall_status_dropdown
|
||||
- input_boolean.marshall_home
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
- condition: state
|
||||
entity_id: script.marshall_travel_sensor
|
||||
state: 'off'
|
||||
action:
|
||||
|
||||
- service: script.turn_on
|
||||
entity_id: script.marshall_travel_sensor
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Marshall Status at Startup
|
||||
id: automation_marshall_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '22:00:00'
|
||||
before: '23:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.marshall_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.marshall_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '23:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.marshall_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.marshall_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.marshall_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.marshall_is_awake
|
||||
@@ -0,0 +1,20 @@
|
||||
alias: 'Tess Away'
|
||||
id: automation_tess_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- person.kristy
|
||||
to: 'not_home'
|
||||
- platform: state
|
||||
entity_id:
|
||||
- person.tess
|
||||
to: 'not_home'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.tess_home
|
||||
@@ -0,0 +1,29 @@
|
||||
alias: 'Tess Home'
|
||||
id: automation_tess_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: automation_reloaded
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- group.person_tess
|
||||
- device_tracker.apple_17_a6_78
|
||||
to: 'home'
|
||||
condition:
|
||||
- alias: 'They were previously considered away'
|
||||
condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'off'
|
||||
|
||||
- alias: 'At least one tracker is home'
|
||||
condition: numeric_state
|
||||
entity_id: group.person_tess
|
||||
above: 0
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_tess', 'entity_id'))|list)|groupby('state'))['home']|count }}"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.tess_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.tess_home
|
||||
@@ -0,0 +1,20 @@
|
||||
alias: 'Tess Location Update'
|
||||
id: automation_tess_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# I've moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.tess_status_dropdown
|
||||
- input_boolean.tess_home
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
- condition: state
|
||||
entity_id: script.tess_travel_sensor
|
||||
state: 'off'
|
||||
action:
|
||||
|
||||
- service: script.turn_on
|
||||
entity_id: script.tess_travel_sensor
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Tess Status at Startup
|
||||
id: automation_tess_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '22:00:00'
|
||||
before: '23:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.tess_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.tess_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '23:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.tess_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.tess_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.tess_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.tess_is_awake
|
||||
@@ -0,0 +1,69 @@
|
||||
alias: Adults Asleep
|
||||
id: automation_adults_asleep
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
- input_boolean.kristy_is_awake
|
||||
- input_boolean.guest_is_awake
|
||||
to: 'off'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
data:
|
||||
entity_id:
|
||||
- input_boolean.asleep
|
||||
- input_boolean.teens_asleep
|
||||
- input_boolean.kids_asleep
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
data:
|
||||
option: Nightlight
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.patio_door_contact
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: lock.lock
|
||||
target:
|
||||
entity_id: lock.patio_door
|
||||
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.asleep
|
||||
@@ -0,0 +1,95 @@
|
||||
alias: Adults Awake
|
||||
id: automation_adults_awake
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# Consider the house awake if it is after 4:30AM and Kristy and I are both home and awake
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.adults_in_bed
|
||||
- input_boolean.clint_in_bed
|
||||
- input_boolean.clint_is_awake
|
||||
- input_boolean.kristy_in_bed
|
||||
- input_boolean.kristy_is_awake
|
||||
- binary_sensor.master_bed_occupied
|
||||
|
||||
- platform: time
|
||||
id: wake_clint
|
||||
at: input_datetime.clint_next_alarm
|
||||
|
||||
- platform: state
|
||||
id: late_morning
|
||||
entity_id: binary_sensor.late_morning
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: time
|
||||
after: '04:30:00'
|
||||
- condition: time
|
||||
before: '10:00:00'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: late_morning
|
||||
- condition: trigger
|
||||
id: wake_clint
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
for: '00:10:00'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.bedtime
|
||||
- input_boolean.asleep
|
||||
- input_boolean.master_bedroom_asleep
|
||||
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
data:
|
||||
option: Auto
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
alias: Adults Away
|
||||
id: automation_adults_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_home
|
||||
- input_boolean.kristy_home
|
||||
- input_boolean.guest_home
|
||||
to: 'off'
|
||||
condition:
|
||||
# All away
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_home
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.adults_away
|
||||
@@ -0,0 +1,26 @@
|
||||
alias: "Adults away something open"
|
||||
id: automation_adults_away_something_open
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.adults_away
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.something_open
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "off"
|
||||
action:
|
||||
# Notify the last person to leave
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data:
|
||||
message: >-
|
||||
{% if as_timestamp(states.input_boolean.kristy_home.last_updated) > as_timestamp(states.input_boolean.clint_home.last_updated) %}
|
||||
The following are open: {{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_exterior_windows', 'entity_id') + state_attr('group.my_exterior_doors', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
||||
{% else %}
|
||||
The following are open: {{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_exterior_windows', 'entity_id') + state_attr('group.my_exterior_doors', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Adults returned'
|
||||
id: automation_adults_returned
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_home
|
||||
- input_boolean.kristy_home
|
||||
- input_boolean.guest_home
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.adults_away
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.adults_away
|
||||
@@ -0,0 +1,57 @@
|
||||
alias: 'All away'
|
||||
id: automation_all_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_home
|
||||
- input_boolean.kristy_home
|
||||
- input_boolean.guest_home
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.marshall_home
|
||||
- input_boolean.tess_home
|
||||
- input_boolean.ebin_home
|
||||
- input_boolean.front_room_occupied
|
||||
- input_boolean.computer_area_occupied
|
||||
- input_boolean.kitchen_occupied
|
||||
- input_boolean.great_room_occupied
|
||||
to: 'off'
|
||||
condition:
|
||||
# Adults are away
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_home
|
||||
state: 'off'
|
||||
# Kids are away
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'off'
|
||||
# And not in guest mode
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.all_away
|
||||
- delay: '00:00:30'
|
||||
@@ -0,0 +1,13 @@
|
||||
alias: 'All returned'
|
||||
id: automation_all_returned
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_home
|
||||
- input_boolean.kristy_home
|
||||
to: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.all_away
|
||||
@@ -0,0 +1,52 @@
|
||||
alias: "Almost Bedtime"
|
||||
id: automation_almost_bedtime
|
||||
initial_state: on
|
||||
trigger:
|
||||
platform: time
|
||||
at: input_datetime.kids_five_minute_warning_time
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.announce_bedtime
|
||||
state: "on"
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: "on"
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.65
|
||||
target:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.kitchen
|
||||
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
media_content_id: media-source://media_source/local/Sounds/tts/almost_bedtime.mp3
|
||||
volume: 0.5
|
||||
|
||||
# Because of how we're calling the script, the automation won't continue until the script is done, so we don't need a delay here
|
||||
#- delay: '00:00:10'
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{states('switch.nursery_bed_lights') == 'off' }}"
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.nursery_wled
|
||||
data:
|
||||
option: Read
|
||||
@@ -0,0 +1,44 @@
|
||||
alias: 'Almost Bedtime TTS'
|
||||
id: automation_almost_bedtime_tts
|
||||
initial_state: off
|
||||
trigger:
|
||||
platform: time
|
||||
at: input_datetime.kids_five_minute_warning_time
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.announce_bedtime
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
action:
|
||||
- service: media_player.volume_set
|
||||
data_template:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.bathroom_mini
|
||||
- media_player.front_room_hub
|
||||
- media_player.kitchen
|
||||
- media_player.nursery_hub
|
||||
- media_player.master_bedroom_clock
|
||||
volume_level: 0.7
|
||||
- delay: '00:00:03'
|
||||
- service: tts.google_translate_say
|
||||
entity_id: media_player.all_speakers
|
||||
data_template:
|
||||
message: Alright kids. Its almost bedtime. You've got 5 minutes.
|
||||
- delay: '00:00:10'
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.all_speakers
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.automatic_light_profile
|
||||
data:
|
||||
option: Dimmed
|
||||
@@ -0,0 +1,52 @@
|
||||
initial_state: 'on'
|
||||
alias: 'Bedtime'
|
||||
id: automation_bedtime
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.kristy_in_bed
|
||||
- input_boolean.clint_in_bed
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.bedtime
|
||||
- input_boolean.teens_bedtime
|
||||
- input_boolean.kids_bedtime
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.automatic_light_profile
|
||||
data:
|
||||
option: Nightlight
|
||||
@@ -0,0 +1,40 @@
|
||||
alias: 'Bedtime something open'
|
||||
id: automation_bedtime_something_open
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
to: 'off'
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
# We're both in bed
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.something_open
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.impending_rain
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: media_player.turn_on
|
||||
data_template:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
- service: media_player.volume_set
|
||||
data_template:
|
||||
volume_level: 0.30
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
- service: tts.google_translate_say
|
||||
data_template:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
message: >-
|
||||
The following are open:
|
||||
{{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_exterior_windows', 'entity_id') + state_attr('group.my_exterior_doors', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
||||
- delay: '00:01:00'
|
||||
- service: media_player.turn_off
|
||||
data:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
@@ -0,0 +1,53 @@
|
||||
alias: Continue Nursery Noise
|
||||
id: automation_continue_nursery_noise
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.nursery_hub
|
||||
from: "playing"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: 'Night on'
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.google_home
|
||||
option: 'Nursery'
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.ambient_sound
|
||||
option: 'Random White Noise'
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
entity_id: input_number.volume_ambientsounds
|
||||
value: '0.35'
|
||||
- service: script.ambientsounds
|
||||
@@ -0,0 +1,168 @@
|
||||
alias: "Goodnight Kids"
|
||||
|
||||
id: automation_goodnight_kids
|
||||
initial_state: on
|
||||
trigger:
|
||||
platform: time
|
||||
at: input_datetime.kids_bedtime_announcement_time
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.announce_bedtime
|
||||
state: "on"
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: "on"
|
||||
action:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{states('media_player.announcements') == 'unknown' }}"
|
||||
sequence:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.computer_area_hub
|
||||
media_content_id: >-
|
||||
{% if is_state('input_boolean.emmett_home', 'on') %}
|
||||
{% if is_state('input_boolean.bridget_home', 'on') %}
|
||||
{% if is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett_bridget_ebin.mp3
|
||||
{% else %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett_bridget.mp3
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.ebin_home','on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett_ebin.mp3
|
||||
{% else %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett.mp3
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.bridget_home', 'on') %}
|
||||
{% if is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_bridget_ebin.mp3
|
||||
{% else %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_bridget.mp3
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_ebin.mp3
|
||||
{% endif %}
|
||||
volume: 0.5
|
||||
default:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
entity_id: media_player.announcements
|
||||
media_content_id: >-
|
||||
{% if is_state('input_boolean.emmett_home', 'on') %}
|
||||
{% if is_state('input_boolean.bridget_home', 'on') %}
|
||||
{% if is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett_bridget_ebin.mp3
|
||||
{% else %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett_bridget.mp3
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.ebin_home','on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett_ebin.mp3
|
||||
{% else %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_emmett.mp3
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.bridget_home', 'on') %}
|
||||
{% if is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_bridget_ebin.mp3
|
||||
{% else %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_bridget.mp3
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_ebin.mp3
|
||||
{% endif %}
|
||||
volume: 0.5
|
||||
|
||||
# Because of how we're calling the script, the automation won't continue until the script is done, so we don't need a delay here
|
||||
#- delay: '00:00:10'
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state_attr('media_player.front_room_tv','source','YouTube')}}"
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: media_player.front_room_tv
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state_attr('media_player.downstairs_roku','source','YouTube')}}"
|
||||
sequence:
|
||||
- service: media_player.select_source
|
||||
data:
|
||||
source: Home
|
||||
target:
|
||||
entity_id: media_player.downstairs_roku
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: switch.shelly_projector
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.automatic_light_profile
|
||||
option: Dimmed
|
||||
|
||||
- delay: "00:00:01"
|
||||
|
||||
# - service: media_player.play_media
|
||||
# target:
|
||||
# entity_id: media_player.front_room_hub
|
||||
# data:
|
||||
# media_content_id: camera-casting-yml/nursery-camera
|
||||
# media_content_type: lovelace
|
||||
# metadata:
|
||||
# title: Nursery Camera
|
||||
# thumbnail: https://brands.home-assistant.io/_/lovelace/logo.png
|
||||
# media_class: app
|
||||
# children_media_class: null
|
||||
# navigateIds:
|
||||
# - {}
|
||||
# - media_content_type: lovelace
|
||||
# media_content_id: ""
|
||||
# - media_content_type: lovelace
|
||||
# media_content_id: camera-casting-yml
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.ebin_home','on')}}"
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.nursery_wled
|
||||
data:
|
||||
option: "Off"
|
||||
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.nursery_mode
|
||||
data:
|
||||
option: "Nightlight"
|
||||
|
||||
- delay: "00:15:00"
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.emmett_home','on') or is_state('input_boolean.bridget_home','on')}}"
|
||||
sequence:
|
||||
- service: input_button.press
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_button.nursery_bedtime
|
||||
|
||||
- delay: "00:45:00"
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.emmett_home','on') or is_state('input_boolean.bridget_home','on')}}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
@@ -0,0 +1,167 @@
|
||||
alias: 'Goodnight Kids TTS'
|
||||
id: automation_goodnight_kids_tts
|
||||
initial_state: off
|
||||
trigger:
|
||||
platform: time
|
||||
at: input_datetime.kids_bedtime_announcement_time
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.announce_bedtime
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
action:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
|
||||
- service: media_player.volume_set
|
||||
data_template:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.bathroom_mini
|
||||
- media_player.front_room_hub
|
||||
- media_player.kitchen
|
||||
- media_player.nursery_hub
|
||||
- media_player.master_bedroom_clock
|
||||
volume_level: 0.7
|
||||
|
||||
- delay: '00:00:01'
|
||||
|
||||
- service: tts.google_translate_say
|
||||
entity_id: media_player.all_speakers
|
||||
data_template:
|
||||
message: >
|
||||
It is time for bed.
|
||||
{% if is_state('input_boolean.emmett_home', 'on') %}
|
||||
Good night Emmett
|
||||
{% if is_state('input_boolean.bridget_home', 'on') %}
|
||||
{% if is_state('input_boolean.ebin_home', 'on') %}
|
||||
Good night Bridget and good night Ebin
|
||||
{% else %}
|
||||
and good night Bridget
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.ebin_home','on') %}
|
||||
and good night Ebin
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.bridget_home', 'on') %}
|
||||
{% if is_state('input_boolean.ebin_home', 'on') %}
|
||||
Good night Bridget and good night Ebin
|
||||
{% else %}
|
||||
Good Night Bridget
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.ebin_home', 'on') %}
|
||||
Good night Ebin
|
||||
{% endif %}
|
||||
- delay: '00:00:10'
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
entity_id:
|
||||
- media_player.all_speakers
|
||||
- media_player.front_room_tv
|
||||
- media_player.downstairs_roku
|
||||
- switch.shelly_projector
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.automatic_light_profile
|
||||
option: Dimmed
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
|
||||
- service: light.turn_on
|
||||
data:
|
||||
entity_id:
|
||||
- light.black_bed_wled
|
||||
- light.white_bed_wled
|
||||
brightness_pct: 50
|
||||
effect: random
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.nursery_mode
|
||||
option: 'Nightlight'
|
||||
|
||||
- delay: "00:15:00"
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.nursery_mode
|
||||
option: 'Off'
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
|
||||
#- service: input_select.select_option
|
||||
# data:
|
||||
# entity_id: input_select.google_home
|
||||
# option: 'Nursery'
|
||||
#- service: input_select.select_option
|
||||
# data:
|
||||
# entity_id: input_select.ambient_sound
|
||||
# option: 'Random Kids Noise'
|
||||
#- service: input_number.set_value
|
||||
# data:
|
||||
# entity_id: input_number.volume_ambientsounds
|
||||
# value: '0.40'
|
||||
#- service: script.ambientsounds
|
||||
- delay: "00:30:00"
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
- service: light.turn_off
|
||||
data:
|
||||
entity_id:
|
||||
- light.black_bed_wled
|
||||
- light.white_bed_wled
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.nursery_mode
|
||||
option: 'Off'
|
||||
@@ -0,0 +1,86 @@
|
||||
alias: Kids Asleep
|
||||
id: automation_kids_asleep
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_is_awake
|
||||
- input_boolean.bridget_is_awake
|
||||
- input_boolean.ebin_is_awake
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.kids_away
|
||||
to: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
data:
|
||||
entity_id: input_boolean.kids_asleep
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Kids Asleep Asleep
|
||||
entity_id: automation.kids_asleep
|
||||
message: >
|
||||
{% if trigger.entity_id == 'input_select.clint_status_dropdown' %}
|
||||
input_select.clint_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.emmett_status_dropdown' %}
|
||||
input_select.emmett_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.bridget_status_dropdown' %}
|
||||
input_select.bridget_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.kristy_status_dropdown' %}
|
||||
input_select.kristy_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.marshall_status_dropdown' %}
|
||||
input_select.marshall_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.tess_status_dropdown' %}
|
||||
input_select.tess_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.ebin_status_dropdown' %}
|
||||
input_select.ebin_status_dropdown
|
||||
{% else %}
|
||||
input_select.guest_status_dropdown
|
||||
{% endif %}
|
||||
At least one of the kids is asleep. turning on kids_asleep
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.kids_asleep
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Kids Asleep
|
||||
entity_id: automation.kids_asleep
|
||||
message: >
|
||||
None of the kids were asleep, defaulted to turning off kids_asleep
|
||||
@@ -0,0 +1,216 @@
|
||||
alias: Kids Awake
|
||||
id: automation_kids_awake
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# Consider the kids awake if it is after 6:00AM and any of them that are home are also awake
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_is_awake
|
||||
- input_boolean.bridget_is_awake
|
||||
- input_boolean.ebin_is_awake
|
||||
- input_boolean.kids_away
|
||||
- binary_sensor.morning
|
||||
to: 'on'
|
||||
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.black_bed_occupied
|
||||
- binary_sensor.white_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- alias: "Kids should only be considered awake if they get out of bed after 6:00 AM and before 7:00 PM"
|
||||
condition: time
|
||||
before: '19:00:00'
|
||||
after: '06:00:00'
|
||||
- alias: "Go through all the kids that are considered home and see if their bed is occupied"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'unavailable'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'unavailable'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'unavailable'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'unavailable'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.kids_bedtime
|
||||
- input_boolean.kids_asleep
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'unavailable'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'unavailable'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'unavailable'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'unavailable'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
state: 'unavailable'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
state: 'unavailable'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: 'Manual'
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Away'
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.nursery_mode
|
||||
option: Auto
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
alias: Kids Away
|
||||
id: automation_kids_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.ebin_home
|
||||
to: 'off'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.kids_at_home
|
||||
to: 'off'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.ebin_home
|
||||
- binary_sensor.kids_at_home
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.kids_away
|
||||
@@ -0,0 +1,116 @@
|
||||
alias: Kids Away Videos On
|
||||
id: automation_kids_away_videos_on
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.kids_away
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: 'playing'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
state: 'PBS Kids'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
attribute: source
|
||||
state: 'PBS Kids'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
- condition: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
attribute: source
|
||||
state: 'PBS Kids'
|
||||
- condition: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: 'playing'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
state: 'PBS Kids'
|
||||
sequence:
|
||||
- service: media_player.select_source
|
||||
data:
|
||||
entity_id: media_player.front_room_tv
|
||||
source: Home
|
||||
- service: media_player.turn_off
|
||||
data:
|
||||
entity_id: media_player.front_room_tv
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
state: 'playing'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
attribute: source
|
||||
state: 'PBS Kids'
|
||||
sequence:
|
||||
- service: media_player.select_source
|
||||
data:
|
||||
entity_id: media_player.front_room_hub
|
||||
source: Home
|
||||
- service: media_player.turn_off
|
||||
data:
|
||||
entity_id: media_player.front_room_hub
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
state: 'playing'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
- condition: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
attribute: source
|
||||
state: 'PBS Kids'
|
||||
sequence:
|
||||
- service: media_player.select_source
|
||||
data:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
source: Home
|
||||
- service: media_player.turn_off
|
||||
data:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: Kids Returned
|
||||
id: automation_kids_returned
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.ebin_home
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_away
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.kids_away
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: 'Nearly Home'
|
||||
id: automation_nearly_home
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.garage_door
|
||||
- binary_sensor.front_door_contact
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
for: '00:10:00'
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.deck_light_level
|
||||
below: 25
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.sun_elevation
|
||||
below: 15
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.entryway_mode
|
||||
option: 'Auto'
|
||||
@@ -0,0 +1,27 @@
|
||||
alias: People Count Changed
|
||||
id: automation_people_count_changed
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.people_count
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: person.clint
|
||||
state: 'home'
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.people_count
|
||||
above: 0
|
||||
below: 2
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.clint_home_alone
|
||||
|
||||
default:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.clint_home_alone
|
||||
@@ -0,0 +1,102 @@
|
||||
alias: Person Arrived
|
||||
id: automation_person_arrived
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_home
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.kristy_home
|
||||
- input_boolean.marshall_home
|
||||
- input_boolean.tess_home
|
||||
- input_boolean.ebin_home
|
||||
- input_boolean.guest_home
|
||||
from: "off"
|
||||
to: "on"
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: >
|
||||
{% if trigger.entity_id == 'input_boolean.clint_home' %}
|
||||
input_select.clint_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.emmett_home' %}
|
||||
input_select.emmett_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.bridget_home' %}
|
||||
input_select.bridget_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.kristy_home' %}
|
||||
input_select.kristy_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.marshall_home' %}
|
||||
input_select.marshall_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.tess_home' %}
|
||||
input_select.tess_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.ebin_home' %}
|
||||
input_select.ebin_status_dropdown
|
||||
{% else %}
|
||||
input_select.guest_status_dropdown
|
||||
{% endif %}
|
||||
option: >
|
||||
{% if trigger.entity_id == 'input_boolean.kristy_home' %}
|
||||
{% if states.input_select.kristy_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% elif trigger.entity_id == 'input_boolean.marshall_home' %}
|
||||
{% if states.input_select.marshall_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% elif trigger.entity_id == 'input_boolean.clint_home' %}
|
||||
{% if states.input_select.clint_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% elif trigger.entity_id == 'input_boolean.emmett_home' %}
|
||||
{% if states.input_select.emmett_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% elif trigger.entity_id == 'input_boolean.bridget_home' %}
|
||||
{% if states.input_select.bridget_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% elif trigger.entity_id == 'input_boolean.ebin_home' %}
|
||||
{% if states.input_select.ebin_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% elif trigger.entity_id == 'input_boolean.tess_home' %}
|
||||
{% if states.input_select.tess_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if states.input_select.guest_status_dropdown.state == 'Just Left' %}
|
||||
Home
|
||||
{% else %}
|
||||
Just Arrived
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Person Arrived
|
||||
entity_id: automation.person_arrived
|
||||
message: >
|
||||
Person Arrived ran
|
||||
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.all_away
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.home_occupied
|
||||
@@ -0,0 +1,175 @@
|
||||
alias: Person Asleep
|
||||
id: automation_person_asleep
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
- input_boolean.emmett_in_bed
|
||||
- input_boolean.bridget_in_bed
|
||||
- input_boolean.kristy_in_bed
|
||||
- input_boolean.marshall_in_bed
|
||||
- input_boolean.tess_in_bed
|
||||
- input_boolean.ebin_in_bed
|
||||
- input_boolean.guest_in_bed
|
||||
to: 'On'
|
||||
for:
|
||||
minutes: 5
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
- input_boolean.emmett_is_awake
|
||||
- input_boolean.bridget_is_awake
|
||||
- input_boolean.kristy_is_awake
|
||||
- input_boolean.marshall_is_awake
|
||||
- input_boolean.tess_is_awake
|
||||
- input_boolean.ebin_is_awake
|
||||
- input_boolean.guest_is_awake
|
||||
to: 'off'
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.emmett_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.bridget_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.kristy_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.marshall_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.tess_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.ebin_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_in_bed
|
||||
state: 'on'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_is_awake
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.guest_is_awake
|
||||
@@ -0,0 +1,47 @@
|
||||
alias: Person Away
|
||||
id: automation_person_away
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.clint_status_dropdown
|
||||
- input_select.emmett_status_dropdown
|
||||
- input_select.bridget_status_dropdown
|
||||
- input_select.kristy_status_dropdown
|
||||
- input_select.marshall_status_dropdown
|
||||
- input_select.tess_status_dropdown
|
||||
- input_select.ebin_status_dropdown
|
||||
- input_select.guest_status_dropdown
|
||||
to: 'Just Left'
|
||||
for:
|
||||
minutes: 5
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: >
|
||||
{% if trigger.entity_id == 'input_select.clint_status_dropdown' %}
|
||||
input_select.clint_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.emmett_status_dropdown' %}
|
||||
input_select.emmett_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.bridget_status_dropdown' %}
|
||||
input_select.bridget_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.kristy_status_dropdown' %}
|
||||
input_select.kristy_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.marshall_status_dropdown' %}
|
||||
input_select.marshall_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.tess_status_dropdown' %}
|
||||
input_select.tess_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_select.ebin_status_dropdown' %}
|
||||
input_select.ebin_status_dropdown
|
||||
{% else %}
|
||||
input_select.guest_status_dropdown
|
||||
{% endif %}
|
||||
option: Away
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Person Away
|
||||
entity_id: automation.person_away
|
||||
message: >
|
||||
Person Away ran
|
||||
@@ -0,0 +1,51 @@
|
||||
alias: Person Extended Away
|
||||
id: automation_person_extended_away
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.clint_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.emmett_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.bridget_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.kristy_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.marshall_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.tess_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.ebin_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
- platform: state
|
||||
entity_id: input_select.guest_status_dropdown
|
||||
to: 'Away'
|
||||
for:
|
||||
hours: 24
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: >
|
||||
{{ trigger.entity_id }}
|
||||
option: Extended Away
|
||||
@@ -0,0 +1,35 @@
|
||||
alias: Person Home
|
||||
id: automation_person_home
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.clint_status_dropdown
|
||||
- input_select.emmett_status_dropdown
|
||||
- input_select.bridget_status_dropdown
|
||||
- input_select.kristy_status_dropdown
|
||||
- input_select.marshall_status_dropdown
|
||||
- input_select.tess_status_dropdown
|
||||
- input_select.ebin_status_dropdown
|
||||
to: 'Just Arrived'
|
||||
for:
|
||||
minutes: 5
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.clint_status_dropdown
|
||||
- input_select.emmett_status_dropdown
|
||||
- input_select.bridget_status_dropdown
|
||||
- input_select.kristy_status_dropdown
|
||||
- input_select.marshall_status_dropdown
|
||||
- input_select.tess_status_dropdown
|
||||
- input_select.ebin_status_dropdown
|
||||
- input_select.guest_status_dropdown
|
||||
from: 'Just Left'
|
||||
to: 'Just Arrived'
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: >
|
||||
{{ trigger.entity_id }}
|
||||
option: Home
|
||||
@@ -0,0 +1,47 @@
|
||||
alias: Person Left
|
||||
id: automation_person_left
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_home
|
||||
- input_boolean.emmett_home
|
||||
- input_boolean.bridget_home
|
||||
- input_boolean.kristy_home
|
||||
- input_boolean.marshall_home
|
||||
- input_boolean.tess_home
|
||||
- input_boolean.ebin_home
|
||||
- input_boolean.guest_home
|
||||
from: "on"
|
||||
to: "off"
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: >
|
||||
{% if trigger.entity_id == 'input_boolean.clint_home' %}
|
||||
input_select.clint_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.emmett_home' %}
|
||||
input_select.emmett_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.bridget_home' %}
|
||||
input_select.bridget_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.kristy_home' %}
|
||||
input_select.kristy_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.marshall_home' %}
|
||||
input_select.marshall_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.tess_home' %}
|
||||
input_select.tess_status_dropdown
|
||||
{% elif trigger.entity_id == 'input_boolean.ebin_home' %}
|
||||
input_select.ebin_status_dropdown
|
||||
{% else %}
|
||||
input_select.guest_status_dropdown
|
||||
{% endif %}
|
||||
option: Just Left
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Person Left
|
||||
entity_id: automation.person_left
|
||||
message: >
|
||||
Person Left ran
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
alias: Respond to Chickadee
|
||||
id: automation_respond_to_chickadee
|
||||
mode: single
|
||||
description: ""
|
||||
trigger:
|
||||
# - platform: state
|
||||
# entity_id: input_boolean.chickadee_is_waiting
|
||||
# from: 'off'
|
||||
# to: 'on'
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.chickadee_unread
|
||||
above: 0
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: group.podeins_at_home
|
||||
state: "off"
|
||||
action:
|
||||
- repeat:
|
||||
while:
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.chickadee_unread
|
||||
above: 0
|
||||
# - condition: state
|
||||
# entity_id: input_boolean.chickadee_is_waiting
|
||||
# state: 'on'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.kids_at_home
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: input_boolean.allow_announcements
|
||||
state: "on"
|
||||
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_audio_mode
|
||||
state: in_communication
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_audio_mode
|
||||
state: in_call
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
state: "on"
|
||||
|
||||
sequence:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
media_content_id: media-source://media_source/local/Sounds/tts/respond_to_chickadee.mp3
|
||||
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data:
|
||||
message: >-
|
||||
Chickadee is waiting to hear back on {{states('sensor.chickadee_unread')}} message(s)!
|
||||
title: Tweet tweet
|
||||
|
||||
- service: notify.hass_agent_group
|
||||
data:
|
||||
message: >-
|
||||
Chickadee is waiting to hear back on {{states('sensor.chickadee_unread')}} message(s)!
|
||||
title: Tweet tweet
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
message: >-
|
||||
Chickadee is waiting to hear back on {{states('sensor.chickadee_unread')}} message(s)!
|
||||
title: Tweet Tweet
|
||||
notification_id: 07111985
|
||||
|
||||
- delay:
|
||||
hours: 0
|
||||
minutes: 2
|
||||
seconds: 0
|
||||
milliseconds: 0
|
||||
|
||||
- service: persistent_notification.dismiss
|
||||
data:
|
||||
notification_id: 07111985
|
||||
@@ -0,0 +1,76 @@
|
||||
alias: Returned Home
|
||||
id: automation_returned_home
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.front_door_contact
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.garage_door
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.outer_garage_door
|
||||
to: 'on'
|
||||
# People just got home
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.clint_status_dropdown
|
||||
- input_select.emmett_status_dropdown
|
||||
- input_select.bridget_status_dropdown
|
||||
- input_select.kristy_status_dropdown
|
||||
- input_select.marshall_status_dropdown
|
||||
- input_select.tess_status_dropdown
|
||||
- input_select.ebin_status_dropdown
|
||||
- input_select.guest_status_dropdown
|
||||
to: 'Just Arrived'
|
||||
# Should also include some travel time magic here
|
||||
# Basically, travel time < 15 for 10 minutes, travelling towards home
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
# Lighting automations are enabled
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
# It's getting dark
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.bar_light_level
|
||||
below: 15
|
||||
# Somebody is nearly home, or just arrived
|
||||
- condition: or
|
||||
conditions:
|
||||
# Front door is open, somebody is nearly home or just arrived
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_door_contact
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.garage_door
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.outer_garage_door
|
||||
state: 'on'
|
||||
# Or somebody has just arrived
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.clint_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.emmett_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.bridget_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.kristy_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.marshall_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.tess_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.ebin_status_dropdown','Just Arrived') }}"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('input_select.guest_status_dropdown','Just Arrived') }}"
|
||||
action:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Returned Home
|
||||
entity_id: automation.returned_home
|
||||
message: >
|
||||
Returned Home ran
|
||||
@@ -0,0 +1,14 @@
|
||||
alias: 'Something open too warm or cold'
|
||||
id: automation_something_open_too_warm_or_cold
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.something_open_too_warm_or_cold
|
||||
to: 'on'
|
||||
|
||||
action:
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data:
|
||||
message: >-
|
||||
Its too hot or cold to leave these open: {{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_hvac_affecting_openings', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
||||
@@ -0,0 +1,57 @@
|
||||
alias: Teens Asleep
|
||||
id: automation_teens_asleep
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.marshall_is_awake
|
||||
- input_boolean.tess_is_awake
|
||||
- input_boolean.asleep
|
||||
to: 'off'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
data:
|
||||
entity_id: input_boolean.teens_asleep
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Teens Asleep
|
||||
entity_id: automation.teens_asleep
|
||||
message: >
|
||||
At least one of the teens is asleep. turning on teens_asleep
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.teens_asleep
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Teens Asleep
|
||||
entity_id: automation.teens_asleep
|
||||
message: >
|
||||
None of the teens were asleep, defaulted to turning off teens_asleep
|
||||
@@ -0,0 +1,85 @@
|
||||
alias: Teens Awake
|
||||
id: automation_teen_awake
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# Consider the kids awake if it is after 6:00AM and any of them that are home are also awake
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.marshall_is_awake
|
||||
- input_boolean.tess_is_awake
|
||||
- binary_sensor.morning
|
||||
to: 'on'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: time
|
||||
before: '19:00:00'
|
||||
after: '06:00:00'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.teens_bedtime
|
||||
- input_boolean.teens_asleep
|
||||
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.marshall_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.marshall_in_bed
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.marshall_is_awake
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_is_awake
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.tess_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.tess_in_bed
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.tess_is_awake
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: 'Vacation'
|
||||
id: automation_vacation
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_travelling
|
||||
- input_boolean.emmett_travelling
|
||||
- input_boolean.bridget_travelling
|
||||
to: 'on'
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_travelling
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_travelling
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_travelling
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.vacation_mode
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: 'Vacation over'
|
||||
id: automation_vacation_over
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.clint_travelling
|
||||
- input_boolean.emmett_travelling
|
||||
- input_boolean.bridget_travelling
|
||||
to: 'off'
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_travelling
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_travelling
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_travelling
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.vacation_mode
|
||||
Reference in New Issue
Block a user