Files
fresh-home/automations/people/kids_awake.yaml
T
CeeWeasel 4e0e55ac3c Refactor bed occupancy sensors and related automations
- Updated nursery automation to use input booleans for bed occupancy instead of binary sensors.
- Changed conditions in nursery automation to improve readability and consistency.
- Modified binary sensor configurations for master bedroom and nursery to use input booleans.
- Removed unused input number configurations related to master bed load cells.
- Updated UI configurations to reflect changes in entity types from binary sensors to input booleans.
- Cleaned up camera view configurations and adjusted styles for better layout.
- Removed deprecated master bed YAML configuration and archived it for future reference.
- Enhanced ESPHome configurations for white and black beds, including improved logging and diagnostics.
2025-07-19 13:37:45 -04:00

215 lines
7.1 KiB
YAML

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
- input_boolean.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: input_boolean.white_bed_occupied
state: "off"
- condition: state
entity_id: input_boolean.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: input_boolean.white_bed_occupied
state: "off"
- condition: state
entity_id: input_boolean.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: input_boolean.white_bed_occupied
state: "off"
- condition: state
entity_id: input_boolean.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: input_boolean.white_bed_occupied
state: "off"
- condition: state
entity_id: input_boolean.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: input_boolean.white_bed_occupied
state: "off"
- condition: state
entity_id: input_boolean.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