Compare commits
8 Commits
2025.3.2
...
stairwell-
Author | SHA1 | Date | |
---|---|---|---|
2c990944d3
|
|||
14ebbe38f9
|
|||
ad196dfbf7
|
|||
f2f253b135
|
|||
49f9e99439
|
|||
6254fb5953
|
|||
334b7963e8
|
|||
4466b17df1
|
@ -1 +1 @@
|
||||
2025.3.2
|
||||
2025.3.3
|
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
|
||||
|
@ -321,6 +321,9 @@ influxdb:
|
||||
- sensor.dimmest_room
|
||||
- sensor.warmest_room_temperature
|
||||
- sensor.coldest_room_temperature
|
||||
- sensor.national_tornado_warnings
|
||||
- sensor.national_severe_thunderstorm_warnings
|
||||
- binary_sensor.severe_thunderstorm_warning
|
||||
|
||||
logbook:
|
||||
include:
|
||||
@ -498,3 +501,6 @@ prometheus:
|
||||
- sensor.dimmest_room
|
||||
- sensor.warmest_room_temperature
|
||||
- sensor.coldest_room_temperature
|
||||
- sensor.national_tornado_warnings
|
||||
- sensor.national_severe_thunderstorm_warnings
|
||||
- binary_sensor.severe_thunderstorm_warning
|
||||
|
@ -19,6 +19,17 @@
|
||||
{% if type in ['alerts','full'] %}
|
||||
{% if is_state('input_boolean.tornado_alarm','on') %}
|
||||
We are under a tornado warning. If you are not already in shelter, you should be. Get on it!
|
||||
{% if state_attr('binary_sensor.tornado_warning','confirmed' == true) %}
|
||||
A tornado has been confirmed in the area. Please take shelter immediately!
|
||||
{% endif %}
|
||||
{% elif is_state('binary_sensor.severe_thunderstorm_warning','on') %}
|
||||
We are under a severe thunderstorm warning.
|
||||
{% if state_attr('binary_sensor.severe_thunderstorm_warning','tornado_possible' == true) %}
|
||||
The incoming storm has the potential to produce a tornado, so please pay attention and prepare to take shelter!
|
||||
{% endif %}
|
||||
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive' == true) %}
|
||||
This storm has the potential to cause considerable damage. Please take shelter and stay safe!
|
||||
{% endif %}
|
||||
{% elif states('sensor.weatheralerts_active_alerts') > '0' and method != 'dashboard' %}
|
||||
Current weather alerts: {{ states('sensor.weather_alert_string') }}.
|
||||
{% endif %}
|
||||
@ -49,6 +60,17 @@
|
||||
{% endif %}
|
||||
{% if is_state('input_boolean.tornado_alarm','on') %}
|
||||
"We are under a tornado warning. If you are not already in shelter, you should be. Get on it! "
|
||||
{% if state_attr('binary_sensor.tornado_warning','confirmed' == true) %}
|
||||
"A tornado has been confirmed in the area. Please take shelter immediately! "
|
||||
{% endif %}
|
||||
{% elif is_state('binary_sensor.severe_thunderstorm_warning','on') %}
|
||||
"We are under a severe thunderstorm warning. "
|
||||
{% if state_attr('binary_sensor.severe_thunderstorm_warning','tornado_possible' == true) %}
|
||||
"The incoming storm has the potential to produce a tornado, so please pay attention and prepare to take shelter! "
|
||||
{% endif %}
|
||||
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive' == true) %}
|
||||
"This storm has the potential to cause considerable damage. Please take shelter and stay safe! "
|
||||
{% endif %}
|
||||
{% elif is_state('input_boolean.tornado_watch','on') %}
|
||||
{{ [
|
||||
"There is currently a tornado watch active. Please keep an eye on the sky and your local weather reports. ",
|
||||
|
@ -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