Compare commits
4 Commits
2025.5.0
...
stairwell-
Author | SHA1 | Date | |
---|---|---|---|
2c990944d3
|
|||
14ebbe38f9
|
|||
ad196dfbf7
|
|||
f2f253b135
|
140
automations.yaml
140
automations.yaml
@ -5314,6 +5314,146 @@
|
||||
data:
|
||||
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0)
|
||||
}}
|
||||
- id: '1716580842614'
|
||||
alias: Stairwell and Hallway Motion Lighting
|
||||
description: ''
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.stairwell_top_motion
|
||||
to: 'on'
|
||||
from: 'off'
|
||||
id: top-detected
|
||||
alias: Stairwell Top Detected
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.stairwell_bottom_motion
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
id: bottom-detected
|
||||
alias: Stairwell Bottom Detected
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.stairwell_top_motion
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
id: top-clear
|
||||
alias: Stairwell Top Clear
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.stairwell_bottom_motion
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
id: bottom-clear
|
||||
alias: Stairwell Bottom Clear
|
||||
- platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.stairwell_motion_timer
|
||||
id: stairwell-timer
|
||||
alias: Stairwell Timer Finished
|
||||
- alias: Hallway Timer Finished
|
||||
platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.upstairs_hallway_motion_timer
|
||||
id: hallway-timer
|
||||
condition: []
|
||||
action:
|
||||
- variables:
|
||||
hallway_scene: "{% set people_sleeping = is_state('input_boolean.emma_sleeping','on')
|
||||
or is_state('input_boolean.kallen_sleeping','on') or is_state('input_boolean.master_bedroom_sleeping','on')
|
||||
%} {% if is_state('input_boolean.night_mode','on') or people_sleeping == true
|
||||
%}\n Nightlight\n{% else %}\n Adaptive\n{% endif %}\n"
|
||||
hallway_action: "{% set people_sleeping = is_state('input_boolean.emma_sleeping','on')
|
||||
or is_state('input_boolean.kallen_sleeping','on') or is_state('input_boolean.master_bedroom_sleeping','on')
|
||||
%} {% if is_state('input_boolean.goodnight','on') %}\n off\n{% elif is_state('input_boolean.night_mode','on')
|
||||
or people_sleeping == true or is_state('binary_sensor.early_night_mode','on')
|
||||
%}\n on\n{% else %}\n off\n{% endif %}\n"
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- top-detected
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.stairwell_top_illuminance
|
||||
below: input_number.upstairs_hallway_lux_threshold
|
||||
alias: Stairwell Top Illuminance is below lux threshold
|
||||
sequence: []
|
||||
alias: Stairwell Top Detected
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- bottom-detected
|
||||
- alias: Stairwell Bottom Illuminance is below lux threshold
|
||||
condition: numeric_state
|
||||
entity_id: sensor.stairwell_bottom_illuminance
|
||||
below: input_number.stairwell_lux_threshold
|
||||
sequence: []
|
||||
alias: Stairwell Bottom Detected
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- top-clear
|
||||
- alias: Lights are on
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: light.hallway_overhead
|
||||
state: 'on'
|
||||
alias: Hallway Overhead
|
||||
- alias: Stairwell LED Strip
|
||||
condition: state
|
||||
entity_id: light.stairwell_led_strip
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: timer.start
|
||||
metadata: {}
|
||||
data:
|
||||
duration: '{{ states(''input_number.upstairs_hallway_lights_off_delay'')
|
||||
| int * 60 }}'
|
||||
target:
|
||||
entity_id: timer.upstairs_hallway_motion_timer
|
||||
alias: Start upstairs hallway motion timer
|
||||
alias: Stairwell Top Clear
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- bottom-clear
|
||||
- alias: Lights are on
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: light.hallway_overhead
|
||||
state: 'on'
|
||||
alias: Hallway Overhead
|
||||
- alias: Stairwell LED Strip
|
||||
condition: state
|
||||
entity_id: light.stairwell_led_strip
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: timer.start
|
||||
metadata: {}
|
||||
data:
|
||||
duration: '{{ states(''input_number.stairwell_lights_off_delay'') | int
|
||||
* 60 }}'
|
||||
target:
|
||||
entity_id: timer.stairwell_motion_timer
|
||||
alias: Start stairwell motion timer
|
||||
alias: Stairwell Bottom Clear
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- hallway-timer
|
||||
sequence: []
|
||||
alias: Hallway Timer Finished
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- stairwell-timer
|
||||
sequence: []
|
||||
alias: Stairwell Timer Finished
|
||||
mode: restart
|
||||
|
||||
'
|
||||
alias: Set time morning meds were taken
|
||||
|
@ -44,6 +44,12 @@ input_boolean:
|
||||
adaptive_lighting_adjustments:
|
||||
name: Adaptive Lighting Adjustments
|
||||
icon: mdi:knob
|
||||
upstairs_hallway_motion_lighting:
|
||||
name: Upstairs Hallway Motion Lighting
|
||||
icon: mdi:motion-sensor
|
||||
stairwell_motion_lighting:
|
||||
name: Stairwell Motion Lighting
|
||||
icon: mdi:motion-sensor
|
||||
|
||||
input_number:
|
||||
upstairs_bathroom_motion_off_delay:
|
||||
|
53
scripts.yaml
53
scripts.yaml
@ -108,12 +108,27 @@ global_on:
|
||||
max_brightness:
|
||||
sequence:
|
||||
- alias: Turn off Adaptive Lighting and Motion Lighting
|
||||
data: {}
|
||||
target:
|
||||
label_id:
|
||||
- adaptive_lighting
|
||||
- motion_lighting
|
||||
action: switch.turn_off
|
||||
parallel:
|
||||
- service: automation.turn_off
|
||||
metadata: {}
|
||||
data:
|
||||
stop_actions: true
|
||||
target:
|
||||
label_id: motion_lighting
|
||||
alias: Automations
|
||||
- alias: Switches
|
||||
service: switch.turn_off
|
||||
data: {}
|
||||
target:
|
||||
label_id:
|
||||
- adaptive_lighting
|
||||
- motion_lighting
|
||||
- service: input_boolean.turn_off
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
label_id: motion_lighting
|
||||
alias: Input Booleans
|
||||
- delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
@ -463,12 +478,26 @@ max_brightness_cleanup:
|
||||
target:
|
||||
entity_id: input_select.basement_studio_scenes
|
||||
alias: Set basement lights to adaptive
|
||||
- service: switch.turn_on
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
label_id: motion_lighting
|
||||
alias: Turn on motion lighting
|
||||
- alias: Turn on motion lighting
|
||||
parallel:
|
||||
- service: input_boolean.turn_on
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
label_id: motion_lighting
|
||||
alias: Input Booleans
|
||||
- service: switch.turn_on
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
label_id: motion_lighting
|
||||
alias: Switches
|
||||
- service: automation.turn_on
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
label_id: motion_lighting
|
||||
alias: Automations
|
||||
mode: single
|
||||
icon: mdi:broom
|
||||
cleanup_crash:
|
||||
|
Reference in New Issue
Block a user