mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
120 lines
3.2 KiB
YAML
120 lines
3.2 KiB
YAML
alias: Boys Room Out of Bed
|
|
id: automation_boys_room_out_of_bed
|
|
mode: single
|
|
# Hide warnings when triggered while in delay.
|
|
max_exceeded: silent
|
|
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: binary_sensor.white_bed_occupied
|
|
from: "on"
|
|
to: "off"
|
|
for: "00:00:03"
|
|
- trigger: state
|
|
entity_id: binary_sensor.boys_room_door_contact
|
|
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 Boys Room Light Cycle turned off?"
|
|
condition: state
|
|
entity_id: input_boolean.girls_room_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:
|
|
- action: script.blink_garage_lights
|
|
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.computer_area_occupied
|
|
state: "on"
|
|
sequence:
|
|
- action: dash_cast.load_url
|
|
data:
|
|
entity_id: media_player.computer_area_hub
|
|
force: true
|
|
url: http://192.168.1.7:1984/stream.html?src=boys_room_cam
|
|
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.front_room_occupied
|
|
state: "on"
|
|
sequence:
|
|
- action: dash_cast.load_url
|
|
data:
|
|
entity_id: media_player.front_room_hub
|
|
force: true
|
|
url: http://192.168.1.7:1984/stream.html?src=boys_room_cam
|
|
|
|
- delay: "00:10:00"
|
|
|
|
- action: media_player.turn_off
|
|
entity_id: media_player.front_room_hub, media_player.computer_area_hub
|