Changed script to automation, added toggle switch. Much cleaner UX.
This commit is contained in:
Submodule node-red/projects/NerdFlows updated: be18131875...8c8d3cad27
@ -23,6 +23,9 @@ input_boolean:
|
|||||||
give_me_darkness:
|
give_me_darkness:
|
||||||
name: Give Me Darkness
|
name: Give Me Darkness
|
||||||
icon: mdi:weather-night
|
icon: mdi:weather-night
|
||||||
|
tina_desk_lights:
|
||||||
|
name: Tina Desk Lights
|
||||||
|
icon: mdi:desk
|
||||||
|
|
||||||
input_number:
|
input_number:
|
||||||
upstairs_bathroom_motion_off_delay:
|
upstairs_bathroom_motion_off_delay:
|
||||||
@ -192,6 +195,7 @@ input_select:
|
|||||||
- Day Mode
|
- Day Mode
|
||||||
- Evening Mode
|
- Evening Mode
|
||||||
- Night Mode
|
- Night Mode
|
||||||
|
- Reset
|
||||||
initial: Select
|
initial: Select
|
||||||
icon: mdi:desk
|
icon: mdi:desk
|
||||||
holiday_animation:
|
holiday_animation:
|
||||||
@ -418,6 +422,77 @@ automation:
|
|||||||
target:
|
target:
|
||||||
entity_id: light.first_floor_lights
|
entity_id: light.first_floor_lights
|
||||||
|
|
||||||
|
- id: b897d714-bbf2-44ce-afaf-63cf3694351c
|
||||||
|
alias: Tina Desk Lights Handler
|
||||||
|
description: Handles turning on the desk lights with smart scene selection and also turning them off
|
||||||
|
mode: restart
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: input_boolean.tina_desk_lights
|
||||||
|
from: 'off'
|
||||||
|
to: 'on'
|
||||||
|
id: toggle-on
|
||||||
|
- platform: state
|
||||||
|
entity_id: input_boolean.tina_desk_lights
|
||||||
|
from: 'on'
|
||||||
|
to: 'off'
|
||||||
|
id: toggle-off
|
||||||
|
- platform: state
|
||||||
|
entity_id: input_select.tina_desk_scenes
|
||||||
|
to: 'Reset'
|
||||||
|
id: reset
|
||||||
|
action:
|
||||||
|
- if:
|
||||||
|
- condition: or
|
||||||
|
conditions:
|
||||||
|
- condition: trigger
|
||||||
|
id: toggle-on
|
||||||
|
- condition: trigger
|
||||||
|
id: reset
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.early_night_mode
|
||||||
|
state: 'off'
|
||||||
|
then:
|
||||||
|
- service: input_select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: input_select.tina_desk_scenes
|
||||||
|
data:
|
||||||
|
option: Day Mode
|
||||||
|
- if:
|
||||||
|
- condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.early_night_mode
|
||||||
|
state: 'on'
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.give_me_darkness
|
||||||
|
state: 'off'
|
||||||
|
then:
|
||||||
|
- service: input_select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: input_select.tina_desk_scenes
|
||||||
|
data:
|
||||||
|
option: Evening Mode
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.give_me_darkness
|
||||||
|
state: 'on'
|
||||||
|
then:
|
||||||
|
- service: input_select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: input_select.tina_desk_scenes
|
||||||
|
data:
|
||||||
|
option: Night Mode
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id: toggle-off
|
||||||
|
then:
|
||||||
|
- service: light.turn_off
|
||||||
|
target:
|
||||||
|
entity_id: light.tina_desk_lights
|
||||||
|
|
||||||
script:
|
script:
|
||||||
emma_wakeup:
|
emma_wakeup:
|
||||||
alias: "Emma Wakeup"
|
alias: "Emma Wakeup"
|
||||||
@ -460,60 +535,6 @@ script:
|
|||||||
target:
|
target:
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
|
|
||||||
tina_desk_lights_handler:
|
|
||||||
alias: Tina Desk Lights Handler
|
|
||||||
mode: queued
|
|
||||||
max: 2
|
|
||||||
sequence:
|
|
||||||
- if:
|
|
||||||
- condition: state
|
|
||||||
entity_id: light.tina_desk_lights
|
|
||||||
state: 'off'
|
|
||||||
then:
|
|
||||||
- if:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.early_night_mode
|
|
||||||
state: 'off'
|
|
||||||
then:
|
|
||||||
- service: input_select.select_option
|
|
||||||
target:
|
|
||||||
entity_id: input_select.tina_desk_scenes
|
|
||||||
data:
|
|
||||||
option: Day Mode
|
|
||||||
- if:
|
|
||||||
- condition: and
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.early_night_mode
|
|
||||||
state: 'on'
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.give_me_darkness
|
|
||||||
state: 'off'
|
|
||||||
then:
|
|
||||||
- service: input_select.select_option
|
|
||||||
target:
|
|
||||||
entity_id: input_select.tina_desk_scenes
|
|
||||||
data:
|
|
||||||
option: Evening Mode
|
|
||||||
- if:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.give_me_darkness
|
|
||||||
state: 'on'
|
|
||||||
then:
|
|
||||||
- service: input_select.select_option
|
|
||||||
target:
|
|
||||||
entity_id: input_select.tina_desk_scenes
|
|
||||||
data:
|
|
||||||
option: Night Mode
|
|
||||||
- if:
|
|
||||||
- condition: state
|
|
||||||
entity_id: light.tina_desk_lights
|
|
||||||
state: 'on'
|
|
||||||
then:
|
|
||||||
- service: light.turn_off
|
|
||||||
target:
|
|
||||||
entity_id: light.tina_desk_lights
|
|
||||||
|
|
||||||
scene:
|
scene:
|
||||||
- name: Adaptive in Living Room
|
- name: Adaptive in Living Room
|
||||||
icon: mdi:palette
|
icon: mdi:palette
|
||||||
|
19
scripts.yaml
19
scripts.yaml
@ -21,6 +21,10 @@ stop_netflix:
|
|||||||
give_me_darkness:
|
give_me_darkness:
|
||||||
alias: Give Me Darkness
|
alias: Give Me Darkness
|
||||||
sequence:
|
sequence:
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
data: {}
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.give_me_darkness
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
data: {}
|
data: {}
|
||||||
target:
|
target:
|
||||||
@ -31,11 +35,16 @@ give_me_darkness:
|
|||||||
entity_id:
|
entity_id:
|
||||||
- switch.adaptive_lighting_sleep_mode_dining_room
|
- switch.adaptive_lighting_sleep_mode_dining_room
|
||||||
data: {}
|
data: {}
|
||||||
- service: input_select.select_option
|
- if:
|
||||||
data:
|
- condition: state
|
||||||
option: Night Mode
|
entity_id: person.christina_stork
|
||||||
target:
|
state: home
|
||||||
entity_id: input_select.tina_desk_scenes
|
then:
|
||||||
|
- service: input_select.select_option
|
||||||
|
data:
|
||||||
|
option: Night Mode
|
||||||
|
target:
|
||||||
|
entity_id: input_select.tina_desk_scenes
|
||||||
- service: input_select.select_option
|
- service: input_select.select_option
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
|
Reference in New Issue
Block a user