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

Possible race condition in 1.22.0 #1009

Open Wireheadbe opened 1 month ago

Wireheadbe commented 1 month ago

Home Assistant Adaptive Lighting Issue Template

Please confirm that you have completed the following steps:

Required information for bug reports:

After updating from 1.21.3 to 1.22.0, when multiple adaptive lighting integrations are triggered at the same time (e.g. due to motion sensors); only one of the integrations seems to work.

  1. Debug logs captured while the issue occurred. See here for instructions on enabling debug logging:
1.22.0:
2024-05-26 13:39:17.129 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.keukengroupjson' with context.id='01HYTJ0ZQRH4JRDY4HH37YQBY1'
2024-05-26 13:39:17.236 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.aanrecht00' with context.id='01HYTJ0ZQM29YXJ8306W0N3C4R'
2024-05-26 13:39:25.269 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.keukengroupjson']')' event with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:25.270 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01HYTJ17YG2EPQKXD0H2W21R6J', is_skipped_hash='False'
2024-05-26 13:39:25.270 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01HYTJ17YG2EPQKXD0H2W21R6J): entity_id=['light.keukengroupjson'], params=>', service_data='{'entity_id': ['light.keukengroupjson'], 'params': {}}'
2024-05-26 13:39:25.272 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Switch is off or light is already on for entity_id='light.keukengroupjson', skipped='[]' (is_on='True', is_state='False', manual_control='False', switch._intercept='False')
2024-05-26 13:39:25.272 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{}', skipped='['light.keukengroupjson']'
2024-05-26 13:39:25.276 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.aanrecht00']')' event with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:25.276 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01HYTJ17YG2EPQKXD0H2W21R6J', is_skipped_hash='False'
2024-05-26 13:39:25.277 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01HYTJ17YG2EPQKXD0H2W21R6J): entity_id=['light.aanrecht00'], params=>', service_data='{'entity_id': ['light.aanrecht00'], 'params': {}}'
2024-05-26 13:39:25.277 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{'Adaptive Lighting: aanrecht': ['light.aanrecht00']}', skipped='[]'
2024-05-26 13:39:25.277 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (3) _service_interceptor_turn_on_handler: intercepting entity_ids='['light.aanrecht00']'
2024-05-26 13:39:25.277 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Intercepted TURN_ON call with data {'params': {}, 'entity_id': ['light.aanrecht00']} (01HYTJ17YG2EPQKXD0H2W21R6J)
2024-05-26 13:39:25.279 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: Setting color_temp of light light.aanrecht00
2024-05-26 13:39:25.279 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.aanrecht00 with service data {'entity_id': 'light.aanrecht00', 'transition': 1.0, 'brightness': 255, 'color_temp_kelvin': 3865}
2024-05-26 13:39:25.280 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.aanrecht00, context_id=01HYTJ17YZ:al:MFQW:dpt_:01, sleep_time=1.0, force=False, max_length=1, which=both, initial_sleep=True)
2024-05-26 13:39:25.508 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 254, 'color_temp_kelvin': 3875, 'color_temp': 258, 'hs_color': (26.877, 37.182), 'rgb_color': (255, 202, 160), 'xy_color': (0.428, 0.367), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:25.508 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.keukengroupjson' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:25.508 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='True', context_id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:25.508 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Skipping responding to 'off' → 'on' event for 'light.keukengroupjson' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J' because we are already proactively adapting
2024-05-26 13:39:25.654 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 1, 'color_temp_kelvin': 3875, 'color_temp': 258, 'hs_color': (26.877, 37.182), 'rgb_color': (255, 202, 160), 'xy_color': (0.428, 0.367), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:26.067 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.aanrecht00' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3875, 'color_temp': 258, 'hs_color': (26.877, 37.182), 'rgb_color': (255, 202, 160), 'xy_color': (0.428, 0.367), 'friendly_name': 'Aanrecht', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:26.067 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.aanrecht00' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:26.067 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='True', context_id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:26.067 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Skipping responding to 'off' → 'on' event for 'light.aanrecht00' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J' because we are already proactively adapting
2024-05-26 13:39:26.549 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.aanrecht00' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 159, 'color_temp_kelvin': 3875, 'color_temp': 258, 'hs_color': (26.877, 37.182), 'rgb_color': (255, 202, 160), 'xy_color': (0.428, 0.367), 'friendly_name': 'Aanrecht', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'
2024-05-26 13:39:29.363 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.aanrecht00' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3875, 'color_temp': 258, 'hs_color': (26.877, 37.182), 'rgb_color': (255, 202, 160), 'xy_color': (0.428, 0.367), 'friendly_name': 'Aanrecht', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ17YG2EPQKXD0H2W21R6J'

1.21.3:
2024-05-26 13:43:31.290 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.keukengroupjson']')' event with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.294 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.aanrecht00']')' event with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.528 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 1, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.528 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.keukengroupjson' with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.528 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.528 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: State change 'off' → 'on' triggered by 'light.turn_on'
2024-05-26 13:43:31.528 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.697 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.aanrecht00' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Aanrecht', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.698 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.aanrecht00' with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.698 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:31.698 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: State change 'off' → 'on' triggered by 'light.turn_on'
2024-05-26 13:43:31.698 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:32.065 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.aanrecht00' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 74, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Aanrecht', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:32.530 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HYTJ8SDJ:al:MVSX:lght:01' lights: '['light.keukengroupjson']', transition: '1.0', force: 'True'
2024-05-26 13:43:32.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: filtered_lights: '['light.keukengroupjson']'
2024-05-26 13:43:32.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:32.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.keukengroupjson' with transition 1.0 and context.id=01HYTJ8SDJ:al:MVSX:lght:01
2024-05-26 13:43:32.534 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: Setting color_temp of light light.keukengroupjson
2024-05-26 13:43:32.534 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.keukengroupjson with service data {'entity_id': 'light.keukengroupjson', 'transition': 1.0, 'brightness': 255, 'color_temp_kelvin': 3855}
2024-05-26 13:43:32.534 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.keukengroupjson, context_id=01HYTJ8SDJ:al:MVSX:lght:01, sleep_time=1.5, force=True, max_length=2, which=both, initial_sleep=False)
2024-05-26 13:43:32.538 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.keukengroupjson', 'brightness': 255, 'transition': 0.5} with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:32.538 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.keukengroupjson']')' event with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:32.699 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HYTJ8SJV:al:MFQW:lght:01' lights: '['light.aanrecht00']', transition: '1.0', force: 'True'
2024-05-26 13:43:32.702 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: filtered_lights: '['light.aanrecht00']'
2024-05-26 13:43:32.702 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01HYTJ8R6PTKJ1SMHCZ9HXMZR2'
2024-05-26 13:43:32.702 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.aanrecht00' with transition 1.0 and context.id=01HYTJ8SJV:al:MFQW:lght:01
2024-05-26 13:43:32.703 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: Setting color_temp of light light.aanrecht00
2024-05-26 13:43:32.703 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.aanrecht00 with service data {'entity_id': 'light.aanrecht00', 'transition': 1.0, 'brightness': 255, 'color_temp_kelvin': 3855}
2024-05-26 13:43:32.703 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.aanrecht00, context_id=01HYTJ8SJV:al:MFQW:lght:01, sleep_time=1.0, force=True, max_length=1, which=both, initial_sleep=False)
2024-05-26 13:43:32.709 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] aanrecht: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.aanrecht00', 'transition': 1.0, 'brightness': 255, 'color_temp_kelvin': 3855} with context.id='01HYTJ8SJV:al:MFQW:lght:01'
2024-05-26 13:43:32.710 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.aanrecht00']')' event with context.id='01HYTJ8SJV:al:MFQW:lght:01'
2024-05-26 13:43:32.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 254, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:32.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.keukengroupjson=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=254, color_temp_kelvin=3861, color_temp=259, hs_color=(26.885, 37.447), rgb_color=(255, 202, 159), xy_color=(0.429, 0.368), friendly_name=Keuken, supported_features=44 @ 2024-05-26T15:43:31.528148+02:00>' found for light.keukengroupjson
2024-05-26 13:43:32.775 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Start transition timer of 0.5 seconds for light light.keukengroupjson
2024-05-26 13:43:32.894 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 54, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:32.894 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.keukengroupjson' is already in 'self.our_last_state_on_change' (01HYTJ8SDJ:al:MVSX:lght:01) adding this state also
2024-05-26 13:43:32.903 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 55, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:32.903 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.keukengroupjson' is already in 'self.our_last_state_on_change' (01HYTJ8SDJ:al:MVSX:lght:01) adding this state also
2024-05-26 13:43:33.036 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.aanrecht00' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Aanrecht', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8SJV:al:MFQW:lght:01'
2024-05-26 13:43:33.037 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.aanrecht00=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6666, min_mireds=150, max_mireds=500, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], supported_color_modes=['color_temp', 'xy'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3861, color_temp=259, hs_color=(26.885, 37.447), rgb_color=(255, 202, 159), xy_color=(0.429, 0.368), friendly_name=Aanrecht, supported_features=44 @ 2024-05-26T15:43:31.697899+02:00>' found for light.aanrecht00
2024-05-26 13:43:33.038 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Start transition timer of 1.0 seconds for light light.aanrecht00
2024-05-26 13:43:33.278 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Transition finished for light light.keukengroupjson
2024-05-26 13:43:34.040 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Transition finished for light light.aanrecht00
2024-05-26 13:43:34.040 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] eetkamer: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.keukengroupjson', 'color_temp_kelvin': 3855, 'transition': 0.5} with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:34.041 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.keukengroupjson']')' event with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:35.721 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.keukengroupjson' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': 'color_temp', 'brightness': 254, 'color_temp_kelvin': 3861, 'color_temp': 259, 'hs_color': (26.885, 37.447), 'rgb_color': (255, 202, 159), 'xy_color': (0.429, 0.368), 'friendly_name': 'Keuken', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01HYTJ8SDJ:al:MVSX:lght:01'
2024-05-26 13:43:35.721 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.keukengroupjson' is already in 'self.our_last_state_on_change' (01HYTJ8SDJ:al:MVSX:lght:01) adding this state also
  1. Your Adaptive Lighting configuration:

aanrecht settings: image

eetkamer settings: image -> eetkamer has "split" commands enabled -> Ikea lights which only change one settings at a time

  1. (If using Zigbee2MQTT), provide your configuration files (remove all personal information before posting): not specifically related to Z2MQTT


4.  Describe the bug and how to reproduce it:

In the example below, 2 lights are triggered by a motion sensor: light.keukengroupjson and light.aanrecht00. Keukengroupjson is in integration called "eetkamer". Aanrecht00 is in integration called "aanrecht". 

When I disable "aanrecht00" light to turn on in the motion sensor automation, and only turn on light.keukengroupjson, then the light.keukengroupjson correctly adjust.

When I enable both lights in the automation, only the "aanrecht00" one adjusts. 

5. Steps to reproduce the behavior:

see description above
Wireheadbe commented 1 month ago

Enabling/disabling "skip_redundant_commands" does not change the behavior as well.