mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
Setting up Emmetts Room
This commit is contained in:
@@ -5,7 +5,7 @@ mode: restart
|
||||
|
||||
trigger:
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: "on"
|
||||
for: "00:10:00"
|
||||
- trigger: state
|
||||
@@ -22,17 +22,12 @@ condition:
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.white_bed_occupied
|
||||
- binary_sensor.black_bed_occupied
|
||||
state: "on"
|
||||
for: "00:10:00"
|
||||
for: "00:05:00"
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
state: "off"
|
||||
#- condition: state
|
||||
# entity_id: binary_sensor.white_bed_occupied
|
||||
# state: 'on'
|
||||
# for:
|
||||
# minutes: 5
|
||||
|
||||
action:
|
||||
- action: homeassistant.turn_on
|
||||
|
||||
@@ -4,7 +4,7 @@ mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:10:00'
|
||||
- platform: state
|
||||
@@ -21,7 +21,7 @@ condition:
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.black_bed_occupied
|
||||
- binary_sensor.white_bed_occupied
|
||||
state: 'on'
|
||||
for: '00:10:00'
|
||||
- condition: state
|
||||
|
||||
@@ -9,7 +9,7 @@ trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- group.person_kristy
|
||||
- device_tracker.kristy_s_phone
|
||||
- device_tracker.nmap_tracker_d6_28_7a_58_b8_da
|
||||
to: 'home'
|
||||
|
||||
- platform: event
|
||||
|
||||
@@ -151,28 +151,52 @@ action:
|
||||
- delay: "00:05:00"
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.emmett_home','on') or is_state('input_boolean.bridget_home','on')}}"
|
||||
- conditions: "{{is_state('input_boolean.bridget_home','on')}}"
|
||||
sequence:
|
||||
- service: input_button.press
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_button.nursery_bedtime
|
||||
|
||||
- delay: "00:45:00"
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Running Rainbow
|
||||
target:
|
||||
entity_id: input_select.nursery_wled
|
||||
|
||||
# - service: automation.trigger
|
||||
# target:
|
||||
# entity_id: automation.nursery_wled_changed
|
||||
|
||||
# - choose:
|
||||
# - conditions: "{{is_state('input_boolean.bridget_home','on')}}"
|
||||
# sequence:
|
||||
# - service: input_boolean.turn_on
|
||||
# data: {}
|
||||
# target:
|
||||
# entity_id: input_boolean.nursery_asleep
|
||||
|
||||
# - delay: "00:00:05"
|
||||
|
||||
# - choose:
|
||||
# - conditions: "{{is_state('media_player.ytube_music_player','on')}}"
|
||||
# sequence:
|
||||
# - service: media_player.turn_off
|
||||
# target:
|
||||
# entity_id: media_player.ytube_music_player
|
||||
|
||||
- delay: "00:25:00"
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.emmett_home','on') or is_state('input_boolean.bridget_home','on')}}"
|
||||
- conditions: "{{is_state('input_boolean.emmett_home','on')}}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
entity_id: input_boolean.blue_room_asleep
|
||||
|
||||
- delay: "00:00:05"
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('media_player.ytube_music_player','on')}}"
|
||||
sequence:
|
||||
- service: media_player.turn_off
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: media_player.ytube_music_player
|
||||
entity_id: input_select.blue_room_mode
|
||||
data:
|
||||
option: "Nightlight"
|
||||
@@ -0,0 +1,44 @@
|
||||
alias: Blue Room Into Bed
|
||||
id: automation_blue_room_into_bed
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: "on"
|
||||
for: "00:00:10"
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: "on"
|
||||
- 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"
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: input_select.blue_room_mode
|
||||
state: "Nightlight"
|
||||
- condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: "on"
|
||||
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
entity_id:
|
||||
- light.blue_room_closet
|
||||
@@ -0,0 +1,157 @@
|
||||
alias: Blue Room Out of Bed
|
||||
id: automation_blue_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.blue_room_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:
|
||||
- action: script.blink_garage_lights
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.computer_area_occupied
|
||||
state: "on"
|
||||
sequence:
|
||||
- action: webrtc.dash_cast
|
||||
data:
|
||||
entity_id: media_player.computer_area_hub
|
||||
url: rtsp_cam01_sub
|
||||
force: true
|
||||
extra:
|
||||
mode: webrtc
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_room_occupied
|
||||
state: "on"
|
||||
sequence:
|
||||
- action: webrtc.dash_cast
|
||||
data:
|
||||
entity_id: media_player.front_room_hub
|
||||
url: rtsp_cam01_sub
|
||||
force: true
|
||||
extra:
|
||||
mode: webrtc
|
||||
|
||||
- delay: "00:10:00"
|
||||
|
||||
- action: 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
|
||||
@@ -0,0 +1,12 @@
|
||||
alias: Blue Room White Noise Off
|
||||
id: automation_blue_room_white_noise_off
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.blue_room_asleep
|
||||
to: "off"
|
||||
|
||||
action:
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
alias: Blue Room White Noise On
|
||||
id: automation_blue_room_white_noise_on
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.blue_room_asleep
|
||||
to: "on"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
state: "playing"
|
||||
sequence:
|
||||
- service: media_player.media_stop
|
||||
target:
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
|
||||
- action: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.30
|
||||
target:
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
|
||||
|
||||
#- service: script.goodnight_kids_youtube_music
|
||||
|
||||
- action: media_player.shuffle_set
|
||||
metadata: {}
|
||||
data:
|
||||
shuffle: false
|
||||
target:
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
- action: media_player.repeat_set
|
||||
metadata: {}
|
||||
data:
|
||||
repeat: "all"
|
||||
target:
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
- action: music_assistant.play_media
|
||||
metadata: {}
|
||||
data:
|
||||
media_id: library://track/101
|
||||
media_type: track
|
||||
enqueue: replace
|
||||
target:
|
||||
entity_id: media_player.ma_blue_room_clock
|
||||
|
||||
@@ -14,15 +14,15 @@ action:
|
||||
target:
|
||||
entity_id: input_select.nursery_mode
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Running Rainbow
|
||||
target:
|
||||
entity_id: input_select.nursery_wled
|
||||
# - service: input_select.select_option
|
||||
# data:
|
||||
# option: Running Rainbow
|
||||
# target:
|
||||
# entity_id: input_select.nursery_wled
|
||||
|
||||
- service: automation.trigger
|
||||
target:
|
||||
entity_id: automation.nursery_wled_changed
|
||||
# - service: automation.trigger
|
||||
# target:
|
||||
# entity_id: automation.nursery_wled_changed
|
||||
|
||||
#- condition:
|
||||
- alias: "Do not restart the music if it is already playing"
|
||||
@@ -38,20 +38,20 @@ action:
|
||||
data:
|
||||
volume_level: 0.4
|
||||
target:
|
||||
device_id: be28c87a729c28b9b27b540589895e20
|
||||
entity_id: media_player.ma_nursery_hub
|
||||
|
||||
#- service: script.goodnight_kids_youtube_music
|
||||
- action: media_player.shuffle_set
|
||||
data:
|
||||
shuffle: false
|
||||
target:
|
||||
device_id: be28c87a729c28b9b27b540589895e20
|
||||
entity_id: media_player.ma_nursery_hub
|
||||
|
||||
- action: media_player.repeat_set
|
||||
data:
|
||||
repeat: all
|
||||
target:
|
||||
device_id: be28c87a729c28b9b27b540589895e20
|
||||
entity_id: media_player.ma_nursery_hub
|
||||
|
||||
- action: music_assistant.play_media
|
||||
data:
|
||||
@@ -59,4 +59,4 @@ action:
|
||||
media_type: playlist
|
||||
enqueue: replace
|
||||
target:
|
||||
device_id: be28c87a729c28b9b27b540589895e20
|
||||
entity_id: media_player.ma_nursery_hub
|
||||
@@ -5,12 +5,7 @@ trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: "on"
|
||||
for: "00:00:30"
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: "on"
|
||||
for: "00:00:30"
|
||||
|
||||
for: "00:00:10"
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
|
||||
Reference in New Issue
Block a user