basnijholt / adaptive-lighting

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

When turning on multiple lights together, Lights that are not part of Adaptive Switch also get Adaptive color #749

Closed montezumeflex closed 1 year ago

montezumeflex 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:

    2023-08-15 17:08:38.847 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2', is_skipped_hash='False'
    2023-08-15 17:08:38.847 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01H7WVVS1VQB7XKQ6T2C1PF5S2): area_id=['woonkamer', 'slaapkamer'], params=>', data='{'area_id': ['woonkamer', 'slaapkamer'], 'params': {}}'
    2023-08-15 17:08:38.848 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.woonkamer_spot', 'light.bamboe', 'light.tafel_spot', 'light.hue_lightstrip', 'light.gitaar']' for area_id 'woonkamer'
    2023-08-15 17:08:38.849 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.woonkamer_spot', 'light.bamboe', 'light.tafel_spot', 'light.hue_lightstrip', 'light.gitaar', 'light.bed']' for area_id 'slaapkamer'
    2023-08-15 17:08:38.849 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No switch found for entity_id='light.woonkamer_spot', skipped='['light.woonkamer_spot']'
    2023-08-15 17:08:38.850 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No switch found for entity_id='light.hue_lightstrip', skipped='['light.woonkamer_spot', 'light.hue_lightstrip']'
    2023-08-15 17:08:38.850 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No switch found for entity_id='light.gitaar', skipped='['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']'
    2023-08-15 17:08:38.851 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{'Adaptive Lighting: Test': ['light.bamboe', 'light.tafel_spot', 'light.bed']}', skipped='['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']'
    2023-08-15 17:08:38.851 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (3) _service_interceptor_turn_on_handler: intercepting entity_ids='['light.bamboe', 'light.tafel_spot', 'light.bed']'
    2023-08-15 17:08:38.851 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Intercepted TURN_ON call with data {'params': {}, 'entity_id': ['light.bamboe', 'light.tafel_spot', 'light.bed']} (01H7WVVS1VQB7XKQ6T2C1PF5S2)
    2023-08-15 17:08:38.859 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Test: Setting color_temp of light light.bed
    2023-08-15 17:08:38.859 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.bed with service data {'entity_id': 'light.bed', 'transition': 1.0, 'brightness': 255, 'color_temp_kelvin': 4735}
    2023-08-15 17:08:38.861 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (5) _service_interceptor_turn_on_handler: calling `light.turn_on` with skipped='['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']', data: '{'params': {'transition': 1.0, 'brightness': 255, 'color_temp': 211, 'color_temp_kelvin': 4735}, 'entity_id': ['light.bamboe', 'light.tafel_spot', 'light.bed']}', context='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:38.861 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (6) _service_interceptor_turn_on_handler: calling `light.turn_on` with skipped='['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']', data: '{'params': {'transition': 1.0, 'brightness': 255, 'color_temp': 211, 'color_temp_kelvin': 4735}, 'entity_id': ['light.bamboe', 'light.tafel_spot', 'light.bed']}', context='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:38.880 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01H7WVVS2C:al:KRSX:skpp:03', is_skipped_hash='True'
    2023-08-15 17:08:38.880 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01H7WVVS2C:al:KRSX:skpp:03): entity_id=['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar'], params=transition=1.0, brightness=255, color_temp=211, color_temp_kelvin=4735>', data='{'entity_id': ['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar'], 'params': {'transition': 1.0, 'brightness': 255, 'color_temp': 211, 'color_temp_kelvin': 4735}}'
    2023-08-15 17:08:38.884 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No switch found for entity_id='light.woonkamer_spot', skipped='['light.woonkamer_spot']'
    2023-08-15 17:08:38.885 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No switch found for entity_id='light.hue_lightstrip', skipped='['light.woonkamer_spot', 'light.hue_lightstrip']'
    2023-08-15 17:08:38.885 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No switch found for entity_id='light.gitaar', skipped='['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']'
    2023-08-15 17:08:38.885 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{}', skipped='['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']'
    2023-08-15 17:08:38.887 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.woonkamer_spot', 'light.bamboe', 'light.tafel_spot', 'light.hue_lightstrip', 'light.gitaar']' for area_id 'woonkamer'
    2023-08-15 17:08:38.887 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.woonkamer_spot', 'light.bamboe', 'light.tafel_spot', 'light.hue_lightstrip', 'light.gitaar', 'light.bed']' for area_id 'slaapkamer'
    2023-08-15 17:08:38.888 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.woonkamer_spot', 'light.bamboe', 'light.tafel_spot', 'light.hue_lightstrip', 'light.gitaar', 'light.bed']')' event with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:38.888 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Test: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.bed, context_id=01H7WVVS2B:al:KRSX:dpt_:02, sleep_time=1.0, force=False, max_length=1, which=both, initial_sleep=True)
    2023-08-15 17:08:38.888 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.woonkamer_spot', 'light.hue_lightstrip', 'light.gitaar']')' event with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:39.239 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.gitaar' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 255, 'hs_color': (8.502, 96.863), 'rgb_color': (255, 43, 8), 'xy_color': (0.6896, 0.3074), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Gitaar lamp', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:39.239 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.gitaar=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=xy, brightness=255, hs_color=(8.502, 96.863), rgb_color=(255, 43, 8), xy_color=(0.6896, 0.3074), effect=None, mode=normal, dynamics=none, friendly_name=Gitaar lamp, supported_features=44 @ 2023-08-15T17:08:39.237000+02:00>' found for light.gitaar
    2023-08-15 17:08:39.240 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.gitaar, not starting timer.
    2023-08-15 17:08:39.240 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.gitaar' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:39.240 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:39.240 WARNING (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.gitaar' with context.id='01H7WVVS2C:al:KRSX:skpp:03' and event='<Event state_changed[L]: entity_id=light.gitaar, old_state=<state light.gitaar=off; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], mode=normal, dynamics=none, friendly_name=Gitaar lamp, supported_features=44 @ 2023-08-15T13:54:05.270048+02:00>, new_state=<state light.gitaar=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=xy, brightness=255, hs_color=(8.502, 96.863), rgb_color=(255, 43, 8), xy_color=(0.6896, 0.3074), effect=None, mode=normal, dynamics=none, friendly_name=Gitaar lamp, supported_features=44 @ 2023-08-15T17:08:39.237000+02:00>>', triggered by the adaptive_lighting integration itself, which *should* not happen. If you see this please submit an issue with your full logs at https://github.com/basnijholt/adaptive-lighting
    2023-08-15 17:08:39.248 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: State change 'off' → 'on' triggered by 'light.turn_on'
    2023-08-15 17:08:39.251 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.gitaar' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 4739, 'color_temp': 211, 'hs_color': (26.803, 22.908), 'rgb_color': (255, 222, 196), 'xy_color': (0.383, 0.353), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Gitaar lamp', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:39.252 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.gitaar=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=4739, color_temp=211, hs_color=(26.803, 22.908), rgb_color=(255, 222, 196), xy_color=(0.383, 0.353), effect=None, mode=normal, dynamics=none, friendly_name=Gitaar lamp, supported_features=44 @ 2023-08-15T17:08:39.237000+02:00>' found for light.gitaar
    2023-08-15 17:08:39.252 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.gitaar, not starting timer.
    2023-08-15 17:08:40.262 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.woonkamer_spot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 53, 'color_temp_kelvin': 2865, 'color_temp': 349, 'hs_color': (28.062, 60.691), 'rgb_color': (255, 172, 100), 'xy_color': (0.509, 0.385), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Woonkamer spot', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:40.262 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.woonkamer_spot=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=53, color_temp_kelvin=2865, color_temp=349, hs_color=(28.062, 60.691), rgb_color=(255, 172, 100), xy_color=(0.509, 0.385), effect=None, mode=normal, dynamics=none, friendly_name=Woonkamer spot, supported_features=44 @ 2023-08-15T17:08:40.249260+02:00>' found for light.woonkamer_spot
    2023-08-15 17:08:40.263 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.woonkamer_spot, not starting timer.
    2023-08-15 17:08:40.263 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.woonkamer_spot' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:40.263 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:40.263 WARNING (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.woonkamer_spot' with context.id='01H7WVVS2C:al:KRSX:skpp:03' and event='<Event state_changed[L]: entity_id=light.woonkamer_spot, old_state=<state light.woonkamer_spot=off; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], mode=normal, dynamics=none, friendly_name=Woonkamer spot, supported_features=44 @ 2023-08-15T13:54:05.268522+02:00>, new_state=<state light.woonkamer_spot=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=53, color_temp_kelvin=2865, color_temp=349, hs_color=(28.062, 60.691), rgb_color=(255, 172, 100), xy_color=(0.509, 0.385), effect=None, mode=normal, dynamics=none, friendly_name=Woonkamer spot, supported_features=44 @ 2023-08-15T17:08:40.249260+02:00>>', triggered by the adaptive_lighting integration itself, which *should* not happen. If you see this please submit an issue with your full logs at https://github.com/basnijholt/adaptive-lighting
    2023-08-15 17:08:40.280 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: State change 'off' → 'on' triggered by 'light.turn_on'
    2023-08-15 17:08:40.285 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.woonkamer_spot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 2865, 'color_temp': 349, 'hs_color': (28.062, 60.691), 'rgb_color': (255, 172, 100), 'xy_color': (0.509, 0.385), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Woonkamer spot', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:40.286 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.woonkamer_spot=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=2865, color_temp=349, hs_color=(28.062, 60.691), rgb_color=(255, 172, 100), xy_color=(0.509, 0.385), effect=None, mode=normal, dynamics=none, friendly_name=Woonkamer spot, supported_features=44 @ 2023-08-15T17:08:40.249260+02:00>' found for light.woonkamer_spot
    2023-08-15 17:08:40.286 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.woonkamer_spot, not starting timer.
    2023-08-15 17:08:40.287 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.woonkamer_spot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 4739, 'color_temp': 211, 'hs_color': (26.803, 22.908), 'rgb_color': (255, 222, 196), 'xy_color': (0.383, 0.353), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Woonkamer spot', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS2C:al:KRSX:skpp:03'
    2023-08-15 17:08:40.287 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.woonkamer_spot' is already in 'self.our_last_state_on_change' (01H7WVVS2C:al:KRSX:skpp:03) adding this state also
    2023-08-15 17:08:40.287 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.bamboe' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 5524, 'color_temp': 181, 'hs_color': (28.004, 12.556), 'rgb_color': (255, 237, 222), 'xy_color': (0.354, 0.343), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Bamboe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.287 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.bamboe' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.288 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='True', context_id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.288 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Skipping responding to 'off' → 'on' event for 'light.bamboe' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2' because we are already proactively adapting
    2023-08-15 17:08:40.288 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.bamboe' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['None', 'candle', 'fire', 'unknown'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 4739, 'color_temp': 211, 'hs_color': (26.803, 22.908), 'rgb_color': (255, 222, 196), 'xy_color': (0.383, 0.353), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Bamboe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.288 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tafel_spot' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 454, 'effect_list': ['None', 'candle'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 5524, 'color_temp': 181, 'hs_color': (28.004, 12.556), 'rgb_color': (255, 237, 222), 'xy_color': (0.354, 0.343), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Tafel Spot', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.289 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.tafel_spot' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.289 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='True', context_id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.289 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Skipping responding to 'off' → 'on' event for 'light.tafel_spot' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2' because we are already proactively adapting
    2023-08-15 17:08:40.289 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tafel_spot' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 454, 'effect_list': ['None', 'candle'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 4739, 'color_temp': 211, 'hs_color': (26.803, 22.908), 'rgb_color': (255, 222, 196), 'xy_color': (0.383, 0.353), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Tafel Spot', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.289 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.bed' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 454, 'effect_list': ['None', 'candle'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 5524, 'color_temp': 181, 'hs_color': (28.004, 12.556), 'rgb_color': (255, 237, 222), 'xy_color': (0.354, 0.343), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Bed', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.289 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.bed' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.290 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='True', context_id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
    2023-08-15 17:08:40.290 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Skipping responding to 'off' → 'on' event for 'light.bed' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2' because we are already proactively adapting
    2023-08-15 17:08:40.290 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.bed' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 454, 'effect_list': ['None', 'candle'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 4739, 'color_temp': 211, 'hs_color': (26.803, 22.908), 'rgb_color': (255, 222, 196), 'xy_color': (0.383, 0.353), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Bed', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H7WVVS1VQB7XKQ6T2C1PF5S2'
  2. Your Adaptive Lighting configuration:

I don't have it configured via YAML, so didn't know how to copy all my settings here. I have created a new switch, so all the settings are default, except for "detect_non_ha_changes, which I enabled. Below I included the lights I added to the switch:

adaptive_lighting: lights:

  1. (If using Zigbee2MQTT), provide your configuration files (remove all personal information before posting):
    • devices.yaml
    • groups.yaml
    • configuration.yaml ⚠️; Warning REMOVE ALL of the PERSONAL INFORMATION BELOW before posting ⚠️;
      • mqtt: server:
      • mqtt: user:
      • mqtt: password:
      • advanced: pan_id:
      • advanced: network_key:
      • anything in log_syslog if you use this
    • Brand and model number of problematic light(s)


4.  Describe the bug and how to reproduce it:

I have 5 lamps in my living room:

  - light.bamboe 
  - light.tafel_spot 
  - light.bed

 - light.gitaar
 - light.woonkamer_spot

The first 3 are controlled by "Adaptive_lighting_test", the bottom 2 I have always seat a fixed color/brightness. For example the guitar lamp is always a shade of red.

When I get home it automatically calls an automation "Turn on the lights when I get home" which calls the service 'Light turn on' for the area "woonkamer" and "Slaapkamer. I have also tested this by changing the automation to not call the area, but call the individual entities.

However, once I get home now, the 6 lights turn on, but all get the color from the adaptive light switch.  - light.gitaar and - light.woonkamer_spot would previously turn on with their previous color that they had when I turned of the lights.

I tried troubleshooting and noticed that once you unselect 'multi_light_intercept' in the options the lights work on like they used to do, so the first 3 lamps turn on with adaptive brightness, and the other 2 turn on with their previous value.

5. Steps to reproduce the behavior:

1) Turn lights on:

 - light.bamboe 
  - light.tafel_spot 
  - light.bed

 - light.gitaar
 - light.woonkamer_spot

2) Set light.gitaar and light.woonkamer to a red color.

3) Turn all lights of.

4) Run automation to turn all the light on together.

The 5 lamps turn on. First 3 use adaptive light as intended.  Light.gitaar and light woonkamer_spot should be red, but are also the color and brightness of adaptive light, even though they are not part of the switch.
basnijholt commented 1 year ago

Thanks a lot for reporting!

I assume light.hue_lightstrip is also not part of the AL switch?

basnijholt commented 1 year ago

@montezumeflex, I am quite sure that I fixed this issue in https://github.com/basnijholt/adaptive-lighting/pull/751.

Would you be able to install the latest main branch?

In HACS, click on Redownload:

image image
montezumeflex commented 1 year ago

Thanks a lot for reporting!

I assume light.hue_lightstrip is also not part of the AL switch?

Correct, it’s an unused light. I’m going to test the main branch right now

montezumeflex commented 1 year ago

I downloaded the main branch, switched on the multi_light_intercept and tested the different automations, they are all working as intended again.

Massive thanks for proving this fix so quickly!

basnijholt commented 1 year ago

Awesome! Thanks a lot for reporting back. I will release 1.19.1 soon 😄