Adaptive Lighting integration - sharing a lesson learned if you have light groups (Philips Hue or others)

Set it up yesterday and the first night lights would turn back on after being turned off through Home Assistant.

I successively enabled AND disabled any and all options that seemed that could help including detect non-ha changes and multi-light intercep (though I was turning the lights off through HA) to no avail. Enabled debug mode and after poring over the data the issue became obvious.

We have Philips Hue and while the individual lights are also exposed to HA we do not really use them as part of switches as that’s very inefficient. Instead we have set up groups in the Hue app and those get auto-exposed to HA as well and that’s what we control. We find the Hue bridge actually is very capable in terms of optimizing traffic to the lights.

CONCLUSION: you should only enabl DISJOINT light groups for Adaptive Lighting. Assuming a home with just 2 rooms for simplicity. If you have a “Home” group which includes all your lights, a “Room 1” Group, a “Room 2” Group and say an an “Accent Group” which includes random lights in each room you should ONLY enable Room 1 Group and Room 2 Group for Adaptive Lighting.

Originally, we thought we could enable the “Home” group and “Accent” group" to participate in AL for the rare cases where we use them but that’s a problem. Here’s why.

Imagine Room 1 and Room 2 are ON.
Then you turn off Room 1.

“Home” and “Accent” are still on since at least some lights from those are still on (in the Hue app it does show those groups as a darker color to indicate only some lights are on). So as far as AL is concerned, Home and Accent are being managed by it - they have never been turned off through HA or otherwise - so on the next update interval it dutifully sets them to the correct temp and brightness.

The integration isn’t smart enough to be able to detect and communicate back “turn on only lights within the groups I’m adapting which are on” which BTW is what the Philips Hue app does natively (if you turn off a few lights in a room but then change the brightness slider, it will only change the brightness of the lights that are still on, it’s really intuitive and very nice and sadly no light integration in HA is that smart :P). We cannot really blame AL for this behavior. The implementation could probably look into the group setup (the info is available in HA) and then check the individual status of the lights and then only turn THOSE on but that’s way too complicated and, worse, much less efficient as it’ll be forced to control the lights individually rather than through groups (unless the Philips Hue API exposed to HA could do that natively somehow the way it does it from its own app, I don’t know how they’ve implemented it).

At any rate, “debugging” this situation at 2AM and figuring out how to make it work was somewhat fun but also exhausting. Hopefully it saves someone from experiencing a similar scenario. Again, the solution was to only have AL adapt disjoint groups of lights, in our cases the groups which represent whole rooms. It seems all is well now… for now? I hope forever lol. :).

1 Like