basnijholt / adaptive-lighting

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

Lights won't turn on with motion automation after sunset with AL enabled #958

Closed jjpeersman closed 1 week ago

jjpeersman commented 3 months ago

Please confirm that you have completed the following steps:

  1. Debug logs captured while the issue occurred.
2024-04-02 21:23:57.964 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01HTG49A46RHCSSS2FG9M05HCC', is_skipped_hash='False'
2024-04-02 21:23:57.964 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01HTG49A46RHCSSS2FG9M05HCC): entity_id=['light.keuken_plafond'], params=>', service_data='{'entity_id': ['light.keuken_plafond'], 'params': {}}'
2024-04-02 21:23:57.964 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{'Adaptive Lighting: Adaptieve verlichting': ['light.keuken_plafond']}', skipped='[]'
2024-04-02 21:23:57.965 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (3) _service_interceptor_turn_on_handler: intercepting entity_ids='['light.keuken_plafond']'
2024-04-02 21:23:57.965 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Intercepted TURN_ON call with data {'params': {}, 'entity_id': ['light.keuken_plafond']} (01HTG49A46RHCSSS2FG9M05HCC)
2024-04-02 21:23:57.968 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptieve verlichting: Setting color_temp of light light.keuken_plafond
2024-04-02 21:23:57.975 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.keuken_plafond with service data {'entity_id': 'light.keuken_plafond', 'transition': 1.0, 'brightness': 209, 'color_temp_kelvin': 2000}
2024-04-02 21:23:57.976 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.keuken_plafond']')' event with context.id='01HTG49A46RHCSSS2FG9M05HCC'
2024-04-02 21:23:57.976 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptieve verlichting: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.keuken_plafond, context_id=01HTG49A4G:al:IFSG:dpt_:7Z, sleep_time=1.0, force=False, max_length=1, which=both, initial_sleep=True)
  1. Your Adaptive Lighting configuration:

I use the default configuration everywhere. The only thing I changed is: min_brightness = 50 sleep_brightness = unchecked

I already removed the add-on and reinstalled it. The behavior is unfortunately the same.

  1. (If using Zigbee2MQTT), i am not using zigbee2mqtt

  2. Describe the bug and how to reproduce it: i have lights controlled by motion sensors. The lights are adapted by adaptive lighting. This worked flawlessy in the past. All of a sudden the lights are not turning on anymore when motion is detected. HA correctly fires the automation, but the light stays off. The weird thing is: this only happens after sunset. I double checked and sleep mode is off. I know AL is causing the issue here because when i switch off the main AL switch, the lights turn on as expected. Also, when manually executing the same automation, the lights turn on. The lights change color nicely by the way until sunset. After this, it is not working anymore. This really got me lost.

  3. Steps to reproduce the behavior: after sunset:

    • move in the kitchen
    • lights will not turn on

before sunset:

wise-rice commented 1 week ago

+1 My motion sensors also show weird behavior recently. Lights either switch on for 1s, then off, then on again after a few seconds- or they do turn ob, but randomly turn off after a few minutes. Have you found a solution?

jjpeersman commented 1 week ago

I did a bunch of testing and ultimately my solution was to switch to Circadian Lighting. I have zero issues ever since!

basnijholt commented 1 week ago

That is because it is much simpler. Glad you found a solution.