basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.7k stars 127 forks source link

Light stuck / not adapting #985

Open hesspoint opened 2 months ago

hesspoint commented 2 months ago

I have a couple of lights in my hallway I want to control with AL. All are Hue bulbs/spots connected via Zigbee2MQTT. All lights work well and turn on and off and everything just fine. I have an automation with a motion sensor that fires lights.turn_on and off.

For all lights but one AL works well. However there is one light (single light bulb) that does not adjust brightness and color temp when turned on via the automation. It turns on but with the settings that it had earlier.

However if I toggle switch.adaptive_lighting_hallway off and back on then it does adjust. But it stays stuck on that brightness / color temp until I manually toggle again.

I also removed the light from the AL config and put it back but no change. Of course I did a restart of Zigbee2MQTT and HA. Needless to say I am on latest prod version for everything (HA, AL, Z2M). It is very strange. Anyone have an idea?

hesspoint commented 2 months ago

Quick update, I had experimented with some settings. Mostly the adapt_delay as I thought maybe some lights are too slow to turn on so that they miss the adaptation. While this seemed fixed my one light I now have moved all my rooms to DL and notice that it is a complete Desaster. Most of the lights in some cases entire rooms do not adapt at all with motion triggers. For example I walked into my bathroom this morning and sleep mode was def. Off again but the lights were all still in sleep. Only way as described is to toggle the switch in the integration. That makes the change momentarily but then the lights get stuck again. Maybe it is some weird setting but I don't know what it could be. I need help!!! Thanks

hesspoint commented 1 month ago

Hi,

I was wondering if this is being addressed? Tbh I am really frustrated and the integration is not running properly for days now and no matter what changes I make to the settings, the lights will always be going into manual control. Even if there is nothing that could be logically triggering it. Because of that my lights are always stuck and do not adapt.

I also added my journey of pain here: https://community.home-assistant.io/t/new-adaptive-lighting-integration/243788/291

I really would appreciate some help and guidance as I am about to kick out that integration for good and move on to some other solution. It is simply not worth my time anymore and all the frustration over the past days

MrEbbinghaus commented 1 month ago

I noticed the same and suspect it broke with 2024.5, but I don't know what exactly.

I have a suspicion about these events:

But this was not only a deprecation notice, there was also a code change that removes the code for run_immediately=False, although it was only deprecated for 2025.5: https://github.com/home-assistant/core/pull/115169/files#diff-79667bda301cc51e7bdf9df436c097570bd3ea3bf7a78091029a8fef9df27587R1505-R1508

@bdraco I guess that was a little too optimistic 🙂

Since its unlikely anyone was calling run_immediately with False [..]

bdraco commented 1 month ago

While I'd recommend fixing whatever race is going on instead, you can get the same semantics as before by adding await asyncio.sleep(0) at the top of each function instead.

MrEbbinghaus commented 1 month ago

I can confirm that it wasn't https://github.com/home-assistant/core/pull/115169 after all, at least not in my situation.