mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
initial push
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user