Wakeup lights fading in is now a variable

This commit is contained in:
2023-05-01 16:42:15 -04:00
parent ab991a19f5
commit 2897a15396
4 changed files with 84 additions and 10 deletions

Submodule node-red/projects/NerdFlows updated: a0432e373b...4c357d5b73

View File

@ -321,7 +321,9 @@ script:
entity_id: light.emma_bedroom_light
data:
brightness_pct: "{{ brightness }}"
transition: 300
transition: >
{% from 'time.jinja' import timer_duration %}
{{ timer_duration('input_number.wakeup_lights_fade_night') }}
- service: light.turn_on
target:
entity_id: light.hallway_overhead
@ -347,10 +349,20 @@ script:
entity_id: light.emma_bedroom_light
data:
brightness_pct: "{{ brightness }}"
transition: 60
transition: >
{% from 'time.jinja' import timer_duration %}
{{ timer_duration('input_number.wakeup_lights_fade_day') }}
# Climate/White Noise
- delay:
minutes: 5
- if:
- condition: state
entity_id: binary_sensor.early_night_mode
state: 'off'
then:
- delay:
minutes: 5
else:
- delay:
minutes: "{{ states('input_boolean.wakeup_lights_fade_night') }}"
- service: input_boolean.turn_off
target:
entity_id: input_boolean.white_noise_emma_bedroom

View File

@ -72,6 +72,20 @@ input_number:
step: 1
unit_of_measurement: minutes
icon: mdi:timer
wakeup_lights_fade_day:
name: Wakeup Lights Fade Day
min: 0
max: 15
step: 1
unit_of_measurement: minutes
icon: mdi:timer
wakeup_lights_fade_night:
name: Wakeup Lights Fade Night
min: 0
max: 15
step: 1
unit_of_measurement: minutes
icon: mdi:timer
input_select:
living_room_scenes:

View File

@ -82,6 +82,8 @@ script:
alias: 'Master Bedroom Wakeup'
mode: restart
sequence:
- variables:
brightness: "{{ state_attr('switch.adaptive_lighting_master_bedroom','brightness_pct') }}"
- service: button.press
target:
entity_id: button.master_bedroom_day_mode
@ -104,11 +106,57 @@ script:
{% set weather = states('weather.iron_nerd_weather_station') %}
{{ weather in ['cloudy','partlycloudy','rainy','snowy','hail','lightning','lightning-rainy','pouring','snowy-rainy'] }}
then:
- service: input_select.select_option
target:
entity_id: input_select.master_bedroom_scenes
data:
option: Adaptive
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.early_night_mode
state: 'on'
sequence:
- service: switch.turn_off
target:
entity_id: switch.adaptive_lighting_master_bedroom
- delay:
seconds: 1
- service: light.turn_on
target:
entity_id: light.master_bedroom_lights
data:
brightness_pct: "{{ brightness }}"
transition: >
{% from 'time.jinja' import timer_duration %}
{{ timer_duration('input_number.wakeup_lights_fade_night') }}
- delay:
minutes: "{{ states('input_number.wakeup_lights_fade_night') }}"
- service: input_select.select_option
target:
entity_id: input_select.master_bedroom_scenes
data:
option: Adaptive
- conditions:
- condition: state
entity_id: binary_sensor.early_night_mode
state: 'off'
sequence:
- service: switch.turn_off
target:
entity_id: switch.adaptive_lighting_master_bedroom
- delay:
seconds: 1
- service: light.turn_on
target:
entity_id: light.master_bedroom_lights
data:
brightness_pct: "{{ brightness }}"
transition: >
{% from 'time.jinja' import timer_duration %}
{{ timer_duration('input_number.wakeup_lights_fade_day') }}
- delay:
minutes: "{{ states('input_number.wakeup_lights_fade_day') }}"
- service: input_select.select_option
target:
entity_id: input_select.master_bedroom_scenes
data:
option: Adaptive
- service: script.volume_reset
master_bedroom_sleep: