Adjust master bedroom/second floor lighting while sleeping #176

This commit is contained in:
2023-11-19 17:59:40 -05:00
parent 534fb68055
commit 94e2602150

View File

@ -76,6 +76,13 @@ script:
- service: switch.turn_off - service: switch.turn_off
target: target:
entity_id: switch.adaptive_lighting_master_bedroom entity_id: switch.adaptive_lighting_master_bedroom
- if:
- condition: template
value_template: "{{ is_state('input_boolean.give_me_darkness','on') and is_state('input_boolean.goodnight','off') }}"
then:
- service: script.turn_on
target:
entity_id: script.evening_on_second_floor
- delay: - delay:
seconds: 1 seconds: 1
- service: light.turn_on - service: light.turn_on
@ -107,14 +114,18 @@ script:
{{ states('input_number.wakeup_lights_fade_day') }} {{ states('input_number.wakeup_lights_fade_day') }}
{% endif %} {% endif %}
- choose: - choose:
- conditions: "{{ wait.trigger == 'none' or wait.trigger.idx is undefined }}" - conditions:
- condition: template
value_template: "{{ wait.trigger == 'none' or wait.trigger.idx is undefined }}"
sequence: sequence:
- service: input_select.select_option - service: input_select.select_option
target: target:
entity_id: input_select.master_bedroom_scenes entity_id: input_select.master_bedroom_scenes
data: data:
option: Adaptive option: Adaptive
- conditions: "{{ wait.trigger.id == 'lights-off' }}" - conditions:
- condition: template
value_template: "{{ wait.trigger.id == 'lights-off' }}"
sequence: sequence:
- service: switch.turn_on - service: switch.turn_on
target: target:
@ -140,6 +151,13 @@ script:
timeout: timeout:
minutes: 60 minutes: 60
continue_on_timeout: true continue_on_timeout: true
- if:
- condition: template
value_template: "{{ is_state('input_boolean.give_me_darkness','on') and is_state('input_boolean.goodnight','off') }}"
then:
- service: script.turn_on
target:
entity_id: script.goodnight_on_second_floor
- service: switch.turn_on - service: switch.turn_on
target: target:
entity_id: switch.adaptive_lighting_master_bedroom entity_id: switch.adaptive_lighting_master_bedroom
@ -151,10 +169,6 @@ script:
entity_id: input_text.master_bedroom_selected_scene entity_id: input_text.master_bedroom_selected_scene
data: data:
value: Adaptive value: Adaptive
- service: adaptive_lighting.set_manual_control
data:
manual_control: false
entity_id: switch.adaptive_lighting_master_bedroom
# TODO: Figure out which actions to move here, and which ones to keep in Node-RED # TODO: Figure out which actions to move here, and which ones to keep in Node-RED