basnijholt / adaptive-lighting

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

Manual control not activating anymore after Philips Hue scene #435

Open PizzaPino opened 1 year ago

PizzaPino commented 1 year ago

Before 1.4.0 whenever I used a (dynamic) scene in the Philips Hue app, manual control was recognized and the scene worked. But since that update no matter how often I use a Hue scene, adaptive lighting still takes over and overrides it.

th3w1zard1 commented 1 year ago

Can you set adaptive-lighting's logging to debug and post output of it happening?

th3w1zard1 commented 1 year ago

@PizzaPino I believe this has been fixed in 1.10.1

PizzaPino commented 1 year ago

@PizzaPino I believe this has been fixed in 1.10.0

Yes this seems to have been fixed for lights that have already been on. For lights were off, adaptive lighting takes over about 1 second after the light and the scene was turned on.

th3w1zard1 commented 1 year ago

You need to call light.turn_on twice to set manual control. Are you able to do so with hue scenes?

basnijholt commented 1 year ago

I am implementing an option adapt_only_on_bare_turn_on which instantly triggers manual_control when turning on with brightness or color in PR https://github.com/basnijholt/adaptive-lighting/pull/709.

Enabling this will make sure AL doesn't take over when setting a scene.

JN-Jones commented 1 year ago

Hi,

might be that I'm missing something here as well, but while thanks to #773 home assistant internal scenes lead to manually controlled lights, activating a hue scene does not seeem to do so. The configuration is still the one provided there, especially the above mentioned adapt_only_on_bare_turn_on is set to true. I've tested with different scenes (esp one with dynamics and one without) and I've tried both the default scene.turn_on and the integration hue.activate_scene service.

Here's also a log from activating a scene:

2023-09-07 20:29:42.653 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Setting up AdaptiveLighting with data: {'7779c8ad148955aee214b2f07f44757c': {'undo_update_listener': <function ConfigEntry.add_update_listener.<locals>.<lambda> at 0x7f5d2d1b3060>}} and config_entry <homeassistant.config_entries.ConfigEntry object at 0x7f5d42d268e0>
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of light.tv is None
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of light.stehlampe is None
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of light.bad is None
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of light.kueche_links is None
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of light.kueche_rechts is None
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of light.schlafzimmer_tisch is None
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Set switch settings for lights '['light.bad', 'light.kueche_links', 'light.kueche_rechts', 'light.schlafzimmer_tisch', 'light.stehlampe', 'light.tv']'. now using data: '{'lights': ['light.tv', 'light.stehlampe', 'light.bad', 'light.kueche_links', 'light.kueche_rechts', 'light.schlafzimmer_tisch'], 'interval': datetime.timedelta(seconds=90), 'transition': 45.0, 'initial_transition': 1.0, 'min_brightness': 30, 'max_brightness': 100, 'min_color_temp': 2000, 'max_color_temp': 5500, 'prefer_rgb_color': False, 'sleep_brightness': 20, 'sleep_rgb_or_color_temp': 'color_temp', 'sleep_color_temp': 1000, 'sleep_rgb_color': [255, 56, 0], 'sleep_transition': 1.0, 'transition_until_sleep': False, 'sunrise_time': None, 'min_sunrise_time': None, 'max_sunrise_time': None, 'sunrise_offset': datetime.timedelta(0), 'sunset_time': None, 'min_sunset_time': None, 'max_sunset_time': None, 'sunset_offset': datetime.timedelta(0), 'brightness_mode': 'tanh', 'brightness_mode_time_dark': datetime.timedelta(seconds=5000), 'brightness_mode_time_light': datetime.timedelta(seconds=9000), 'take_over_control': True, 'detect_non_ha_changes': True, 'autoreset_control_seconds': 0, 'only_once': False, 'adapt_only_on_bare_turn_on': True, 'separate_turn_on_commands': False, 'send_split_delay': 0, 'adapt_delay': 0.0, 'skip_redundant_commands': False, 'intercept': True, 'multi_light_intercept': True, 'include_config_in_attributes': False, 'name': 'Main'}'
2023-09-07 20:29:42.655 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Setting up with '['light.bad', 'light.kueche_links', 'light.kueche_rechts', 'light.schlafzimmer_tisch', 'light.stehlampe', 'light.tv']', config_entry.data: '{'name': 'Main'}', config_entry.options: '{'lights': ['light.tv', 'light.stehlampe', 'light.bad', 'light.kueche_links', 'light.kueche_rechts', 'light.schlafzimmer_tisch'], 'interval': 90, 'transition': 45.0, 'initial_transition': 1.0, 'min_brightness': 30, 'max_brightness': 100, 'min_color_temp': 2000, 'max_color_temp': 5500, 'prefer_rgb_color': False, 'sleep_brightness': 20, 'sleep_rgb_or_color_temp': 'color_temp', 'sleep_color_temp': 1000, 'sleep_rgb_color': [255, 56, 0], 'sleep_transition': 1.0, 'transition_until_sleep': False, 'sunrise_time': 'None', 'min_sunrise_time': 'None', 'max_sunrise_time': 'None', 'sunrise_offset': 0, 'sunset_time': 'None', 'min_sunset_time': 'None', 'max_sunset_time': 'None', 'sunset_offset': 0, 'brightness_mode': 'tanh', 'brightness_mode_time_dark': 5000, 'brightness_mode_time_light': 9000, 'take_over_control': True, 'detect_non_ha_changes': True, 'autoreset_control_seconds': 0, 'only_once': False, 'adapt_only_on_bare_turn_on': True, 'separate_turn_on_commands': False, 'send_split_delay': 0, 'adapt_delay': 0.0, 'skip_redundant_commands': False, 'intercept': True, 'multi_light_intercept': True, 'include_config_in_attributes': False}', converted to '{'lights': ['light.tv', 'light.stehlampe', 'light.bad', 'light.kueche_links', 'light.kueche_rechts', 'light.schlafzimmer_tisch'], 'interval': datetime.timedelta(seconds=90), 'transition': 45.0, 'initial_transition': 1.0, 'min_brightness': 30, 'max_brightness': 100, 'min_color_temp': 2000, 'max_color_temp': 5500, 'prefer_rgb_color': False, 'sleep_brightness': 20, 'sleep_rgb_or_color_temp': 'color_temp', 'sleep_color_temp': 1000, 'sleep_rgb_color': [255, 56, 0], 'sleep_transition': 1.0, 'transition_until_sleep': False, 'sunrise_time': None, 'min_sunrise_time': None, 'max_sunrise_time': None, 'sunrise_offset': datetime.timedelta(0), 'sunset_time': None, 'min_sunset_time': None, 'max_sunset_time': None, 'sunset_offset': datetime.timedelta(0), 'brightness_mode': 'tanh', 'brightness_mode_time_dark': datetime.timedelta(seconds=5000), 'brightness_mode_time_light': datetime.timedelta(seconds=9000), 'take_over_control': True, 'detect_non_ha_changes': True, 'autoreset_control_seconds': 0, 'only_once': False, 'adapt_only_on_bare_turn_on': True, 'separate_turn_on_commands': False, 'send_split_delay': 0, 'adapt_delay': 0.0, 'skip_redundant_commands': False, 'intercept': True, 'multi_light_intercept': True, 'include_config_in_attributes': False, 'name': 'Main'}'.
2023-09-07 20:29:42.672 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Sleep Mode: Main: last state is <state switch.adaptive_lighting_sleep_mode_main=off; icon=mdi:sleep, friendly_name=Adaptive Lighting Sleep Mode: Main @ 2023-09-07T19:50:39.775630+02:00>
2023-09-07 20:29:42.672 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Sleep Mode: Main: Turning off
2023-09-07 20:29:42.672 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Adapt Color: Main: last state is <state switch.adaptive_lighting_adapt_color_main=on; icon=mdi:sun-thermometer, friendly_name=Adaptive Lighting Adapt Color: Main @ 2023-09-07T19:50:39.775834+02:00>
2023-09-07 20:29:42.672 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Adapt Color: Main: Turning on
2023-09-07 20:29:42.673 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Adapt Brightness: Main: last state is <state switch.adaptive_lighting_adapt_brightness_main=on; icon=mdi:brightness-4, friendly_name=Adaptive Lighting Adapt Brightness: Main @ 2023-09-07T19:50:39.775962+02:00>
2023-09-07 20:29:42.673 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Adapt Brightness: Main: Turning on
2023-09-07 20:29:42.673 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Called 'async_turn_on', current state is 'None'
2023-09-07 20:29:42.673 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Called '_setup_listeners'
2023-09-07 20:29:42.673 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Cancelled '_setup_listeners'
2023-09-07 20:29:42.673 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: '_update_attrs_and_maybe_adapt_lights' called with context.id='01H9REGF4H:al:JVQW:trn_:00' lights: 'None', transition: '1.0', force: 'True'
2023-09-07 20:29:42.675 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: filtered_lights: '[]'
2023-09-07 20:30:11.936 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Called '_setup_listeners'
2023-09-07 20:30:29.770 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 110, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX43FDQ7RGRZEJ6XCHWN'
2023-09-07 20:30:29.770 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.tv' with context.id='01H9REHX43FDQ7RGRZEJ6XCHWN'
2023-09-07 20:30:29.770 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H9REHX43FDQ7RGRZEJ6XCHWN'
2023-09-07 20:30:29.771 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: No 'on' → 'off' state change has been registered before for 'light.tv'. It's possible that the light was already on when Home Assistant was turned on.
2023-09-07 20:30:29.771 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H9REHX43FDQ7RGRZEJ6XCHWN'
2023-09-07 20:30:29.771 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: '_update_attrs_and_maybe_adapt_lights' called with context.id='01H9REHX4B:al:JVQW:lght:01' lights: '['light.tv']', transition: '1.0', force: 'True'
2023-09-07 20:30:29.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: filtered_lights: '['light.tv']'
2023-09-07 20:30:29.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.tv' with transition 1.0 and context.id=01H9REHX4B:al:JVQW:lght:01
2023-09-07 20:30:29.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 77, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX44WNHWQBE5YE1Z90MR'
2023-09-07 20:30:29.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 77, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'dynamic_palette', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX44FW9YF25XZ9YKWFSA'
2023-09-07 20:30:29.772 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 77, 'hs_color': (15.98, 78.039), 'rgb_color': (255, 109, 56), 'xy_color': (0.6178, 0.3413), 'effect': 'None', 'mode': 'normal', 'dynamics': 'dynamic_palette', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX463QN4VM5XPDR6BPBE'
2023-09-07 20:30:29.773 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 110, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX465JQT96K5D849NW4C'
2023-09-07 20:30:29.773 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.stehlampe' with context.id='01H9REHX465JQT96K5D849NW4C'
2023-09-07 20:30:29.773 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H9REHX465JQT96K5D849NW4C'
2023-09-07 20:30:29.773 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: No 'on' → 'off' state change has been registered before for 'light.stehlampe'. It's possible that the light was already on when Home Assistant was turned on.
2023-09-07 20:30:29.773 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H9REHX465JQT96K5D849NW4C'
2023-09-07 20:30:29.773 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: '_update_attrs_and_maybe_adapt_lights' called with context.id='01H9REHX4D:al:JVQW:lght:02' lights: '['light.stehlampe']', transition: '1.0', force: 'True'
2023-09-07 20:30:29.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: filtered_lights: '['light.stehlampe']'
2023-09-07 20:30:29.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.stehlampe' with transition 1.0 and context.id=01H9REHX4D:al:JVQW:lght:02
2023-09-07 20:30:29.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 77, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX47CVGAF0JZ13ET1KH0'
2023-09-07 20:30:29.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 77, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'dynamic_palette', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX47KERY2JQTY5304V1Y'
2023-09-07 20:30:29.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 77, 'hs_color': (15.98, 78.039), 'rgb_color': (255, 109, 56), 'xy_color': (0.6178, 0.3413), 'effect': 'None', 'mode': 'normal', 'dynamics': 'dynamic_palette', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX49193JY0FAVHRZQNS0'
2023-09-07 20:30:29.776 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Setting color_temp of light light.tv
2023-09-07 20:30:29.776 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.tv with service data {'entity_id': 'light.tv', 'transition': 1.0, 'brightness': 109, 'color_temp_kelvin': 2000}
2023-09-07 20:30:29.776 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.tv, context_id=01H9REHX4B:al:JVQW:lght:01, sleep_time=1.0, force=True, max_length=1, which=both, initial_sleep=False)
2023-09-07 20:30:29.777 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Setting color_temp of light light.stehlampe
2023-09-07 20:30:29.777 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.stehlampe with service data {'entity_id': 'light.stehlampe', 'transition': 1.0, 'brightness': 109, 'color_temp_kelvin': 2000}
2023-09-07 20:30:29.777 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.stehlampe, context_id=01H9REHX4D:al:JVQW:lght:02, sleep_time=1.0, force=True, max_length=1, which=both, initial_sleep=False)
2023-09-07 20:30:29.778 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.tv', 'transition': 1.0, 'brightness': 109, 'color_temp_kelvin': 2000} with context.id='01H9REHX4B:al:JVQW:lght:01'
2023-09-07 20:30:29.778 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Main: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.stehlampe', 'transition': 1.0, 'brightness': 109, 'color_temp_kelvin': 2000} with context.id='01H9REHX4D:al:JVQW:lght:02'
2023-09-07 20:30:29.778 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.tv']')' event with context.id='01H9REHX4B:al:JVQW:lght:01'
2023-09-07 20:30:29.778 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01H9REHX4B:al:JVQW:lght:01', is_skipped_hash='False'
2023-09-07 20:30:29.779 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.stehlampe']')' event with context.id='01H9REHX4D:al:JVQW:lght:02'
2023-09-07 20:30:29.779 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01H9REHX4D:al:JVQW:lght:02', is_skipped_hash='False'
2023-09-07 20:30:30.791 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 109, 'hs_color': (15.98, 78.039), 'rgb_color': (255, 109, 56), 'xy_color': (0.6178, 0.3413), 'effect': 'None', 'mode': 'normal', 'dynamics': 'dynamic_palette', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4B:al:JVQW:lght:01'
2023-09-07 20:30:30.791 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.tv=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown', 'sunrise'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=xy, brightness=109, hs_color=(15.98, 78.039), rgb_color=(255, 109, 56), xy_color=(0.6178, 0.3413), effect=None, mode=normal, dynamics=dynamic_palette, friendly_name=TV, supported_features=44 @ 2023-09-07T20:30:29.763551+02:00>' found for light.tv
2023-09-07 20:30:30.793 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Start transition timer of 1.0 seconds for light light.tv
2023-09-07 20:30:30.793 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 109, 'hs_color': (15.98, 78.039), 'rgb_color': (255, 109, 56), 'xy_color': (0.6178, 0.3413), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4B:al:JVQW:lght:01'
2023-09-07 20:30:30.793 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.tv' is already in 'self.our_last_state_on_change' (01H9REHX4B:al:JVQW:lght:01) adding this state also
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 109, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'TV', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4B:al:JVQW:lght:01'
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.tv' is already in 'self.our_last_state_on_change' (01H9REHX4B:al:JVQW:lght:01) adding this state also
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 109, 'hs_color': (15.98, 78.039), 'rgb_color': (255, 109, 56), 'xy_color': (0.6178, 0.3413), 'effect': 'None', 'mode': 'normal', 'dynamics': 'dynamic_palette', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4D:al:JVQW:lght:02'
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.stehlampe=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire', 'unknown', 'sunrise'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=xy, brightness=109, hs_color=(15.98, 78.039), rgb_color=(255, 109, 56), xy_color=(0.6178, 0.3413), effect=None, mode=normal, dynamics=dynamic_palette, friendly_name=Stehlampe, supported_features=44 @ 2023-09-07T20:30:29.766692+02:00>' found for light.stehlampe
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Start transition timer of 1.0 seconds for light light.stehlampe
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 109, 'hs_color': (15.98, 78.039), 'rgb_color': (255, 109, 56), 'xy_color': (0.6178, 0.3413), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4D:al:JVQW:lght:02'
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.stehlampe' is already in 'self.our_last_state_on_change' (01H9REHX4D:al:JVQW:lght:02) adding this state also
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 109, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4D:al:JVQW:lght:02'
2023-09-07 20:30:30.794 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.stehlampe' is already in 'self.our_last_state_on_change' (01H9REHX4D:al:JVQW:lght:02) adding this state also
2023-09-07 20:30:31.798 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.stehlampe' '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', 'sunrise'], 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 93, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'effect': 'None', 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'Stehlampe', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H9REHX4D:al:JVQW:lght:02'
2023-09-07 20:30:31.798 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.stehlampe' is already in 'self.our_last_state_on_change' (01H9REHX4D:al:JVQW:lght:02) adding this state also
2023-09-07 20:30:31.799 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Transition finished for light light.tv
2023-09-07 20:30:31.799 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Transition finished for light light.stehlampe
2023-09-07 20:30:49.292 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.stehlampe', 'light.tv']', transition=None)' event with context.id='01H9REJG6BZ6FRFJ01MD1KF3CZ'
2023-09-07 20:30:49.466 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.tv' with context.id='01H9REJG6BZ6FRFJ01MD1KF3CZ'
2023-09-07 20:30:50.485 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.stehlampe' with context.id='01H9REJG6BZ6FRFJ01MD1KF3CZ'
PizzaPino commented 9 months ago

Yeah this still doesn’t work. AL still takes over after activating hue.activate_scene inside HA. Workaround for now is to create a scene activation script/automation that also triggers set_manual_control.

mundschenk-at commented 7 months ago

It also does not work with Z2M scenes (which are now HA scene entities). the proper solution would probably be to also react to scene.turn_on and not just light.turn_on?