basnijholt / adaptive-lighting

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

Some AL rooms don't work anymore - color temp #769

Open Patrick1610 opened 1 year ago

Patrick1610 commented 1 year ago

Home Assistant Adaptive Lighting Issue Template

Bug Reports

If you need help with using or configuring Adaptive Lighting, please open a Q&A discussion thread here instead.

Before submitting a bug report, please follow these troubleshooting steps:

Please confirm that you have completed the following steps:

Required information for bug reports:

Please include the following information in your issue.

Issues missing this information may not be addressed.

  1. Debug logs captured while the issue occurred. See here for instructions on enabling debug logging:

I can enable the logs, but what moment do I need to capture? The moment when I reload the AL, or the moment where I turn on the switch? Or 5 minutes later, when the AL should update the color temp again?

  1. Your Adaptive Lighting configuration:

adaptive_lighting:

  1. (If using Zigbee2MQTT), provide your configuration files (remove all personal information before posting): I am using Zigbee2MQTT but I don't know what to post without posting personal information. It also seems to me that the problem is not related to the lights since the AL entity behaves strange itself so I'm not sure if this is needed?

  2. Describe the bug and how to reproduce it:

I only use color temp by having an AL instance that has the main switch and color swith turned on, the brightness and sleep are disabled. As you can see in the screenshots, some AL instances (like the Living room) behave strange. The attributes are not loaded and the lights are not changing over time. After enabling a light in the group, the attributes are loaded and the color is adjusted once, but after that the lights still stay the same temperature as since turning on. I am not sure if all or some instances are doing this, but I can't find the problem.

image image

  1. Steps to reproduce the behavior:
basnijholt commented 1 year ago

Hi @Patrick1610, thanks a lot for reaching out and reporting. What do you mean with

After enabling a light in the group

Debugging logs would be nice for the period during which the behavior happens that you describe.

Patrick1610 commented 12 months ago

@basnijholt When I turn on a light that is controlled by AL the attributes change from the first screenshot to the second. As long as I don't the attributes stay empty.

I will look into creating some logs tomorrow or hopefully this weekend!

swm5126 commented 12 months ago

I’m also having this issue randomly with a few lights. I had been on a much older version until recently. Removed all the AL integrations and recreated them but it’s still happening with a few lights. If I reload the integration it will adapt the color immediately but then stops until I do it again.

What logs in particular would be helpful to identify the issue?

ahaverty commented 11 months ago

I'm seeing the same issue, recently upgraded to the latest HA and Adaptive Lighting (1.19.1) at the same time. Tried going back to v1.18.3 but it didn't fix.

Adaptive Lighting, both 1.19.1 and 1.18.3 tested
Home Assistant 2023.8.4
Supervisor 2023.08.3
Operating System 10.5

I believe all of my lights seem to be stuck in incorrect brightnesses/temperatures, even after turning on/off via Home assistant light services throughout the day. I've waited to see if it would change eventually, but they don't.

I've also discovered that reloading the particular integration entry fixes brightness/colour immediately, or also turning the adaptive lighting switch on and off, also fixes it immediately (for the lights configured in that entry anyway).

I also don't see any relevant HA logs for these lights, or any adaptive light logs at all. I've enabled debug logs for adaptive lighting now, I'll update if I catch anything there.

An example of the entry/lights I've been testing against the most:

{
        "entry_id": "9ecb5b05b2b4b0376fa281694d5dfc92",
        "version": 1,
        "domain": "adaptive_lighting",
        "title": "Hallways",
        "data": {
          "name": "Hallways"
        },
        "options": {
          "lights": [
            "light.downstairs_hall_downlight",
            "light.downstairs_hall_pendant_light",
            "light.upstairs_hall_light"
          ],
          "prefer_rgb_color": false,
          "initial_transition": 0.0,
          "sleep_transition": 0.0,
          "transition": 0.0,
          "interval": 300,
          "min_brightness": 30,
          "max_brightness": 100,
          "min_color_temp": 2000,
          "max_color_temp": 5500,
          "sleep_brightness": 1,
          "sleep_rgb_or_color_temp": "color_temp",
          "sleep_color_temp": 1000,
          "sleep_rgb_color": [
            255,
            56,
            0
          ],
          "sunrise_time": "None",
          "max_sunrise_time": "None",
          "sunrise_offset": 0,
          "sunset_time": "None",
          "min_sunset_time": "None",
          "sunset_offset": 0,
          "only_once": false,
          "take_over_control": true,
          "detect_non_ha_changes": false,
          "separate_turn_on_commands": false,
          "adapt_delay": 0
        },
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "unique_id": "Hallways",
        "disabled_by": null
      }
daveLeiser commented 10 months ago

I got the exact same issue after updating HomeAssisstant and AL to the newest version.

Just happens with one light (Hue Panel Aurelle), deleting and recreating rooms doess not fix the issue. I need to manually Turn of AL for that room and turn it on again, than it adapts correctly, but just once. All the other lights work correctly.

Update: I just looked at the debug log and found the following:

2023-10-02 22:34:05.509 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Büro: Ignoring 'off' → 'on' event for 'light.buero_decke' with context.id='01HBS1J60QYCRZ5BQNPH2EEX8M' because 'light.turn_on' was not called by HA and detect_non_ha_changes' is False 2023-10-02 22:34:05.509 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Marking 'light.buero_decke' as manually controlled.

This happend when i was using the hue dimmer switch, which is paired directly to ZHA, no hue bridge running. But i noticed it also happened when the light turned on due to the motion detection automation.

I for now turned off the option take_over_control option, and now it looks like it is adapting again.

mbrevda commented 10 months ago

Same - was on an older version, upgraded, and then suddenly one of my bulbs are being marked as manually controlled and Ignoring 'off' → 'on' event for 'light.master_bathroom_light_bulb' with context.id='01HD366YDKD8GACP0R2ZNQ61WJ' because 'light.turn_on' was not called by HA and 'detect_non_ha_changes' is False. Except that this is an esphome bulb with no web GUI and no other form of control besides HA!

th3w1zard1 commented 10 months ago

Same - was on an older version, upgraded, and then suddenly one of my bulbs are being marked as manually controlled and Ignoring 'off' → 'on' event for 'light.master_bathroom_light_bulb' with context.id='01HD366YDKD8GACP0R2ZNQ61WJ' because 'light.turn_on' was not called by HA and 'detect_non_ha_changes' is False. Except that this is an esphome bulb with no web GUI and no other form of control besides HA!

What older version did you upgrade from? Did you upgrade HA or did you update AL?

mbrevda commented 10 months ago

What older version did you upgrade from? Did you upgrade HA or did you update AL?

I wish I remembered, I think it was 3-4 old but wasn't paying attention when I upgraded. No, I don't think HA was upgraded at the same time.

th3w1zard1 commented 10 months ago

@basnijholt This seems to follow a pattern of other bugs we've since patched. Seems to be a bug cascade from even my first pr.

can you fill me in a bit on what PRs have merged lately that are relevant to this issue? Last I checked in there were some PRs that were merged to fix lights turning on their own, which modified some code in the events in question here.

th3w1zard1 commented 10 months ago

Possibly related to #802 ?

ahaverty commented 9 months ago

@th3w1zard1 I've always had separate turn on disabled (yaml) for the record, and still see this.

mbrevda commented 9 months ago

Beginning to think my issue was related to malfunctioning hardware.

ahaverty commented 9 months ago

I'm still having 'an issue' with all of my adaptive lighting integrations not adapting at all (perhaps different to the original issue if everyone else is seeing intermittent/random issues?).

For me, effectively nothing happens unless I reload each adaptive lighting integration.

I've added a workaround automation in the meantime to reload every ten minutes, but I also can't see any errors/warnings from adaptive lighting, even with debug logs enabled, so I'm stumped on how to contribute here.

ahaverty commented 6 months ago

I still have the exact same problem on latest (AL v1.2.0 | HA 2024.2.2)

My workaround is still working around the issue mostly, but it means AL's manual override doesn't work at all.

th3w1zard1 commented 6 months ago

@ahaverty You should follow the issue template and post a new issue. But it sounds like your issue is with your light's configuration outside of ha.

ahaverty commented 5 months ago

I don't mind moving to a different issue, but it seems like the exact same symptoms to me, no?

Out of interest, why would you suspect something outside of HA @th3w1zard1 ? I would have thought my workaround, which only reloads the Adaptive Lighting integration, indicates that the problem is at an integration level?

@swm5126 seems to have proven the same reload workaround above in https://github.com/basnijholt/adaptive-lighting/issues/769#issuecomment-1694652684

ahaverty commented 5 months ago

Last night I migrated my ZHA radio across to skyconnect, on the latest firmware. Just to rule out my conbee 2 as the issue. I'm still seeing the same issue with AL today (requiring integration reloads to work).

th3w1zard1 commented 5 months ago

I don't mind moving to a different issue, but it seems like the exact same symptoms to me, no?

Out of interest, why would you suspect something outside of HA @th3w1zard1 ? I would have thought my workaround, which only reloads the Adaptive Lighting integration, indicates that the problem is at an integration level?

@swm5126 seems to have proven the same reload workaround above in #769 (comment)

There's several things that point to it being outside of AL:

if you can test with a non-zha light that would narrow the potential problems down considerably.

ahaverty commented 5 months ago

Thanks @th3w1zard1

I'm mostly ZigBee alright, but I do have a Shelly RGBW2 (WiFi) on its own AL instance(?) that has the exact same problems listed above (it's only got brightness, no colour).

If I turn off my workaround for refreshing AL, it just sits a the same brightness all day/night.

I've never had issues (and still don't) with changing brightness or colour manually via HA sliders/app on any bulb, WiFi or ZigBee, if that helps.

And purely to frame things in case I sound like some new idiot to the integration: I've been running mostly the same hardware (majority are IKEA tradfri bulbs, this RGBW2, and a couple of tplink/lidl bulbs) for about 3 years on AL (same-ish configs I have today) without issue up until ~Nov 2023.

ahaverty commented 5 months ago

I see a handful of other open issues that sound similar to this one all from about 2-3 months ago also. Have I missed some change perhaps, I see one person noting they needed to use device commands for AL to work, rather than light.turn_on (that's all I use) https://github.com/basnijholt/adaptive-lighting/issues/853#issuecomment-1826826479

ahaverty commented 5 months ago

@th3w1zard1 actually now that I try that out, I'm able to reproduce this consistently https://github.com/basnijholt/adaptive-lighting/issues/853#issuecomment-1826826479

Repro steps:

  1. Manually change the brightness and/or colour of a bulb to something far away from the current AL brightness/temp (e.g 100% brightness)
  2. Use HA lovelace buttons to turn the bulb off and back on, notice the bulb returns to the AL brightness/temp immediately (i.e ~20% brightness since it's nighttime here)
  3. Repeat step 1 above
  4. Use HA lovelace buttons to turn the bulb off (only)
  5. Using light.turn_on (without any parameters), turn the bulb on

Expected: The bulb turns on to ~20% brightness like it did in step 2 Actual: The bulb remains at 100% brightness and doesn't change

Notes: HA lovelace reports the actual brightness/colour of the bulb correctly, so I don't suspect it's some issue with my HA/bulbs misunderstanding what the actual status is.

Im open to any tips @th3w1zard1 or if I can help report this any better, thank you for helping.


And just to throw in a thought, perhaps that's why some people's issues are only in some bulbs/rooms, and other peoples somehow fix themselves or lead them to think it was hardware related? ~I've always used light.turn_on for all of my bulbs, and have never tried to change these automations (I am far too invested in light.turn_on to even start editing them 🙈)~ edit: see below please

ahaverty commented 5 months ago

Ooh interesting.. When I repeat my repro above, but target the bulb as an entity instead of as a device with light.turn_on, it works as expected. All my light automations target the device with light.turn_on, which again correlates. Hopefully that helps? 😬


Update: I've switched all my light automations to only use entities instead of devices, and AL is back working as expected for all my lights 🙌

th3w1zard1 commented 5 months ago

Update: I've switched all my light automations to only use entities instead of devices, and AL is back working as expected for all my lights 🙌

Well that's interesting. The last time I was invested in the source code here, this entire integration was manipulating the entities. I didn't even know it was possible to have a setup that was devices only. I thought home assistant naturally would create an entity for that device to use. But yes everytime AL does a light.turn_on call it'd be firing it on the entity_id. So you're saying you didn't have entities for any of your lights?

ahaverty commented 5 months ago

Thanks @th3w1zard1

Recap of problem/finding: Adaptive Lighting doesn't adapt colour or brightness ever, for lights that were turned on withlight.turn_on and that service was targeting the device_id. The bulbs just remained at the last used brightness/colour indefinitely.

And when I switch to the lights entity_id in the light.turn_on service, adaptive lighting works as expected (adapts immediately as it turns on, and continuously adapts at my expected interval).

See the following example of an IKEA bulb, where I've chosen the device 'upstairs hall light' Vs it's entity, to help understand my problem vs workaround.

1000017743.jpg

basnijholt commented 5 months ago

Devices are indeed not supported ATM 😢

basnijholt commented 5 months ago

[Copy pasting this message in a few recent open issues]

I just wanted to take a moment to express my heartfelt thanks to everyone that is active in this repo. Your contributions, from answering questions to addressing issues, have been invaluable. It's amazing to see how supportive and helpful our community is!

Adaptive Lighting is all about enhancing your living spaces with smart, sunlight-responsive lighting. We've had quite a few discussions and open issues recently, and I see this as a positive sign of our community's engagement and growth. If you come across anything in the documentation that's unclear or if you have suggestions for improvement, please don't hesitate to share!. Your feedback is crucial for making Adaptive Lighting better for everyone.

On a personal note, I've recently welcomed twin boys into my family, which has been an incredible and life-changing experience. As you can imagine, my time is now more limited, and while I'm doing my best to keep up with the project, there may be delays in my responses. I appreciate your understanding and patience during this time.

Rest assured, I'm fully committed to addressing any bugs, especially those related to new Home Assistant updates, as swiftly as possible. I understand that many issues may stem from hardware limitations or misunderstandings about things like Zigbee groups. Your continued support and collaboration in helping each other out not only strengthen our community but also enhance the Adaptive Lighting experience for all.

Thank you once again for your understanding, patience, and support. Let's keep our houses well lit and adaptive for maximal enjoyment of life! 🌞🏠🌙

mbrevda commented 5 months ago

Congratulations! 🎉🎉🎉