Files
fresh-home/automations/rooms/nursery/nursery_out_of_bed.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

166 lines
4.4 KiB
YAML

alias: Nursery Out of Bed
id: automation_nursery_out_of_bed
mode: single
# Hide warnings when triggered while in delay.
max_exceeded: silent
trigger:
- platform: template
value_template: "{% if is_state('binary_sensor.nursery_door_person_occupancy','on') and is_state('binary_sensor.nursery_door','off')%}true{%endif%}"
- platform: state
entity_id: binary_sensor.black_bed_occupied
from: "on"
to: "off"
for: "00:00:05"
- platform: state
entity_id: input_boolean.white_bed_occupied
from: "on"
to: "off"
for: "00:00:05"
- platform: state
entity_id: binary_sensor.nursery_door
from: "off"
to: "on"
condition:
- alias: "Do we want to be alerted?"
condition: state
entity_id: input_boolean.out_of_bed_alert
state: "on"
- alias: "Is the home occupied or in guest mode?"
condition: or
conditions:
- condition: state
entity_id: input_boolean.home_occupied
state: "on"
- condition: state
entity_id: input_boolean.guest_mode
state: "on"
- alias: "Are any of the kids considered home?"
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"
- alias: "Is at a time of day when the kids should be sleeping?"
condition: or
conditions:
- condition: state
entity_id: binary_sensor.evening
state: "on"
- condition: state
entity_id: binary_sensor.late_evening
state: "on"
- condition: state
entity_id: binary_sensor.night
state: "on"
- condition: state
entity_id: binary_sensor.early_morning
state: "on"
- alias: "Is Nursery Light Cycle turned off?"
condition: state
entity_id: input_boolean.nursery_light_cycle
state: "off"
- alias: "Are the kids asleep?"
condition: state
entity_id: input_boolean.kids_asleep
state: "on"
- alias: "Is an adult awake?"
condition: state
entity_id: binary_sensor.adults_asleep
state: "off"
variables:
computer_area: "{{ states('binary_sensor.computer_area_person_occupancy') }}"
front_room: "{{ states('binary_sensor.front_room_person_occupancy') }}"
entryway: "{{ states('input_boolean.entryway_occupied') }}"
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.garage_occupied
state: "on"
sequence:
- service: script.blink_garage_lights
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.computer_area_occupied
state: "on"
sequence:
- service: webrtc.dash_cast
data:
entity_id: media_player.computer_area_hub
url: rtsp_cam08_sub
force: true
extra:
mode: webrtc
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.front_room_occupied
state: "on"
sequence:
- service: webrtc.dash_cast
data:
entity_id: media_player.front_room_hub
url: rtsp_cam08_sub
force: true
extra:
mode: webrtc
- delay: "00:10:00"
- service: media_player.turn_off
entity_id: media_player.front_room_hub, media_player.computer_area_hub
# - alias: "Flash some lights"
# repeat:
# count: 6
# sequence:
# - delay: 1
# - service: light.toggle
# target:
# entity_id:
# - light.entryway_hue
# - light.computer_area_hue
# - light.front_room_hue
#- delay: '00:00:02'
# - alias: "Fix computer area lights"
# service: automation.trigger
# target:
# entity_id: "automation.computer_area_lights_to_{{ computer_area }}"
# data:
# skip_condition: true
# - alias: "Fix front room lights"
# service: automation.trigger
# target:
# entity_id: "automation.front_room_lights_to_{{ front_room }}"
# data:
# skip_condition: true
# - alias: "Fix entryway lights"
# service: automation.trigger
# target:
# entity_id: "automation.entryway_lights_to_{{ entryway }}"
# data:
# skip_condition: true