New Adaptive Lighting Integration

I had the same problem and ended up using an automation to just switch the adaptive lighting off for those lights when I don’t need it. Both the manual control and the ‘take control’ options don’t seem to work when I’m turning lights on or off.

This is not the solution, even though I use in AL only single light instances, I still controll via Hue some light features, and we are back again at this issue :frowning:

Is it just me or does anyone else have a yaml configuration error when attempting to use adaptive_lighting.apply within a script?

The following adaptive lighting yaml block (which I hope to replace the commented out section), gives me the resulting error message:

      - service: adaptive_lighting.apply
        entity_id: switch.adaptive_lighting_adaptivelights
        lights: light.family_room_lamp
        adapt_brightness: no
        turn_on_lights: yes
      # - service: light.turn_on
      #   entity_id: light.family_room_lamp
      #   data_template:
      #     color_temp: >
      #       {% if is_state("sensor.period_of_day", "day") %}
      #         153
      #       {% else %}
      #         407
      #       {% endif %}
      #     brightness: 255
ERROR:homeassistant.config:Invalid config for [script]: [lights] is an invalid option for [script]. Check: script->sequence->0->lights. (See ?, line ?).

If I manually call the service, it turns on the light as expected:


Try formatting your script the same as the service call…

service: adaptive_lighting.apply
  entity_id: switch.adaptive_lighting_default
  lights: light.bedroom_ceiling
  transition: 10
  adapt_brightness: true
  adapt_color: true

oh blimey, can’t believe I didn’t spot that. :man_facepalming:

Thanks Daniel. :slight_smile:

The issue is not Adaptive Lighting. It only adapts what it sees as on in HA.
What I have found is that even though the lights are physically off, they are incorrectly on in HA.
The problem is outside of AL somewhere in HA and its add-ons/integrations. There is nothing AL can do about that…

NP! I like fixing the easy ones!!

It seems this integration is broken on HA 2021.5 that just got released.


Would someone mind checking if my understanding of the following configuration is correct or not please?

My plan was to manually switch on a light to the correct colour temperature for that time of the day, at 100% brightness (no matter what time of day), and have it automatically adjust the temperature throughout the day, going no warmer than a specified max_color_temp of 4500, without adjusting brightness.

- name: huelamps
  max_color_temp: 4500
  take_over_control: false
  min_brightness: 100
  initial_transition: 1

      - service: adaptive_lighting.apply
        entity_id: switch.adaptive_lighting_huelamps
          lights: light.family_room_lamp
          adapt_brightness: yes
          turn_on_lights: yes
          transition: 1

Unfortunately though the above configuration starts dimming the light and changing color_temp to the max_mireds value of 500 at some point during the evening, which isn’t what I was hoping for.

Have I perhaps misunderstood what this integration can do?

Have you tried:

  turn_on_lights: false  # I am not sure what this actually does
  adapt_brightness: false # You have `yes`
  adapt_color_temp: true  # This might be necessary for your scenario!

Hi Daniel, thanks for the suggestions.

I did wonder for a moment why I had used yes instead of true. I had tested this out within Developer Tools → Services and it didn’t complain when yes was used, so I guess both options must work in HA. :slight_smile:

During that testing, I found I had to set adapt_brightness: to true/yes so that if the light was dimmed, it would turn on to full brightness when pressing the on switch, so I’ll leave this as True for now.

I’ve been doing some more tests and have made two changes that I hope will work.

To stop the light dimming, I have manually turned off the switch.adaptive_lighting_adapt_brightness_huelamps switch as I suspect/hope this was the culprit that adjusted my lamp brightness.

The other is due to realising I’d set max_color_temp: 4500 incorrectly. To prevent it going too warm, I should have set this instead: min_color_temp: 2500 as the guide says:

min_color_temp integer (optional, default: 2000)
The warmest color temperature to set the lights to, in Kelvin.

I’ll see how this plays out and will report back on here.

Still seems broken for me on 2021.5.2, anyone else?

1 Like

What is broken? For me, everything works fine on 2021.5.

Ensure you are running the latest version of AL - 41d149d. It’s working for me.

Forgot AL was a Hacs plugin, thought it was integrated. Updating to the latest and temperature changing over time is back!

My update sequence when there is a new HA Core:

  1. Check HACS and update
  2. Check Supervisor Add-ons and update
  3. Update Core

and I only have one restart.

I’m using the built-in integration and unfortunately that’s not working in my case

built-in integration?
You need the current version of the HACS integration:

and then the HA integration:

Ah well, unfortunately this hasn’t worked as my light still dims and colour changes in an evening.

I’ll raise an issue on the Github page to see if this is expected behaviour.

I think it’s working now - I had previously set up an adaptivelights entity in YAML and then renamed it later on, but I noticed last night that it was still appearing within the Integrations view (even after a few reboots). I deleted that particular set of entities and now the bulb is working as expected!

I suspect that my YAML configuration was picked up by the Adaptive Light GUI integration but wasn’t deleted when I renamed that part in YAML. I think both the old and new set of adaptive light entities were trying to adapt the same bulb, causing a clash and not doing what I had specified with the new configuration.

As a result, the bulb stayed 100% bright and the temperature went no warmer than my specified amount. :partying_face:

I have a question regarding adaptative lightning. So I have my bulbs powered off by a normal switch and went I turn it on the bulbs won’t adapt unless I force it to do so by disabling-enabling the adaptativte lightning switch.

I thought this integration is suppose to keep adapting the lights every 90 seconds (as I saw in the config) but seems to not working for me. Any ideas?