Improve resetting of lighting during the night, close #93

This commit is contained in:
2023-08-13 20:57:57 -04:00
parent 386caa335d
commit 4d7cd8e576
2 changed files with 135 additions and 17 deletions

View File

@ -888,14 +888,22 @@
entity_id: light.living_room_lights entity_id: light.living_room_lights
alias: Brightness Down Small alias: Brightness Down Small
off_short_action: off_short_action:
- if: - choose:
- condition: state - conditions:
entity_id: binary_sensor.early_night_mode - condition: state
state: 'on' entity_id: binary_sensor.early_night_mode
then: state: 'on'
- service: script.evening_on_first_floor sequence:
data: {} - service: script.evening_on_first_floor
else: data: {}
- conditions:
- condition: state
entity_id: input_boolean.goodnight
state: 'on'
sequence:
- service: script.goodnight_on_first_floor
data: {}
default:
- service: light.turn_off - service: light.turn_off
data: {} data: {}
target: target:
@ -1025,18 +1033,41 @@
target: target:
entity_id: input_boolean.emma_sleeping entity_id: input_boolean.emma_sleeping
off_short_action: off_short_action:
- if: - choose:
- condition: state - conditions:
entity_id: binary_sensor.early_night_mode - condition: state
state: 'on' entity_id: binary_sensor.early_night_mode
then: state: 'on'
- service: script.evening_on_second_floor sequence:
data: {} - service: script.evening_on_second_floor
else: data: {}
- conditions:
- condition: state
entity_id: input_boolean.goodnight
state: 'on'
sequence:
- service: script.goodnight_on_second_floor
data: {}
default:
- service: light.turn_off - service: light.turn_off
data: {} data: {}
target: target:
entity_id: light.second_floor_lights area_id:
- emma_bedroom
- kallen_bedroom
- master_bedroom
- master_bedroom_closet
- upstairs_hallway
- if:
- condition: template
value_template: '{{ is_state(''timer.upstairs_bathroom_motion_timer'',''idle'')
and is_state(''binary_sensor.upstairs_bathroom_motion'',''off'') and
is_state(''light.upstairs_bathroom_lights'',''on'') }}'
then:
- service: light.turn_off
data: {}
target:
entity_id: light.upstairs_bathroom_lights
- id: '1682561310614' - id: '1682561310614'
alias: Kallen Bedroom Switch Handler alias: Kallen Bedroom Switch Handler
description: '' description: ''

View File

@ -1715,6 +1715,93 @@ script:
data: data:
value: Adaptive value: Adaptive
goodnight_in_basement:
alias: 'Goodnight in Basement'
sequence:
- service: light.turn_off
target:
area_id:
- basement_studio
- furnace_room
- service: fan.turn_off
target:
entity_id: fan.basement_fan
goodnight_on_first_floor:
alias: 'Goodnight on First Floor'
sequence:
- if:
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
then:
- service: light.turn_off
target:
area_id:
- dining_room
- downstairs_bathroom
- living_room
- tina_desk
- service: input_select.select_option
target:
entity_id: input_select.mud_room_scenes
data:
option: Nightlight
else:
- service: light.turn_off
target:
area_id:
- dining_room
- downstairs_bathroom
- living_room
- mud_room
- tina_desk
goodnight_on_second_floor:
alias: 'Goodnight on Second Floor'
sequence:
- service: light.turn_off
target:
area_id:
- emma_bedroom
- kallen_bedroom
- master_bedroom
- master_bedroom_closet
- if:
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
then:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_hallway_scenes
data:
option: Nightlight
else:
- service: light.turn_off
target:
entity_id: light.hallway_overhead
- if:
- condition: state
entity_id: input_boolean.kallen_overnight
state: 'on'
then:
- service: light.turn_off
target:
area_id: upstairs_bathroom
else:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: Single Nightlight
- service: light.turn_on
target:
entity_id: light.stairwell_led_strip
data:
color_temp_kelvin: 2000
brightness: 50
morning_scene: morning_scene:
alias: 'Morning Scene' alias: 'Morning Scene'
sequence: sequence: