šŸ’” Adaptive Lighting automatically adapts the brightness and color of your lights based on the sun's temperature but stops when you manually make a change

You can do this now:

Hereā€™s my manual override that will let me turn one adaptive light on/off and also the ability to turn all of them on/off:


Forgive the number of instances, I have complex lighting demands.

Hereā€™s some YAML

square: false
columns: 1
type: grid
cards:
  - type: custom:mushroom-title-card
    title: Adaptive Lights
    alignment: center
  - type: vertical-stack
    cards:
      - square: false
        columns: 1
        type: grid
        cards:
          - type: custom:mushroom-entity-card
            entity: switch.adaptive_lighting_day_mode
            name: All
            layout: vertical
            secondary_info: none
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            icon: mdi:theme-light-dark
          - square: false
            columns: 3
            type: grid
            cards:
              - type: custom:mushroom-entity-card
                entity: switch.adaptive_lighting_bar_leaf
                layout: vertical
                name: Bar Leaf
                secondary_info: none
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - type: custom:mushroom-entity-card
                entity: switch.adaptive_lighting_bedroom_2_accent_lights
                layout: vertical
                name: Bedroom 2 Accents
                secondary_info: none
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - type: custom:mushroom-entity-card
                entity: switch.adaptive_lighting_bedroom_2_house_lights
                layout: vertical
                name: Bedroom 2 House
                secondary_info: none
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
square: false
columns: 1
type: grid
cards:
  - type: custom:mushroom-title-card
    title: Sleep Mode
    alignment: center
  - type: vertical-stack
    cards:
      - square: false
        columns: 1
        type: grid
        cards:
          - type: custom:mushroom-entity-card
            entity: switch.adaptive_lighting_sleep_mode
            name: All
            layout: vertical
            secondary_info: none
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            icon: mdi:theme-light-dark
          - square: false
            columns: 3
            type: grid
            cards:
              - type: custom:mushroom-entity-card
                entity: switch.adaptive_lighting_sleep_mode_bar_leaf
                layout: vertical
                name: Bar Leaf
                secondary_info: none
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - type: custom:mushroom-entity-card
                entity: switch.adaptive_lighting_sleep_mode_bedroom_2_accent_lights
                layout: vertical
                name: Bedroom 2 Accents
                secondary_info: none
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info
              - type: custom:mushroom-entity-card
                entity: switch.adaptive_lighting_sleep_mode_bedroom_2_house_lights
                layout: vertical
                name: Bedroom 2 House
                secondary_info: none
                tap_action:
                  action: toggle
                hold_action:
                  action: more-info

Hereā€™s a script that runs the switcher based on house awake/alarm or whatever you want

alias: House Awake
sequence:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.adaptive_lighting_sleep_mode
        - switch.living_room_sonos_night_sound
        - switch.do_not_disturb
        - switch.salt_lamp

Hereā€™s the switcher that turns on Sleep mode:

alias: 9:45 Script
sequence:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
        - switch.adaptive_lighting_sleep_mode
        - switch.do_not_disturb
        - switch.adaptive_lighting_adapt_color_bar_leaf

Whenever automations are turned on/off I have these switches aligned with those so say I turn on the automations, I want the adapters to re-cycle and I have that built in. Opposite is true when I turn off automations, I generally want the adapters in some other forced state (sleep)

Example of whenever automations are turned on/off I make the adapters follow (if I have the automations turned off, I generally donā€™t want anything happening with the lights):

alias: Automation Controls
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.bedroom_automations
      - input_boolean.living_room_automations
      - input_boolean.bedroom_2_automations
      - input_boolean.media_room_automations
      - input_boolean.kitchen_automations
      - input_boolean.dining_room_automations
      - input_boolean.downstairs_bathroom_automations
      - input_boolean.front_entryway_automations
      - input_boolean.garage_entryway_automations
      - input_boolean.garage_automations
      - input_boolean.laundry_room_automations
      - input_boolean.stairway_automations
      - input_boolean.2nd_floor_bathroom_automations
      - input_boolean.all_automations
      - input_boolean.office_automations
      - input_boolean.den_automations
      - input_boolean.ring_announcements
condition: []
action:
  - if:
      - condition: state
        entity_id: input_boolean.bedroom_automations
        state: "off"
    then:
      - service: switch.turn_off
        data: {}
        target:
          entity_id:
            - switch.adaptive_lighting_bedroom_accent_lights
            - switch.adaptive_lighting_bedroom_house_lights
      - service: input_boolean.turn_off
        data: {}
        target:
          entity_id:
            - input_boolean.office_automations
            - input_boolean.bathroom_1_automations
  - if:
      - condition: state
        entity_id: input_boolean.bedroom_automations
        state: "on"
    then:
      - service: ecobee.resume_program
        data:
          entity_id: climate.bedroom_thermostat
          resume_all: false
      - service: input_boolean.turn_off
        data: {}
        target:
          entity_id: input_boolean.nap_time
      - condition: time
        before: "21:45:00"
        after: "08:00:00"
      - service: switch.turn_on
        data: {}
        target:
          entity_id:
            - switch.adaptive_lighting_bedroom_accent_lights
            - switch.adaptive_lighting_bedroom_house_lights
      - service: media_player.media_pause
        data: {}
        target:
          device_id:
            - 898f8a660526adff7267fa8f6c1578fc
            - 9679079d7d92d3901f6fdb9da83f6f97
      - service: script.set_3rd_floor_air_filters_to_auto
        data: {}
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id:
            - input_boolean.office_automations
            - input_boolean.bathroom_1_automations
      - service: script.canvas_effect_randomizer
        data: {}
      - service: cover.open_cover
        data: {}
        target:
          entity_id:
            - cover.office_blinds
            - cover.office_curtain
            - cover.bathroom_shade
            - cover.bedroom_shades
      - service: fan.turn_off
        data: {}
        target:
          entity_id: fan.bedroom_fan
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.bed_sconces
    else: []

The net of all this is you can do this with simplistic groupings of your adaptive lighting switches:
image

Make a group to aggregate all your sleep mode switches and adaptive lighting switches:



These are the aggregate (all) switches in the very first image

Despite me having such complex lighting demands, itā€™s all automated. I very rarely have to manually override because when I tell alexa to turn off automations, itā€™s subsequently turning off the adapters too. When the automations turn back on, the adapters resume. Between the scheduled/state switching of adaptive lighting throughout the day and then the ad hoc needs (which generally happen to align with my automation states), all my needs are covered but I have the manual overrides within two clicks of me touching my phone.

I just got Home Assistant not to long ago. Iā€™m sure I will use the above in a few months (Probably a week), but right now Iā€™m going for something a little bit more simplistic.

I made a Toggle ā€œSleep Modeā€ ā€“ Input Boolean
This toggle turns on at 11:00pm and off at sunrise.

description: ""
trigger:
  - platform: time
    at: "23:00:00"
    id: Sleep_Mode_On
  - platform: sun
    event: sunrise
    offset: 0
    id: Sleep_Mode_Off
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Sleep_Mode_On
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.sleep_mode
      - conditions:
          - condition: trigger
            id: Sleep_Mode_Off
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.sleep_mode
mode: single

I also created a manual button on my dashboard that can be used for manual overrides.
Screenshot 2023-02-12 120422

Now what Iā€™m looking for as of right now, (later, as I understand what Iā€™m doing I will want full control as well), but right now I want to enable sleep mode for all the integrationsā€¦
Screenshot 2023-02-12 120505

So I have

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - input_boolean.sleep_mode
    from: "off"
    to: "on"
    id: Sleep_Mode.ON
  - platform: state
    entity_id:
      - input_boolean.sleep_mode
    from: "on"
    to: "off"
    id: Sleep_Mode.OFF
condition: []
action: []

Now I need to add the actions to will enable sleep mode in all the adaptive lighting areasā€¦ this Im not sure about.

That would be done by creating a group of switches that contains all your sleep mode switches. It will be easy to build because all you have to do to find them is type ā€˜sleepā€™ when adding all the sleep switches to that group. Then all youā€™re doing is controlling that 1 grouped switch

Ok, so I didnā€™t know about groups. So I have now figured that out, and created a Group of type switch that contains all the sleep switches.

!!! I got it figured out. This is amazing. Thank you :smiley:

1 Like

the way I have it named that way is so I can send the group name to alexa in a meaningful way and be understood. Alexa, turn on sleep mode. Alexa, turn off adaptive lighting. All sheā€™s doing is hitting these aggregated grouped switches.

Genius. So Alexa Controls your home assistant?
Im not that far into it yet lol

Yes, thereā€™s a really solid integration and you can pick and choose the things you want to send. So instead of sending 50 switches that all have adaptive lights in the name, you can just send the 1 aggregated switch name.

Same concept I use for lights. I donā€™t generally send all the bulbs through because I rarely change them independently. I just send the light group names through.

With the input booleans and switch groupings, you can send just about whatever you want to alexa in one way or another. If you name your scripts creatively you can communicate with your scripts via alexa. Alexa, turn on (insert script name) and it will run the script.

Im sure somebody is going to ask why Iā€™m turning off adaptive lighting ad hoc when there are features built in and other automations. The short answer is home assistant restarts. If the lights are on and set a certain way, they are set to stay that way. But when you reboot home assistant, it re-cycles any bulbs that are on. Letā€™s just say I have some tabletop gamers that get very annoyed with me rebooting HA 10 times on a Sunday. The switch allows me to kill adaptive lighting before a reboot and to ensure NO changes are made to lights.

How did you make those cards the way you did? are there addons I would need?

I would say the use case is after I get done doing dumb stuff with the lights, toggling the adaptive lighting off/on sweeps the entire house for lights that are on and then re-adapts them.

The hidden benefit being you can reset all the lights in the house to what theyā€™re ā€˜supposed to beā€™ at that time of day. Its useful for if you turned off adaptive lighting at noon, but then at 5 pm you notice theyā€™re all daylight, toggling the adaptive light switch off and on will reset the lights (which is effectively a day mode).

You ever have problem with the adaptive Takeover?

I have all Lutron Casseta switches and Iā€™m just not fully understanding how it makes the decision that someone else is in control?

Sometimes regardless it keeps me in control, even if I turn the lights off and on, and sometimes it takes control after I have dimmed them.

Also this is now working flawlessy :), Thanks.

check your settings:

you can make them only adapt once.

I have what you have, but what I have is the behaviour is not consistantā€¦
Like sometimes Ill manually change the brightness and it stays, but then ill turn them off and back on and sometimes it will take control, and sometimes it wont.

Ok I think I made a big bobo. I was adapting the brightness.
I assume this means that the brightness that the light was at is the new 100% brightness? A really cool feature if thatā€™s the case, but really messed me up lol.

I think its all working good nowā€¦

1 Like

I would like to control the brightness and color-temp curves independently from each other.
This is my use case:
Iā€™ve got 11 bulbs in one chandelier which I want to be 100% bright, pure white during the day. Around the sunrise time it would be better to have it still relatively dim, letā€™ say 20%. I can tweak this by setting the sunrise offset to, say +2h, but then 1h after the sunrise the color_temp is still too warm and not matching the other lights.
Is there a way to accomplish my goal for having different curves for brightness and color_temp?

You can create automations that turns off/on the brightness control for a group of lights.
Make sure to group your 11 bulbs, you can control the group as a single entity.

I have an automation that sets a scene when I play a movie on my TV. However, Iā€™d like the automation to only set the scene if the corresponding light is currently controlled by adaptive lighting. In other words, if Iā€™ve taken back control of that light by increasing the brightness, then I donā€™t want to trigger this automation.

Typically Iā€™d accomplish this using a state condition, but I donā€™t see any entities that reflect if Adaptive Lighting is applied to a light. Is there a simple way this could be accomplished?

You should have a switch for each adaptive lighting entity you created which gives you control over the brightness and another for the colour temp. You can use these are the condition for whether your scene runs.

Here you can see the entities of my ā€˜livingā€™ room adaptive lighting config.

image

Is there a way to make the resulting bell curve of the brightness value bottom out at 1%?

Similar to how the color temp bottoms out at the bulb limit of 2000k between 21:00 and 6:00.
I would like to refrain from a hard cut off with enabling sleep mode via automation or a button and would rather have a smooth long ramp down like the color temp.

With 2023.6 adding new color presets or lights in the popup car, is it possible to add a preset as color to enable adaptive light?
thank you

I have a physical switch (Hue dimmer) set up in HA, but setting it to simply turns on the lights causes them to go to their last setting before Adaptive Lighting takes control, which means if I turn them on in the evening they immediately go very bright before dimming.

Am I correct in thinking that the way to avoid this would be to set the switch to call adaptive_lighting.apply with the ā€œturn on lightsā€ setting enabled, so that it would then turn the lights on straight to their correct adapted setting rather than first going to whatever brightness/colour was used before?