input_boolean: shower_mode: name: Shower Mode icon: mdi:shower living_room_entertainment_mode: name: Living Room Entertainment Mode icon: mdi:party-popper front_porch_light_on: name: Front Porch Light On icon: hue:room-outdoors living_room_dynamic_scenes: name: Living Room Dynamic Scenes icon: mdi:animation living_room_entertainment_control: name: Living Room Entertainment Control icon: mdi:television-ambient-light delivery_mode: name: Delivery Mode icon: mdi:pizza holiday_mode: name: Holiday Mode icon: mdi:string-lights give_me_darkness: name: Give Me Darkness icon: mdi:weather-night tina_desk_lights: name: Tina Desk Lights icon: mdi:desk holiday_mode_hold: name: Holiday Mode Hold icon: mdi:party-popper christmas_day_show: name: Christmas Day Show icon: mdi:pine-tree recliner_mode: name: Recliner Mode icon: mdi:seat-recline-extra input_number: upstairs_bathroom_motion_off_delay: name: Upstairs Bathroom Motion Off Delay min: 0 max: 15 step: 1 unit_of_measurement: minutes icon: mdi:timer front_porch_motion_off_delay: name: Front Porch Motion Off Delay min: 0 max: 30 step: 1 unit_of_measurement: minutes icon: mdi:timer downstairs_bathroom_lights_off_delay: name: Downstairs Bathroom Lights Off Delay min: 0 max: 60 step: 1 unit_of_measurement: minutes icon: mdi:timer basement_studio_lights_off_delay: name: Basement Studio Lights Off Delay min: 0 max: 30 step: 1 unit_of_measurement: minutes icon: mdi:timer living_room_lights_off_delay: name: Living Room Lights Off Delay min: 0 max: 30 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: name: Living Room Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight - Energize - Concentrate - Savanna Sunset - Tropical Twilight - Tokyo - Forest Adventure - Painted Sky initial: Select icon: hue:room-living mud_room_scenes: name: Mud Room Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight initial: Select icon: hue:room-other dining_room_lamp_scenes: name: Dining Room Lamp Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight initial: Select icon: mdi:floor-lamp-dual upstairs_hallway_scenes: name: Upstairs Hallway Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight initial: Select icon: hue:ceiling-round kallen_bedroom_scenes: name: Kallen Bedroom Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight - Overhead Nightlight - Wall Nightlight initial: Select icon: mdi:bunk-bed emma_bedroom_scenes: name: Emma Bedroom Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight initial: Select icon: hue:room-nursery basement_studio_scenes: name: Basement Studio Scenes options: - Select - Adaptive - Energize - Concentrate - Bright - Dimmed - Nightlight - Relax - Purple - Pink - Kallen Reading - Baby Is Napping - Stairwell initial: Select icon: mdi:twitch master_bedroom_scenes: name: Master Bedroom Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight - Front Nightlight - Side Nightlight initial: Select icon: mdi:bed upstairs_bathroom_scenes: name: Upstairs Bathroom Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight - Single Nightlight initial: Select icon: mdi:toilet downstairs_bathroom_scenes: name: Downstairs Bathroom Scenes options: - Select - Adaptive - Bright - Dimmed - Nightlight initial: Select icon: mdi:toilet front_porch_scenes: name: Front Porch Scenes options: - Select - Adaptive - Bright - Energize - Concentrate - Dimmed - Nightlight - St Patricks Day - Halloween initial: Select icon: hue:room-porch tina_lamp_scenes: name: Tina Lamp Scenes options: - Select - Adaptive - Energize - Bright - Nightlight initial: Select icon: hue:room-dining tina_desk_scenes: name: Tina Desk Scenes options: - Select - Day Mode - Evening Mode - Night Mode - Reset initial: Select icon: mdi:desk holiday_animation: name: Holiday Animation options: - Christmas - Halloween - St Patricks Day icon: mdi:palette input_text: living_room_selected_scene: name: Living Room Selected Scene mud_room_selected_scene: name: Mud Room Selected Scene dining_room_lamp_selected_scene: name: Dining Room Lamp Selected Scene upstairs_hallway_selected_scene: name: Upstairs Hallway Selected Scene kallen_bedroom_selected_scene: name: Kallen Bedroom Selected Scene emma_bedroom_selected_scene: name: Emma Bedroom Selected Scene basement_studio_selected_scene: name: Basement Studio Selected Scene master_bedroom_selected_scene: name: Master Bedroom Selected Scene upstairs_bathroom_selected_scene: name: Upstairs Bathroom Selected Scene downstairs_bathroom_selected_scene: name: Downstairs Bathroom Selected Scene front_porch_selected_scene: name: Front Porch Selected Scene tina_lamp_selected_scene: name: Tina Lamp Selected Scene tina_desk_selected_scene: name: Tina Desk Selected Scene sensor: - platform: template sensors: basement_studio_lights_brightness_actual: friendly_name: "Basement Studio Lights - Brightness Actual" unique_id: dee4dc84-a6a0-4150-903e-5b8bd436d962 value_template: > {% from 'lighting.jinja' import get_brightness_pct %} {{ get_brightness_pct('light.basement_studio_lights') }} availability_template: "{{ is_state('light.basement_studio_lights','on') }}" unit_of_measurement: '%' icon_template: mdi:brightness-percent basement_studio_lights_brightness_intended: friendly_name: "Basement Studio Lights - Brightness Intended" unique_id: 3542077f-24c6-460c-a73f-fe7bc8413b81 value_template: "{{ state_attr('switch.adaptive_lighting_basement_studio','brightness_pct') | float | round(2) }}" availability_template: "{{ is_state('switch.adaptive_lighting_basement_studio','on') }}" unit_of_measurement: '%' icon_template: mdi:brightness-percent basement_studio_lights_colortemp_actual: friendly_name: "Basement Studio Lights - Colortemp Actual" unique_id: 93cb2a2f-c8a7-44bf-813f-26ce349a072f value_template: "{{ state_attr('light.basement_studio_lights','color_temp_kelvin') | int }}" availability_template: "{{ is_state('light.basement_studio_lights','on') }}" unit_of_measurement: 'K' icon_template: mdi:thermometer-lines basement_studio_lights_colortemp_intended: friendly_name: "Basement Studio Lights - Colortemp Intended" unique_id: 85d4b063-bae8-43c2-9fea-35820b13f26f value_template: "{{ state_attr('switch.adaptive_lighting_basement_studio','color_temp_kelvin') | int }}" availability_template: "{{ is_state('switch.adaptive_lighting_basement_studio','on') }}" unit_of_measurement: 'K' icon_template: mdi:thermometer-lines basement_studio_lights_brightness_diff: friendly_name: "Basement Studio Lights - Brightness Diff" unique_id: ab24a44c-6c6b-4ae9-b256-52592b0503bb value_template: > {% set current = states('sensor.basement_studio_lights_brightness_actual') | float %} {% set intended = states('sensor.basement_studio_lights_brightness_intended') | float %} {{ (current - intended) | float | round(2) }} availability_template: "{{ is_state('light.basement_studio_lights','on') and is_state('switch.adaptive_lighting_basement_studio','on') }}" unit_of_measurement: '%' icon_template: mdi:brightness-percent basement_studio_lights_colortemp_diff: friendly_name: "Basement Studio Lights - Colortemp Diff" unique_id: fecf7d42-9a5c-471e-9af3-e1a330a6ae3e value_template: > {% set current = states('sensor.basement_studio_lights_colortemp_actual') | float %} {% set intended = states('sensor.basement_studio_lights_colortemp_intended') | float %} {{ (current - intended) | float | round(2) }} availability_template: "{{ is_state('light.basement_studio_lights','on') and is_state('switch.adaptive_lighting_basement_studio','on') }}" unit_of_measurement: 'K' icon_template: mdi:thermometer-lines living_room_lights_brightness_actual: friendly_name: "Living Room Lights - Brightness Actual" unique_id: e557022a-184f-4111-bb6a-6c0869cce42c value_template: > {% from 'lighting.jinja' import get_brightness_pct %} {{ get_brightness_pct('light.living_room_lights') }} availability_template: "{{ is_state('light.living_room_lights','on') }}" unit_of_measurement: '%' icon_template: mdi:brightness-percent living_room_lights_brightness_intended: friendly_name: "Living Room Lights - Brightness Intended" unique_id: a758742f-6724-4920-a9d1-325fe4f02664 value_template: "{{ state_attr('switch.adaptive_lighting_living_room','brightness_pct') | float | round(2) }}" availability_template: "{{ is_state('switch.adaptive_lighting_living_room','on') }}" unit_of_measurement: '%' icon_template: mdi:brightness-percent living_room_lights_colortemp_actual: friendly_name: "Living Room Lights - Colortemp Actual" unique_id: dbe08826-e113-4474-bbca-60d3c32a4b65 value_template: "{{ state_attr('light.living_room_lights','color_temp_kelvin') | int }}" availability_template: "{{ is_state('light.living_room_lights','on') }}" unit_of_measurement: 'K' icon_template: mdi:thermometer-lines living_room_lights_colortemp_intended: friendly_name: "Living Room Lights - Colortemp Intended" unique_id: 8b974c03-ab5b-4b89-97bf-afee78fa1a40 value_template: "{{ state_attr('switch.adaptive_lighting_living_room','color_temp_kelvin') | int }}" availability_template: "{{ is_state('switch.adaptive_lighting_living_room','on') }}" unit_of_measurement: 'K' icon_template: mdi:thermometer-lines living_room_lights_brightness_diff: friendly_name: "Living Room Lights - Brightness Diff" unique_id: 05f911d3-3b6a-4ca2-8181-5365707b2456 value_template: > {% set current = states('sensor.living_room_lights_brightness_actual') | float %} {% set intended = states('sensor.living_room_lights_brightness_intended') | float %} {{ (current - intended) | float | round(2) }} availability_template: "{{ is_state('light.living_room_lights','on') and is_state('switch.adaptive_lighting_living_room','on') }}" unit_of_measurement: '%' icon_template: mdi:brightness-percent living_room_lights_colortemp_diff: friendly_name: "Living Room Lights - Colortemp Diff" unique_id: d8fcaa26-d3dc-48d8-b4b9-9e701a1506a8 value_template: > {% set current = states('sensor.living_room_lights_colortemp_actual') | float %} {% set intended = states('sensor.living_room_lights_colortemp_intended') | float %} {{ (current - intended) | float | round(2) }} availability_template: "{{ is_state('light.living_room_lights','on') and is_state('switch.adaptive_lighting_living_room','on') }}" unit_of_measurement: 'K' icon_template: mdi:thermometer-lines template: - binary_sensor: - name: Basement Lights Sync Issue unique_id: 781d7a1e-ade3-44c3-b0f2-a15a5188107e state: > {% set colortemp = states('sensor.basement_studio_lights_colortemp_diff') | float(0) %} {% set brightness = states('sensor.basement_studio_lights_brightness_diff') | float(0) %} {% if is_state('light.basement_studio_lights','on') %} {% if is_state('switch.adaptive_lighting_basement_studio','on') and is_state('switch.adaptive_lighting_sleep_mode_basement_studio','off') %} {% if is_state('switch.adaptive_lighting_adapt_brightness_basement_studio','on') and is_state('switch.adaptive_lighting_adapt_color_basement_studio','on') %} {{ (colortemp > 100 or colortemp < -100) or (brightness > 5 or brightness < -5) }} {% elif is_state('switch.adaptive_lighting_adapt_brightness_basement_studio','on') and is_state('switch.adaptive_lighting_adapt_color_basement_studio','off') %} {{ brightness > 5 or brightness < -5 }} {% elif is_state('switch.adaptive_lighting_adapt_color_basement_studio','on') and is_state('switch.adaptive_lighting_adapt_brightness_basement_studio','off') %} {{ colortemp > 100 or colortemp < -100 }} {% endif %} {% endif %} {% endif %} attributes: color_diff: > {% set colortemp = states('sensor.basement_studio_lights_colortemp_diff') | float(0) %} {% if is_state('light.basement_studio_lights','on') %} {% if is_state('switch.adaptive_lighting_basement_studio','on') and is_state('switch.adaptive_lighting_sleep_mode_basement_studio','off') %} {% if is_state('switch.adaptive_lighting_adapt_color_basement_studio','on') %} {{ states('sensor.basement_studio_lights_colortemp_diff') }} {% else %} Color Off {% endif %} {% else %} Adaptive Off {% endif %} {% else %} Lights Off {% endif %} brightness_diff: > {% set brightness = states('sensor.basement_studio_lights_brightness_diff') | float(0) %} {% if is_state('light.basement_studio_lights','on') %} {% if is_state('switch.adaptive_lighting_basement_studio','on') and is_state('switch.adaptive_lighting_sleep_mode_basement_studio','off') %} {% if is_state('switch.adaptive_lighting_adapt_brightness_basement_studio','on') %} {{ states('sensor.basement_studio_lights_brightness_diff') }} {% else %} Brightness Off {% endif %} {% else %} Adaptive Off {% endif %} {% else %} Lights Off {% endif %} device_class: problem delay_on: "00:00:10" - name: Living Room Sync Issue unique_id: 35b3ca4f-14fb-4564-ab0c-1bb6a829c202 state: > {% set colortemp = states('sensor.living_room_lights_colortemp_diff') | float(0) %} {% set brightness = states('sensor.living_room_lights_brightness_diff') | float(0) %} {% if is_state('light.living_room_lights','on') %} {% if is_state('switch.adaptive_lighting_living_room','on') and is_state('switch.adaptive_lighting_sleep_mode_living_room','off') %} {% if is_state('switch.adaptive_lighting_adapt_brightness_living_room','on') and is_state('switch.adaptive_lighting_adapt_color_living_room','on') %} {{ (colortemp > 100 or colortemp < -100) or (brightness > 5 or brightness < -5) }} {% elif is_state('switch.adaptive_lighting_adapt_brightness_living_room','on') and is_state('switch.adaptive_lighting_adapt_color_living_room','off') %} {{ brightness > 5 or brightness < -5 }} {% elif is_state('switch.adaptive_lighting_adapt_color_living_room','on') and is_state('switch.adaptive_lighting_adapt_brightness_living_room','off') %} {{ colortemp > 100 or colortemp < -100 }} {% endif %} {% endif %} {% endif %} attributes: color_diff: > {% set colortemp = states('sensor.living_room_lights_colortemp_diff') | float(0) %} {% if is_state('light.living_room_lights','on') %} {% if is_state('switch.adaptive_lighting_living_room','on') and is_state('switch.adaptive_lighting_sleep_mode_living_room','off') %} {% if is_state('switch.adaptive_lighting_adapt_color_living_room','on') %} {{ states('sensor.living_room_lights_colortemp_diff') }} {% else %} Color Off {% endif %} {% else %} Adaptive Off {% endif %} {% else %} Lights Off {% endif %} brightness_diff: > {% set brightness = states('sensor.living_room_lights_brightness_diff') | float(0) %} {% if is_state('light.living_room_lights','on') %} {% if is_state('switch.adaptive_lighting_living_room','on') and is_state('switch.adaptive_lighting_sleep_mode_living_room','off') %} {% if is_state('switch.adaptive_lighting_adapt_brightness_living_room','on') %} {{ states('sensor.living_room_lights_brightness_diff') }} {% else %} Brightness Off {% endif %} {% else %} Adaptive Off {% endif %} {% else %} Lights Off {% endif %} device_class: problem delay_on: "00:00:10" switch: - platform: animated_scenes name: Christmas restore: False restore_power: False ignore_off: False lights: - light.front_porch_light colors: - color_type: rgb_color color: [255,0,0] brightness: 255 - color_type: rgb_color color: [0,255,0] brightness: 255 transition: 10 change_frequency: 60 change_amount: all change_sequence: True animate_brightness: True animate_color: True - platform: animated_scenes name: Christmas Day restore: False restore_power: False ignore_off: False lights: - light.living_room_color_1 - light.living_room_color_2 - light.living_room_color_3 - light.tina_lamp_top - light.tina_lamp_side - light.tina_desk_strip colors: - color_type: rgb_color color: [255,0,0] brightness: 255 - color_type: rgb_color color: [0,255,0] brightness: 255 transition: 1 change_frequency: 5 change_amount: 3 change_sequence: False animate_brightness: True animate_color: True automation: - id: 477e6e8a-4e33-4268-8c2d-f39902c0d64f alias: Living Room Night Lighting description: Provide lighting in case anyone needs to go downstairs in the middle of the night. mode: restart trigger: - platform: state entity_id: binary_sensor.living_room_motion from: 'off' to: 'on' id: motion-on - platform: state entity_id: binary_sensor.living_room_motion from: 'on' to: 'off' id: motion-off - platform: event event_type: timer.finished event_data: entity_id: timer.living_room_motion_timer id: timer-finished condition: - condition: state entity_id: binary_sensor.people_present state: 'on' - condition: state entity_id: input_boolean.vacation_mode state: 'off' action: - choose: - conditions: - condition: and conditions: - condition: trigger id: motion-on - condition: state entity_id: input_boolean.night_mode state: 'on' sequence: - service: timer.cancel target: entity_id: timer.living_room_motion_timer - service: light.turn_on target: entity_id: light.first_floor_lights - service: input_select.select_option target: entity_id: - input_select.living_room_scenes - input_select.tina_lamp_scenes - input_select.mud_room_scenes - input_select.downstairs_bathroom_scenes - input_select.dining_room_lamp_scenes data: option: Adaptive - conditions: - condition: and conditions: - condition: trigger id: motion-off - condition: state entity_id: input_boolean.night_mode state: 'on' sequence: - service: timer.start target: entity_id: timer.living_room_motion_timer data: duration: > {% from 'time.jinja' import timer_duration %} {{ timer_duration('input_number.living_room_lights_off_delay') }} - conditions: - condition: trigger id: timer-finished sequence: - service: light.turn_off target: entity_id: light.living_room_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: single 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 - platform: state entity_id: light.tina_desk_lights from: 'on' to: 'off' id: lights-off - platform: state entity_id: light.tina_desk_lights from: 'off' to: 'on' id: lights-on - platform: state entity_id: binary_sensor.tina_desktop_on from: 'off' to: 'on' id: computer-on action: - if: - condition: or conditions: - condition: trigger id: toggle-on - condition: trigger id: reset - condition: trigger id: computer-on then: - if: - condition: state entity_id: binary_sensor.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: binary_sensor.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 - if: - condition: trigger id: lights-off then: - if: - condition: state entity_id: input_boolean.tina_desk_lights state: 'on' then: - service: input_boolean.turn_off target: entity_id: input_boolean.tina_desk_lights - if: - condition: trigger id: lights-on then: - if: - condition: state entity_id: input_boolean.tina_desk_lights state: 'off' then: - service: input_boolean.turn_on target: entity_id: input_boolean.tina_desk_lights - delay: seconds: 2 # The delay is to prevent the boolean from re-running the automation if the lights were turned on manually - id: 47645bcf-a6ed-4c34-8ece-8daed4b10d9a alias: Basement Lights Handling description: Handles the presence-related automation of lights in the basement mode: restart trigger: - platform: state entity_id: binary_sensor.basement_studio_door from: 'off' to: 'on' id: door-open - platform: state entity_id: binary_sensor.basement_studio_door from: 'on' to: 'off' id: door-closed - platform: event event_type: timer.finished event_data: entity_id: timer.basement_studio_door_timer id: timer-finished - platform: state entity_id: binary_sensor.basement_occupied from: 'off' to: 'on' id: basement-occupied - platform: state entity_id: binary_sensor.basement_occupied from: 'on' to: 'off' id: basement-unoccupied - platform: state entity_id: - input_boolean.studio_quiet - input_boolean.recliner_mode from: 'off' to: 'on' id: studio-quiet - platform: state entity_id: sensor.twitch_ironnerd24 from: 'offline' to: 'streaming' id: stream-started condition: - condition: state entity_id: input_boolean.studio_quiet state: 'off' action: choose: - conditions: - condition: trigger id: door-open sequence: - if: - condition: state entity_id: light.basement_studio_lights state: 'off' then: - service: light.turn_on target: entity_id: light.basement_studio_lights - service: timer.cancel target: entity_id: timer.basement_studio_door_timer - conditions: - condition: trigger id: door-closed sequence: - if: - condition: state entity_id: binary_sensor.basement_occupied state: 'off' then: - service: timer.start target: entity_id: timer.basement_studio_door_timer data: duration: > {% from 'time.jinja' import timer_duration %} {{ timer_duration('input_number.basement_studio_lights_off_delay') }} - conditions: - condition: trigger id: - basement-occupied - studio-quiet - stream-started sequence: - service: timer.cancel target: entity_id: timer.basement_studio_door_timer - conditions: - condition: trigger id: basement-unoccupied sequence: - if: - condition: state entity_id: light.basement_studio_lights state: 'on' then: - if: - condition: state entity_id: timer.basement_studio_door_timer state: idle then: - service: timer.start target: entity_id: timer.basement_studio_door_timer data: duration: > {% from 'time.jinja' import timer_duration %} {{ timer_duration('input_number.basement_studio_lights_off_delay') }} - conditions: - condition: trigger id: timer-finished sequence: - service: light.turn_off target: entity_id: light.basement_studio_lights - id: 7c3ca098-d0bb-49bf-a323-fc471dcf81d2 alias: Recliner Mode description: For naptime in the basement mode: restart trigger: - platform: state entity_id: input_boolean.recliner_mode from: 'off' to: 'on' id: recliner-on - platform: state entity_id: input_boolean.recliner_mode from: 'on' to: 'off' id: recliner-off action: - choose: - conditions: - condition: trigger id: recliner-on sequence: - service: input_select.select_option target: entity_id: input_select.basement_studio_scenes data: option: Stairwell - service: input_boolean.turn_on target: entity_id: - input_boolean.white_noise_basement - input_boolean.studio_quiet - service: script.turn_on target: entity_id: script.asus_laptop_displays_off - if: - condition: template value_template: > {% if is_state('media_player.basement_tv','playing') %} false {% elif is_state('media_player.basement_tv','paused') or is_state('media_player.basement_tv','idle') %} {{ state_attr('media_player.basement_tv','app_name') in ['TV','Android TV Launcher'] }} {% else %} false {% endif %} then: - service: media_player.turn_off target: entity_id: media_player.basement_tv - if: - condition: not conditions: - condition: state entity_id: media_player.tony_asus state: 'playing' then: - service: script.turn_on target: entity_id: script.tony_desktop_displays_off - conditions: - condition: trigger id: recliner-off sequence: - service: input_select.select_option target: entity_id: input_select.basement_studio_scenes data: option: Adaptive - service: input_boolean.turn_off target: entity_id: - input_boolean.white_noise_basement - input_boolean.studio_quiet - service: script.turn_on target: entity_id: - script.tony_desktop_displays_on - script.asus_laptop_displays_on - service: media_player.turn_on target: entity_id: media_player.basement_tv - id: f4195b9a-3416-44b2-bef7-9826a126f0f2 alias: Basement Lights Adaptive Resync description: Deals with situations where the basement lights should be adaptive but end up out of sync mode: restart trigger: - platform: state entity_id: binary_sensor.basement_lights_sync_issue from: 'off' to: 'on' condition: - condition: state entity_id: input_boolean.studio_quiet state: 'off' - condition: template value_template: "{{ is_state_attr('light.basement_studio_lights','color_mode','color_temp') }}" action: - service: adaptive_lighting.apply data: entity_id: switch.adaptive_lighting_basement_studio adapt_brightness: "{{ is_state('switch.adaptive_lighting_adapt_brightness_basement_studio','on') }}" adapt_color: "{{ is_state('switch.adaptive_lighting_adapt_color_basement_studio','on') }}" - id: 3f05cd0d-bd6e-42c7-884d-3d1cbfda46e0 alias: Living Room Lights Adaptive Resync description: Deals with situations where the living room lights should be adaptive but end up out of sync mode: restart trigger: - platform: state entity_id: binary_sensor.living_room_sync_issue from: 'off' to: 'on' condition: - condition: template value_template: "{{ is_state_attr('light.living_room_lights','color_mode','color_temp') }}" action: - service: adaptive_lighting.apply data: entity_id: switch.adaptive_lighting_living_room adapt_brightness: "{{ is_state('switch.adaptive_lighting_adapt_brightness_living_room','on') }}" adapt_color: "{{ is_state('switch.adaptive_lighting_adapt_color_living_room','on') }}" script: adaptive_on_first_floor: alias: Adaptive on First Floor sequence: - if: - condition: state entity_id: light.living_room_lights state: 'on' then: - service: input_select.select_option target: entity_id: input_select.living_room_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_living_room - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_living_room - service: input_text.set_value target: entity_id: input_text.living_room_selected_scene data: value: Adaptive - if: - condition: state entity_id: light.dining_room_lamp state: 'on' then: - service: input_select.select_option target: entity_id: input_select.dining_room_lamp_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_dining_room_lamp - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_dining_room_lamp - service: input_text.set_value target: entity_id: input_text.dining_room_lamp_selected_scene data: value: Adaptive - if: - condition: or conditions: - condition: state entity_id: light.tina_lamp state: 'on' - condition: state entity_id: light.tina_desk_strip state: 'on' then: - service: input_select.select_option target: entity_id: input_select.tina_desk_scenes data: option: Reset else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_tina_lamp - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_tina_lamp - if: - condition: state entity_id: light.downstairs_bathroom_lights state: 'on' then: - service: input_select.select_option target: entity_id: input_select.downstairs_bathroom_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_downstairs_bathroom - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_downstairs_bathroom - service: input_text.set_value target: entity_id: input_text.downstairs_bathroom_selected_scene data: value: Adaptive - if: - condition: state entity_id: light.mud_room_overhead state: 'on' then: - service: input_select.select_option target: entity_id: input_select.mud_room_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_mud_room - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_mud_room - service: input_text.set_value target: entity_id: input_text.mud_room_selected_scene data: value: Adaptive adaptive_on_second_floor: alias: 'Adaptive on Second Floor' sequence: - if: - condition: state entity_id: light.hallway_overhead state: 'on' then: - service: input_select.select_option target: entity_id: input_select.upstairs_hallway_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_upstairs_hallway - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_upstairs_hallway - service: input_text.set_value target: entity_id: input_text.upstairs_hallway_selected_scene data: value: Adaptive - if: - condition: state entity_id: light.master_bedroom_lights state: 'on' then: - service: input_select.select_option target: entity_id: input_select.master_bedroom_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_master_bedroom - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_master_bedroom - service: input_text.set_value target: entity_id: input_text.master_bedroom_selected_scene data: value: Adaptive - if: - condition: state entity_id: light.kallen_bedroom_lights state: 'on' then: - service: input_select.select_option target: entity_id: input_select.kallen_bedroom_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_kallen_bedroom - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_kallen_bedroom - service: input_text.set_value target: entity_id: input_text.kallen_bedroom_selected_scene data: value: Adaptive - if: - condition: state entity_id: light.emma_bedroom_light state: 'on' then: - service: input_select.select_option target: entity_id: input_select.emma_bedroom_scenes data: option: Adaptive else: - service: switch.turn_on target: entity_id: switch.adaptive_lighting_emma_bedroom - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_emma_bedroom - service: input_text.set_value target: entity_id: input_text.emma_bedroom_selected_scene data: value: Adaptive - if: - condition: state entity_id: input_boolean.shower_mode state: 'off' then: - if: - condition: state entity_id: binary_sensor.upstairs_bathroom_occupied state: 'on' then: - service: input_select.select_option target: entity_id: input_select.upstairs_bathroom_scenes data: option: Adaptive else: - if: - condition: state entity_id: binary_sensor.early_night_mode state: 'on' then: - service: input_select.select_option target: entity_id: input_select.upstairs_bathroom_scenes data: option: Nightlight else: - service: light.turn_off target: entity_id: light.upstairs_bathroom_lights - service: switch.turn_on target: entity_id: switch.adaptive_lighting_upstairs_bathroom - service: switch.turn_off target: entity_id: switch.adaptive_lighting_sleep_mode_upstairs_bathroom - service: input_text.set_value target: entity_id: input_text.upstairs_bathroom_selected_scene data: value: Adaptive bright_on_first_floor: alias: 'Bright on First Floor' sequence: - service: light.turn_on target: entity_id: - light.living_room_lights - light.downstairs_bathroom_lights - light.dining_room_lamp - light.mud_room_overhead - service: input_boolean.turn_on target: entity_id: input_boolean.tina_desk_lights - delay: seconds: 1 - service: input_select.select_option target: entity_id: - input_select.living_room_scenes - input_select.downstairs_bathroom_scenes - input_select.mud_room_scenes - input_select.dining_room_lamp_scenes data: option: Bright - service: light.turn_on target: entity_id: - light.tina_desk_strip - light.tina_lamp data: color_temp_kelvin: 2700 - service: light.turn_on target: entity_id: - light.tina_lamp - light.tina_desk_strip data: brightness: 255 bright_on_second_floor: alias: 'Bright on Second Floor' sequence: - service: light.turn_on target: entity_id: - light.hallway_overhead - light.master_bedroom_lights - if: - condition: state entity_id: input_boolean.shower_mode state: 'off' then: - service: input_select.select_option target: entity_id: input_select.upstairs_bathroom_scenes data: option: Bright - if: - condition: state entity_id: input_boolean.kallen_sleeping state: 'off' then: - service: light.turn_on target: entity_id: light.kallen_bedroom_lights - if: - condition: state entity_id: input_boolean.emma_sleeping state: 'off' then: - service: light.turn_on target: entity_id: light.emma_bedroom_light - delay: seconds: 1 - service: input_select.select_option target: entity_id: - input_select.upstairs_hallway_scenes - input_select.master_bedroom_scenes data: option: Bright - if: - condition: state entity_id: input_boolean.shower_mode state: 'off' then: - service: input_select.select_option target: entity_id: input_select.upstairs_bathroom_scenes data: option: Bright - if: - condition: template value_template: "{{ is_state('input_boolean.kallen_sleeping','off') or (is_state('input_boolean.kallen_sleeping','on') and is_state('light.kallen_bedroom_lights','on')) }}" then: - service: input_select.select_option target: entity_id: input_select.kallen_bedroom_scenes data: option: Bright - if: - condition: template value_template: "{{ is_state('input_boolean.emma_sleeping','off') or (is_state('input_boolean.emma_sleeping','on') and is_state('light.emma_bedroom_light','on')) }}" then: - service: input_select.select_option target: entity_id: input_select.emma_bedroom_scenes data: option: Bright evening_on_first_floor: alias: 'Evening on First Floor' sequence: - choose: - conditions: - condition: state entity_id: binary_sensor.early_night_mode state: 'off' sequence: - stop: "This scene does nothing during daytime" - conditions: - condition: state entity_id: input_boolean.give_me_darkness state: 'on' sequence: - service: input_select.select_option target: entity_id: - input_select.mud_room_scenes - input_select.dining_room_lamp_scenes data: option: Nightlight - if: - condition: state entity_id: person.christina_stork state: home then: - service: input_select.select_option target: entity_id: input_select.tina_desk_scenes data: option: Night Mode - choose: - conditions: - condition: state entity_id: input_boolean.guest_mode state: 'off' sequence: - if: - condition: template value_template: "{{ give_me_darkness == 1 }}" then: - if: - condition: state entity_id: timer.downstairs_bathroom_lights_timer state: idle then: - service: light.turn_off target: entity_id: - light.downstairs_bathroom_lights else: - service: light.turn_off target: entity_id: - light.living_room_lights - if: - condition: state entity_id: timer.downstairs_bathroom_lights_timer state: idle then: - service: light.turn_off target: entity_id: - light.downstairs_bathroom_lights - conditions: - condition: state entity_id: input_boolean.guest_mode state: 'on' sequence: - if: - condition: state entity_id: timer.downstairs_bathroom_lights_timer state: idle then: - service: light.turn_off target: entity_id: - light.downstairs_bathroom_lights - conditions: - condition: state entity_id: input_boolean.give_me_darkness state: 'off' sequence: - if: - condition: template value_template: "{{ sunset_lights == 1 }}" then: - service: light.turn_on target: entity_id: - light.living_room_lights - light.mud_room_overhead - service: input_select.select_option target: entity_id: - input_select.living_room_scenes - input_select.mud_room_scenes data: option: Adaptive else: - service: light.turn_off target: entity_id: - light.dining_room_lamp - if: - condition: state entity_id: timer.downstairs_bathroom_lights_timer state: idle then: - service: light.turn_off target: entity_id: light.downstairs_bathroom_lights - service: input_boolean.turn_off target: entity_id: input_boolean.tina_desk_lights - service: light.turn_on target: entity_id: - light.living_room_lights - light.mud_room_overhead - service: input_select.select_option target: entity_id: - input_select.living_room_scenes - input_select.mud_room_scenes data: option: Adaptive evening_on_second_floor: alias: 'Evening on Second Floor' sequence: - choose: - conditions: - condition: state entity_id: binary_sensor.early_night_mode state: 'off' sequence: - stop: "This scene does nothing during daytime" - conditions: - condition: state entity_id: input_boolean.give_me_darkness state: 'on' sequence: - service: input_select.select_option target: entity_id: - input_select.upstairs_hallway_scenes data: option: Nightlight - if: - condition: state entity_id: input_boolean.shower_mode state: 'off' then: - service: input_select.select_option target: entity_id: input_select.upstairs_bathroom_scenes data: option: > {% if is_state('binary_sensor.upstairs_bathroom_occupied','on') %} Adaptive {% else %} Nightlight {% endif %} - service: light.turn_off target: area_id: - kallen_bedroom - master_bedroom - emma_bedroom - delay: seconds: 1 - service: switch.turn_on target: entity_id: - switch.adaptive_lighting_kallen_bedroom - switch.adaptive_lighting_master_bedroom - switch.adaptive_lighting_emma_bedroom - service: switch.turn_off target: entity_id: - switch.adaptive_lighting_sleep_mode_kallen_bedroom - switch.adaptive_lighting_sleep_mode_master_bedroom - switch.adaptive_lighting_sleep_mode_emma_bedroom - service: input_text.set_value target: entity_id: - input_text.kallen_bedroom_selected_scene - input_text.master_bedroom_selected_scene - input_text.emma_bedroom_selected_scene data: value: Adaptive - conditions: - condition: state entity_id: input_boolean.give_me_darkness state: 'off' sequence: - service: input_select.select_option target: entity_id: input_select.upstairs_hallway_scenes data: option: Nightlight - if: - condition: state entity_id: input_boolean.shower_mode state: 'off' then: - service: input_select.select_option target: entity_id: input_select.upstairs_bathroom_scenes data: option: > {% if is_state('binary_sensor.upstairs_bathroom_occupied','on') %} Adaptive {% else %} Nightlight {% endif %} - if: - condition: template value_template: "{{ sunset_lights == 1 }}" then: - stop: "Sunset lights don't mess with bedroom light states before bedtime" else: - service: light.turn_off target: area_id: - master_bedroom - kallen_bedroom - emma_bedroom - delay: seconds: 1 - service: switch.turn_on target: entity_id: - switch.adaptive_lighting_kallen_bedroom - switch.adaptive_lighting_master_bedroom - switch.adaptive_lighting_emma_bedroom - service: switch.turn_off target: entity_id: - switch.adaptive_lighting_sleep_mode_kallen_bedroom - switch.adaptive_lighting_sleep_mode_master_bedroom - switch.adaptive_lighting_sleep_mode_emma_bedroom - service: input_text.set_value target: entity_id: - input_text.kallen_bedroom_selected_scene - input_text.master_bedroom_selected_scene - input_text.emma_bedroom_selected_scene data: value: Adaptive morning_scene: alias: 'Morning Scene' sequence: - service: input_boolean.turn_off target: entity_id: input_boolean.master_bedroom_sleeping - if: - condition: template value_template: > {% set weather = states('weather.iron_nerd_weather_station') %} {{ weather in ['cloudy','partlycloudy','rainy','snowy','hail','lightning','lightning-rainy','pouring','snowy-rainy'] }} then: - if: - condition: template value_template: "{{ is_state('input_boolean.kallen_sleeping','off') and is_state('person.kallen_stork','home') }}" then: - service: light.turn_on target: entity_id: light.kallen_bedroom_lights - if: - condition: state entity_id: input_boolean.emma_sleeping state: 'off' then: - service: light.turn_on target: entity_id: light.emma_bedroom_light #! Unless there is a good reason, do not define multi-room scenes below. #! Use scripts instead, to avoid some straight-up haunted house bullshit... scene: - name: Adaptive in Living Room icon: mdi:palette entities: light.living_room_lights: state: "on" input_select.living_room_scenes: state: "Adaptive" - name: Bright in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Bright" - name: Dimmed in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Dimmed" - name: Nightlight in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Nightlight" - name: Energize in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Energize" - name: Concentrate in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Concentrate" - name: Savanna Sunset in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Savanna Sunset" - name: Tropical Twilight in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Tropical Twilight" - name: Tokyo in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Tokyo" - name: Forest Adventure in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Forest Adventure" - name: Painted Sky in Living Room icon: mdi:palette entities: input_select.living_room_scenes: state: "Painted Sky" - name: Adaptive in Downstairs Bathroom icon: mdi:palette entities: light.downstairs_bathroom_lights: state: "on" input_select.downstairs_bathroom_scenes: state: "Adaptive" - name: Bright in Downstairs Bathroom icon: mdi:palette entities: input_select.downstairs_bathroom_scenes: state: "Bright" - name: Dimmed in Downstairs Bathroom icon: mdi:palette entities: input_select.downstairs_bathroom_scenes: state: "Dimmed" - name: Nightlight in Downstairs Bathroom icon: mdi:palette entities: input_select.downstairs_bathroom_scenes: state: "Nightlight" - name: Adaptive in Dining Room Lamp icon: mdi:palette entities: input_select.dining_room_lamp_scenes: state: "Adaptive" - name: Bright in Dining Room Lamp icon: mdi:palette entities: input_select.dining_room_lamp_scenes: state: "Bright" - name: Dimmed in Dining Room Lamp icon: mdi:palette entities: input_select.dining_room_lamp_scenes: state: "Dimmed" - name: Nightlight in Dining Room Lamp icon: mdi:palette entities: input_select.dining_room_lamp_scenes: state: "Nightlight" - name: Day Mode in Tina Desk icon: mdi:palette entities: light.tina_lamp_top: state: "on" light.tina_lamp_side: state: "off" 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: 128 light.tina_desk_strip: state: "on" rgb_color: - 127 - 0 - 255 brightness: 128 - name: Adaptive in Tina Lamp icon: mdi:palette entities: light.tina_lamp: state: "on" input_select.tina_lamp_scenes: state: "Adaptive" - name: Energize in Tina Lamp icon: mdi:palette entities: input_select.tina_lamp_scenes: state: "Energize" - name: Bright in Tina Lamp icon: mdi:palette entities: input_select.tina_lamp_scenes: state: "Bright" - name: Nightlight in Tina Lamp icon: mdi:palette entities: input_select.tina_lamp_scenes: state: "Nightlight" - name: Adaptive in Mud Room icon: mdi:palette entities: light.mud_room_overhead: state: "on" input_select.mud_room_scenes: state: "Adaptive" - name: Bright in Mud Room icon: mdi:palette entities: input_select.mud_room_scenes: state: "Bright" - name: Dimmed in Mud Room icon: mdi:palette entities: input_select.mud_room_scenes: state: "Dimmed" - name: Nightlight in Mud Room icon: mdi:palette entities: input_select.mud_room_scenes: state: "Nightlight" - name: Adaptive in Upstairs Hallway icon: mdi:palette entities: light.hallway_overhead: state: "on" input_select.upstairs_hallway_scenes: state: "Adaptive" - name: Bright in Upstairs Hallway icon: mdi:palette entities: input_select.upstairs_hallway_scenes: state: "Bright" - name: Dimmed in Upstairs Hallway icon: mdi:palette entities: input_select.upstairs_hallway_scenes: state: "Dimmed" - name: Nightlight in Upstairs Hallway icon: mdi:palette entities: input_select.upstairs_hallway_scenes: state: "Nightlight" - name: Adaptive in Upstairs Bathroom icon: mdi:palette entities: light.upstairs_bathroom_lights: state: "on" input_select.upstairs_bathroom_scenes: state: "Adaptive" - name: Bright in Upstairs Bathroom icon: mdi:palette entities: input_select.upstairs_bathroom_scenes: state: "Bright" - name: Dimmed in Upstairs Bathroom icon: mdi:palette entities: input_select.upstairs_bathroom_scenes: state: "Dimmed" - name: Nightlight in Upstairs Bathroom icon: mdi:palette entities: input_select.upstairs_bathroom_scenes: state: "Nightlight" - name: Single Nightlight in Upstairs Bathroom icon: mdi:palette entities: input_select.upstairs_bathroom_scenes: state: "Single Nightlight" - name: Adaptive in Master Bedroom icon: mdi:palette entities: light.master_bedroom_lights: state: "on" input_select.master_bedroom_scenes: state: "Adaptive" - name: Bright in Master Bedroom icon: mdi:palette entities: input_select.master_bedroom_scenes: state: "Bright" - name: Dimmed in Master Bedroom icon: mdi:palette entities: input_select.master_bedroom_scenes: state: "Dimmed" - name: Nightlight in Master Bedroom icon: mdi:palette entities: input_select.master_bedroom_scenes: state: "Nightlight" - name: Front Nightlight in Master Bedroom icon: mdi:palette entities: input_select.master_bedroom_scenes: state: "Front Nightlight" - name: Side Nightlight in Master Bedroom icon: mdi:palette entities: input_select.master_bedroom_scenes: state: "Side Nightlight" - name: Adaptive in Kallen Bedroom icon: mdi:palette entities: light.kallen_bedroom_lights: state: "on" input_select.kallen_bedroom_scenes: state: "Adaptive" - name: Bright in Kallen Bedroom icon: mdi:palette entities: input_select.kallen_bedroom_scenes: state: "Bright" - name: Dimmed in Kallen Bedroom icon: mdi:palette entities: input_select.kallen_bedroom_scenes: state: "Dimmed" - name: Nightlight in Kallen Bedroom icon: mdi:palette entities: input_select.kallen_bedroom_scenes: state: "Nightlight" - name: Overhead Nightlight in Kallen Bedroom icon: mdi:palette entities: input_select.kallen_bedroom_scenes: state: "Overhead Nightlight" - name: Wall Nightlight in Kallen Bedroom icon: mdi:palette entities: input_select.kallen_bedroom_scenes: state: "Wall Nightlight" - name: Adaptive in Emma Bedroom icon: mdi:palette entities: light.emma_bedroom_light: state: "on" input_select.emma_bedroom_scenes: state: "Adaptive" - name: Bright in Emma Bedroom icon: mdi:palette entities: input_select.emma_bedroom_scenes: state: "Bright" - name: Dimmed in Emma Bedroom icon: mdi:palette entities: input_select.emma_bedroom_scenes: state: "Dimmed" - name: Nightlight in Emma Bedroom icon: mdi:palette entities: input_select.emma_bedroom_scenes: state: "Nightlight" - name: Adaptive in Basement Studio icon: mdi:palette entities: light.basement_studio_lights: state: "on" input_select.basement_studio_scenes: state: "Adaptive" - name: Energize in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Energize" - name: Concentrate in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Concentrate" - name: Bright in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Bright" - name: Dimmed in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Dimmed" - name: Nightlight in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Nightlight" - name: Relax in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Relax" - name: Purple in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Purple" - name: Pink in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Pink" - name: Kallen Reading in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Kallen Reading" - name: Baby Is Napping in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Baby Is Napping" - name: Stairwell in Basement Studio icon: mdi:palette entities: input_select.basement_studio_scenes: state: "Stairwell"