Attempt to fix fade duration on recliner mode shutoff
This commit is contained in:
@ -1921,35 +1921,35 @@
|
|||||||
- id: '1696286481890'
|
- id: '1696286481890'
|
||||||
alias: Recliner Mode
|
alias: Recliner Mode
|
||||||
description: For naptime in the basement
|
description: For naptime in the basement
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- entity_id: input_boolean.recliner_mode
|
||||||
entity_id: input_boolean.recliner_mode
|
|
||||||
from: 'off'
|
from: 'off'
|
||||||
to: 'on'
|
to: 'on'
|
||||||
id: recliner-on
|
id: recliner-on
|
||||||
- platform: state
|
trigger: state
|
||||||
entity_id: input_boolean.recliner_mode
|
- entity_id: input_boolean.recliner_mode
|
||||||
from: 'on'
|
from: 'on'
|
||||||
to: 'off'
|
to: 'off'
|
||||||
id: recliner-off
|
id: recliner-off
|
||||||
condition: []
|
trigger: state
|
||||||
action:
|
conditions: []
|
||||||
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: recliner-on
|
id: recliner-on
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_select.select_option
|
- target:
|
||||||
target:
|
|
||||||
entity_id: input_select.basement_studio_scenes
|
entity_id: input_select.basement_studio_scenes
|
||||||
data:
|
data:
|
||||||
option: Stairwell
|
option: Stairwell
|
||||||
- service: input_boolean.turn_on
|
action: input_select.select_option
|
||||||
target:
|
- target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- input_boolean.white_noise_basement
|
- input_boolean.white_noise_basement
|
||||||
- input_boolean.studio_quiet
|
- input_boolean.studio_quiet
|
||||||
data: {}
|
data: {}
|
||||||
|
action: input_boolean.turn_on
|
||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{% if is_state('media_player.basement_tv','playing') %}\n
|
value_template: "{% if is_state('media_player.basement_tv','playing') %}\n
|
||||||
@ -1957,10 +1957,10 @@
|
|||||||
%}\n {{ state_attr('media_player.basement_tv','app_name') in ['TV','Android
|
%}\n {{ state_attr('media_player.basement_tv','app_name') in ['TV','Android
|
||||||
TV Launcher'] }}\n{% else %}\n false\n{% endif %}\n"
|
TV Launcher'] }}\n{% else %}\n false\n{% endif %}\n"
|
||||||
then:
|
then:
|
||||||
- service: media_player.turn_off
|
- target:
|
||||||
target:
|
|
||||||
entity_id: media_player.basement_tv
|
entity_id: media_player.basement_tv
|
||||||
data: {}
|
data: {}
|
||||||
|
action: media_player.turn_off
|
||||||
- if:
|
- if:
|
||||||
- condition: not
|
- condition: not
|
||||||
conditions:
|
conditions:
|
||||||
@ -1968,29 +1968,29 @@
|
|||||||
entity_id: media_player.tony_asus
|
entity_id: media_player.tony_asus
|
||||||
state: playing
|
state: playing
|
||||||
then:
|
then:
|
||||||
- service: script.turn_on
|
- target:
|
||||||
target:
|
|
||||||
entity_id: script.tony_desktop_displays_off
|
entity_id: script.tony_desktop_displays_off
|
||||||
data: {}
|
data: {}
|
||||||
|
action: script.turn_on
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: recliner-off
|
id: recliner-off
|
||||||
sequence:
|
sequence:
|
||||||
- service: light.turn_off
|
- data: {}
|
||||||
data: {}
|
|
||||||
target:
|
target:
|
||||||
entity_id: light.basement_studio_lights
|
entity_id: light.basement_studio_lights
|
||||||
alias: Turn off the remaining lights
|
alias: Turn off the remaining lights
|
||||||
|
action: light.turn_off
|
||||||
- delay:
|
- delay:
|
||||||
hours: 0
|
hours: 0
|
||||||
minutes: 0
|
minutes: 0
|
||||||
seconds: 0
|
seconds: 0
|
||||||
milliseconds: 500
|
milliseconds: 500
|
||||||
- service: switch.turn_on
|
- data: {}
|
||||||
data: {}
|
|
||||||
target:
|
target:
|
||||||
entity_id: switch.adaptive_lighting_basement_studio
|
entity_id: switch.adaptive_lighting_basement_studio
|
||||||
alias: Turn on Adaptive Lighting to read the current values
|
alias: Turn on Adaptive Lighting to read the current values
|
||||||
|
action: switch.turn_on
|
||||||
- delay:
|
- delay:
|
||||||
hours: 0
|
hours: 0
|
||||||
minutes: 0
|
minutes: 0
|
||||||
@ -1999,41 +1999,42 @@
|
|||||||
- variables:
|
- variables:
|
||||||
brightness: '{{ state_attr(''switch.adaptive_lighting_basement_studio'',''brightness_pct'')
|
brightness: '{{ state_attr(''switch.adaptive_lighting_basement_studio'',''brightness_pct'')
|
||||||
| int }}'
|
| int }}'
|
||||||
alias: Set intended brightness
|
fade_delay: "{% from 'time.jinja' import timer_duration %} {% if is_state('binary_sensor.early_night_mode','on')
|
||||||
- service: input_boolean.turn_off
|
%}\n {{ timer_duration('input_number.wakeup_lights_fade_night') }}\n{%
|
||||||
target:
|
else %}\n {{ timer_duration('input_number.wakeup_lights_fade_day') }}\n{%
|
||||||
|
endif %}"
|
||||||
|
alias: Set intended brightness and fade delay
|
||||||
|
- target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- input_boolean.studio_quiet
|
- input_boolean.studio_quiet
|
||||||
data: {}
|
data: {}
|
||||||
alias: Turn off the quiet switch
|
alias: Turn off the quiet switch
|
||||||
- service: light.turn_on
|
action: input_boolean.turn_off
|
||||||
data:
|
- data:
|
||||||
brightness_pct: '{{ brightness|default(70) }}'
|
brightness_pct: '{{ brightness|default(70) }}'
|
||||||
transition: "{% from 'time.jinja' import timer_duration %} {% if is_state('binary_sensor.early_night_mode','on')
|
transition: '{{ fade_delay|default(300) }}'
|
||||||
%}\n {{ timer_duration('input_number.wakeup_lights_fade_night') }}\n{%
|
|
||||||
else %}\n {{ timer_duration('input_number.wakeup_lights_fade_day') }}\n{%
|
|
||||||
endif %}\n"
|
|
||||||
target:
|
target:
|
||||||
entity_id: light.basement_studio_lights
|
entity_id: light.basement_studio_lights
|
||||||
alias: Fade the lights in gradually
|
alias: Fade the lights in gradually
|
||||||
|
action: light.turn_on
|
||||||
- alias: Wait for lights to fade in unless interrupted
|
- alias: Wait for lights to fade in unless interrupted
|
||||||
wait_for_trigger:
|
wait_for_trigger:
|
||||||
- platform: state
|
- entity_id:
|
||||||
entity_id:
|
|
||||||
- light.basement_studio_lights
|
- light.basement_studio_lights
|
||||||
to: 'off'
|
to: 'off'
|
||||||
id: lights-off
|
id: lights-off
|
||||||
- platform: state
|
trigger: state
|
||||||
entity_id:
|
- entity_id:
|
||||||
- input_select.basement_studio_scenes
|
- input_select.basement_studio_scenes
|
||||||
to: Adaptive
|
to: Adaptive
|
||||||
id: adaptive
|
id: adaptive
|
||||||
- platform: state
|
trigger: state
|
||||||
entity_id:
|
- entity_id:
|
||||||
- binary_sensor.tony_desktop_idle
|
- binary_sensor.tony_desktop_idle
|
||||||
from: 'on'
|
from: 'on'
|
||||||
to: 'off'
|
to: 'off'
|
||||||
id: computer
|
id: computer
|
||||||
|
trigger: state
|
||||||
timeout:
|
timeout:
|
||||||
minutes: "{% if is_state('binary_sensor.early_night_mode','on') %}\n {{
|
minutes: "{% if is_state('binary_sensor.early_night_mode','on') %}\n {{
|
||||||
states('input_number.wakeup_lights_fade_night') }}\n{% else %}\n {{ states('input_number.wakeup_lights_fade_day')
|
states('input_number.wakeup_lights_fade_night') }}\n{% else %}\n {{ states('input_number.wakeup_lights_fade_day')
|
||||||
@ -2046,50 +2047,50 @@
|
|||||||
condition: template
|
condition: template
|
||||||
value_template: '{{ wait.trigger.id == ''adaptive'' }}'
|
value_template: '{{ wait.trigger.id == ''adaptive'' }}'
|
||||||
sequence:
|
sequence:
|
||||||
- service: adaptive_lighting.set_manual_control
|
- data:
|
||||||
data:
|
|
||||||
manual_control: false
|
manual_control: false
|
||||||
entity_id: switch.adaptive_lighting_basement_studio
|
entity_id: switch.adaptive_lighting_basement_studio
|
||||||
alias: Reset manual control
|
alias: Reset manual control
|
||||||
|
action: adaptive_lighting.set_manual_control
|
||||||
- conditions:
|
- conditions:
|
||||||
- alias: Nothing
|
- alias: Nothing
|
||||||
condition: template
|
condition: template
|
||||||
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
||||||
}}'
|
}}'
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_select.select_option
|
- data:
|
||||||
data:
|
|
||||||
option: Adaptive
|
option: Adaptive
|
||||||
target:
|
target:
|
||||||
entity_id: input_select.basement_studio_scenes
|
entity_id: input_select.basement_studio_scenes
|
||||||
alias: Set scene back to adaptive
|
alias: Set scene back to adaptive
|
||||||
- service: adaptive_lighting.set_manual_control
|
action: input_select.select_option
|
||||||
data:
|
- data:
|
||||||
manual_control: false
|
manual_control: false
|
||||||
entity_id: switch.adaptive_lighting_basement_studio
|
entity_id: switch.adaptive_lighting_basement_studio
|
||||||
alias: Reset manual control
|
alias: Reset manual control
|
||||||
|
action: adaptive_lighting.set_manual_control
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ wait.trigger.id == ''lights-off'' }}'
|
value_template: '{{ wait.trigger.id == ''lights-off'' }}'
|
||||||
alias: Lights off
|
alias: Lights off
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_text.set_value
|
- data:
|
||||||
data:
|
|
||||||
value: Adaptive
|
value: Adaptive
|
||||||
target:
|
target:
|
||||||
entity_id: input_text.basement_studio_selected_scene
|
entity_id: input_text.basement_studio_selected_scene
|
||||||
alias: Reset selected scene input text
|
alias: Reset selected scene input text
|
||||||
- service: adaptive_lighting.set_manual_control
|
action: input_text.set_value
|
||||||
data:
|
- data:
|
||||||
manual_control: false
|
manual_control: false
|
||||||
entity_id: switch.adaptive_lighting_basement_studio
|
entity_id: switch.adaptive_lighting_basement_studio
|
||||||
alias: Reset manual control
|
alias: Reset manual control
|
||||||
- service: input_boolean.turn_off
|
action: adaptive_lighting.set_manual_control
|
||||||
target:
|
- target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- input_boolean.white_noise_basement
|
- input_boolean.white_noise_basement
|
||||||
data: {}
|
data: {}
|
||||||
alias: Turn off white noise
|
alias: Turn off white noise
|
||||||
|
action: input_boolean.turn_off
|
||||||
- alias: If my computer is on, turn the screens back on
|
- alias: If my computer is on, turn the screens back on
|
||||||
if:
|
if:
|
||||||
- condition: template
|
- condition: template
|
||||||
@ -2098,15 +2099,15 @@
|
|||||||
}}'
|
}}'
|
||||||
then:
|
then:
|
||||||
- alias: Turn the screens back on
|
- alias: Turn the screens back on
|
||||||
service: script.turn_on
|
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- script.tony_desktop_displays_on
|
- script.tony_desktop_displays_on
|
||||||
data: {}
|
data: {}
|
||||||
- service: media_player.turn_on
|
action: script.turn_on
|
||||||
target:
|
- target:
|
||||||
entity_id: media_player.basement_tv
|
entity_id: media_player.basement_tv
|
||||||
data: {}
|
data: {}
|
||||||
|
action: media_player.turn_on
|
||||||
mode: restart
|
mode: restart
|
||||||
- id: '1696286540644'
|
- id: '1696286540644'
|
||||||
alias: Basement Lights Adaptive Resync
|
alias: Basement Lights Adaptive Resync
|
||||||
|
Reference in New Issue
Block a user