From c6d5d30a0237ba2c9a3e621ee32512fce88bc189 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 22 Dec 2022 13:32:52 -0500 Subject: [PATCH] Handling for wife's new desk and lighting setup Tweak day mode scene for the desk --- node-red/projects/NerdFlows | 2 +- packages/lighting_and_scenes.yaml | 115 ++++++++++++++++++++++++++++++ packages/presence.yaml | 21 +++++- packages/security.yaml | 2 + packages/weatheralerts.yaml | 2 + scripts.yaml | 6 +- sensors/house_stats.yaml | 2 + 7 files changed, 146 insertions(+), 4 deletions(-) diff --git a/node-red/projects/NerdFlows b/node-red/projects/NerdFlows index 819c634..be18131 160000 --- a/node-red/projects/NerdFlows +++ b/node-red/projects/NerdFlows @@ -1 +1 @@ -Subproject commit 819c634e5e3999ee28d8056123f36f4cdcd9114f +Subproject commit be18131875be5a98f4bffc9daee21e2f948ca98d diff --git a/packages/lighting_and_scenes.yaml b/packages/lighting_and_scenes.yaml index ebb8888..de7c39b 100644 --- a/packages/lighting_and_scenes.yaml +++ b/packages/lighting_and_scenes.yaml @@ -20,6 +20,9 @@ input_boolean: holiday_mode: name: Holiday Mode icon: mdi:string-lights + give_me_darkness: + name: Give Me Darkness + icon: mdi:weather-night input_number: upstairs_bathroom_motion_off_delay: @@ -182,6 +185,15 @@ input_select: - Nightlight initial: Select icon: hue:room-dining + tina_desk_scenes: + name: Tina Desk Scenes + options: + - Select + - Day Mode + - Evening Mode + - Night Mode + initial: Select + icon: mdi:desk holiday_animation: name: Holiday Animation options: @@ -215,6 +227,8 @@ input_text: name: Front Porch Selected Scene tina_lamp_selected_scene: name: Tina Lamp Selected Scene + tina_desk_selected_scene: + name: Tina Desk Selected Scene switch: - platform: animated_scenes @@ -446,6 +460,60 @@ script: target: 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: - name: Adaptive in Living Room icon: mdi:palette @@ -536,6 +604,53 @@ scene: entities: input_select.dining_room_lamp_scenes: state: "Nightlight" + - name: Day Mode in Tina Desk + icon: mdi:palette + entities: + light.tina_lamp: + state: "on" + light.tina_desk_strip: + state: "on" + rgb_color: + - 0 + - 255 + - 255 + brightness: 89 + input_select.tina_lamp_scenes: + state: "Adaptive" + - name: Evening Mode in Tina Desk + icon: mdi:palette + entities: + light.tina_lamp: + state: "on" + input_select.tina_lamp_scenes: + state: "Adaptive" + light.tina_desk_strip: + state: "on" + rgb_color: + - 127 + - 0 + - 255 + brightness: 128 + - name: Night Mode in Tina Desk + icon: mdi:palette + entities: + switch.adaptive_lighting_tina_lamp: + state: "off" + light.tina_lamp: + state: "on" + rgb_color: + - 127 + - 0 + - 255 + brightness: 51 + light.tina_desk_strip: + state: "on" + rgb_color: + - 127 + - 0 + - 255 + brightness: 128 - name: Adaptive in Tina Lamp icon: mdi:palette entities: diff --git a/packages/presence.yaml b/packages/presence.yaml index 914180b..9abf9de 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -292,6 +292,7 @@ automation: - light.living_room_color_3 - light.tina_lamp_top - light.tina_lamp_side + - light.tina_desk_strip - alias: "Save Current Adaptive State" service: scene.create data: @@ -311,6 +312,7 @@ automation: entity_id: - light.living_room_lights - light.tina_lamp + - light.tina_desk_strip data: color_name: green - alias: "Flash Lights" @@ -319,6 +321,7 @@ automation: entity_id: - light.living_room_lights - light.tina_lamp + - light.tina_desk_strip data: flash: long - alias: "End early if door opened" @@ -371,6 +374,7 @@ script: - dining_room - downstairs_bathroom - upstairs_bathroom + - tina_desk - service: fan.turn_off target: area_id: @@ -449,6 +453,8 @@ script: - living_room - dining_room - mud_room + entity_id: + - light.tina_lamp - delay: hours: 0 minutes: 0 @@ -458,10 +464,15 @@ script: target: entity_id: - input_select.living_room_scenes - - input_select.tina_lamp_scenes - input_select.mud_room_scenes data: option: Adaptive + - service: input_select.select_option + target: + entity_id: + - input_select.tina_desk_scenes + data: + option: Day Mode - service: input_select.select_option target: entity_id: input_select.dining_room_lamp_scenes @@ -500,6 +511,7 @@ script: - living_room - dining_room - mud_room + - tina_desk - delay: hours: 0 minutes: 0 @@ -509,10 +521,15 @@ script: target: entity_id: - input_select.living_room_scenes - - input_select.tina_lamp_scenes - input_select.mud_room_scenes data: option: Adaptive + - service: input_select.select_option + target: + entity_id: + - input_select.tina_desk_scenes + data: + option: Night Mode - service: input_select.select_option target: entity_id: input_select.dining_room_lamp_scenes diff --git a/packages/security.yaml b/packages/security.yaml index 8307c9a..54f9ffc 100644 --- a/packages/security.yaml +++ b/packages/security.yaml @@ -231,6 +231,7 @@ automation: - light.living_room_color_3 - light.tina_lamp_side - light.tina_lamp_top + - light.tina_desk_strip - delay: seconds: 1 - service: switch.turn_off @@ -243,6 +244,7 @@ automation: entity_id: - light.living_room_lights - light.tina_lamp + - light.tina_desk_strip data: color_name: red brightness_pct: 100 diff --git a/packages/weatheralerts.yaml b/packages/weatheralerts.yaml index aaeeaac..0a680b3 100644 --- a/packages/weatheralerts.yaml +++ b/packages/weatheralerts.yaml @@ -1581,6 +1581,7 @@ script: - light.living_room_color_3 - light.tina_lamp_side - light.tina_lamp_top + - light.tina_desk_strip - service: light.turn_on target: entity_id: @@ -1589,6 +1590,7 @@ script: - light.living_room_color_3 - light.tina_lamp_side - light.tina_lamp_top + - light.tina_desk_strip data: color_name: red - service: script.status_annc diff --git a/scripts.yaml b/scripts.yaml index 7b8878c..cf0f713 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -31,13 +31,17 @@ give_me_darkness: entity_id: - switch.adaptive_lighting_sleep_mode_dining_room data: {} + - service: input_select.select_option + data: + option: Night Mode + target: + entity_id: input_select.tina_desk_scenes - service: input_select.select_option target: entity_id: - input_select.upstairs_hallway_scenes - input_select.mud_room_scenes - input_select.upstairs_bathroom_scenes - - input_select.tina_lamp_scenes data: option: Nightlight - service: light.turn_off diff --git a/sensors/house_stats.yaml b/sensors/house_stats.yaml index 1828dcf..d37322b 100644 --- a/sensors/house_stats.yaml +++ b/sensors/house_stats.yaml @@ -54,6 +54,7 @@ states.light.downstairs_bathroom_right, states.light.tina_lamp_top, states.light.tina_lamp_side, + states.light.tina_desk_strip, states.light.basement_tall_lamp, states.light.basement_short_lamp, states.light.basement_stairwell, @@ -89,6 +90,7 @@ states.light.downstairs_bathroom_right, states.light.tina_lamp_top, states.light.tina_lamp_side, + states.light.tina_desk_strip, states.light.living_room_christmas_tree ] %} {{ lights | selectattr('state','eq','on') | list | count }}