mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
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
|