Tweak how night mode is handled when K wakes up on a school day

Missed a condition
This commit is contained in:
2023-03-29 16:28:10 -04:00
parent 36a59f54c5
commit 0b6c1246a6
2 changed files with 86 additions and 47 deletions

View File

@ -74,6 +74,14 @@ automation:
- condition: trigger - condition: trigger
id: wakeup id: wakeup
sequence: sequence:
- if:
- condition: state
entity_id: input_booolean.night_mode
state: 'on'
then:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.night_mode
- service: input_boolean.turn_off - service: input_boolean.turn_off
target: target:
entity_id: input_boolean.kallen_sleeping entity_id: input_boolean.kallen_sleeping
@ -251,7 +259,9 @@ script:
sequence: sequence:
- service: light.turn_on - service: light.turn_on
target: target:
entity_id: light.kallen_bedroom_lights entity_id:
- light.kallen_bedroom_lights
- light.living_room_lights
- conditions: - conditions:
- condition: state - condition: state
entity_id: input_boolean.kallen_school_today entity_id: input_boolean.kallen_school_today

View File

@ -65,6 +65,13 @@ input_number:
step: 1 step: 1
unit_of_measurement: minutes unit_of_measurement: minutes
icon: mdi:timer icon: mdi:timer
living_room_lights_off_delay:
name: Living Room Lights Off Delay
min: 0
max: 30
step: 1
unit_of_measurement: minutes
icon: mdi:timer
input_select: input_select:
living_room_scenes: living_room_scenes:
@ -413,56 +420,78 @@ automation:
- id: 477e6e8a-4e33-4268-8c2d-f39902c0d64f - id: 477e6e8a-4e33-4268-8c2d-f39902c0d64f
alias: Living Room Night Lighting alias: Living Room Night Lighting
description: Provide lighting in case anyone needs to go downstairs in the middle of the night. description: Provide lighting in case anyone needs to go downstairs in the middle of the night.
mode: restart
trigger: trigger:
- platform: state - platform: state
entity_id: binary_sensor.living_room_motion entity_id: binary_sensor.living_room_motion
from: 'off' from: 'off'
to: 'on' to: 'on'
id: motion-on id: motion-on
- platform: state - platform: state
entity_id: binary_sensor.living_room_motion entity_id: binary_sensor.living_room_motion
from: 'on' from: 'on'
to: 'off' to: 'off'
for: id: motion-off
hours: 0 - platform: event
minutes: 10 event_type: timer.finished
seconds: 0 event_data:
id: motion-off entity_id: timer.living_room_motion_timer
id: timer-finished
condition: condition:
- condition: state - condition: state
entity_id: binary_sensor.people_present entity_id: binary_sensor.people_present
state: 'on' state: 'on'
- condition: state - condition: state
entity_id: input_boolean.night_mode entity_id: input_boolean.vacation_mode
state: 'on' state: 'off'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
action: action:
- if: - choose:
- conditions:
- condition: and
conditions:
- condition: trigger
id: motion-on
- condition: state
entity_id: input_boolean.night_mode
state: 'on'
sequence:
- service: timer.cancel
target:
entity_id: timer.living_room_motion_timer
- service: light.turn_on
target:
entity_id: light.first_floor_lights
- service: input_select.select_option
target:
entity_id:
- input_select.living_room_scenes
- input_select.tina_lamp_scenes
- input_select.mud_room_scenes
- input_select.downstairs_bathroom_scenes
- input_select.dining_room_lamp_scenes
data:
option: Adaptive
- conditions:
- condition: and
conditions:
- condition: trigger
id: motion-off
- condition: state
entity_id: input_boolean.night_mode
state: 'on'
sequence:
- service: timer.start
target:
entity_id: timer.living_room_motion_timer
data:
duration: "{{ (states('input_number.living_room_lights_off_delay') | int ) * 60 }}"
- conditions:
- condition: trigger - condition: trigger
id: motion-on id: timer-finished
then: sequence:
- service: light.turn_on - service: light.turn_off
target: target:
entity_id: light.first_floor_lights entity_id: light.living_room_lights
- service: input_select.select_option
target:
entity_id:
- input_select.living_room_scenes
- input_select.tina_lamp_scenes
- input_select.mud_room_scenes
- input_select.downstairs_bathroom_scenes
- input_select.dining_room_lamp_scenes
data:
option: Adaptive
- if:
- condition: trigger
id: motion-off
then:
- service: light.turn_off
target:
entity_id: light.first_floor_lights
- id: b897d714-bbf2-44ce-afaf-63cf3694351c - id: b897d714-bbf2-44ce-afaf-63cf3694351c
alias: Tina Desk Lights Handler alias: Tina Desk Lights Handler