Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lights turn on when running automation that turns them off #1069

Open
4 tasks done
gregrs-uk opened this issue Nov 12, 2024 · 0 comments
Open
4 tasks done

Lights turn on when running automation that turns them off #1069

gregrs-uk opened this issue Nov 12, 2024 · 0 comments

Comments

@gregrs-uk
Copy link

gregrs-uk commented Nov 12, 2024

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:
2024-11-12 08:48:21.552 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRYFHF:al:JNUX:ntrv:T3' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:48:21.563 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: filtered_lights: '[]'
2024-11-12 08:48:31.811 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRYSJ3:al:IRUW:ntrv:U4' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:48:31.824 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '[]'
2024-11-12 08:48:34.111 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.downstairs_wc_switch_left']' for area_id 'downstairs_wc'
2024-11-12 08:48:34.112 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.downstairs_wc_switch_left', 'light.hall_light']' for area_id 'hall'
2024-11-12 08:48:34.126 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.downstairs_wc_switch_left', 'light.hall_light', 'light.lounge_dimmer_r', 'light.lounge_main_light', 'light.lounge_lamp']' for area_id 'lounge'
2024-11-12 08:48:34.127 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.downstairs_wc_switch_left', 'light.hall_light', 'light.lounge_dimmer_r', 'light.lounge_main_light', 'light.lounge_lamp', 'light.study_light']' for area_id 'study'
2024-11-12 08:48:34.128 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.downstairs_wc_switch_left', 'light.hall_light', 'light.lounge_dimmer_r', 'light.lounge_main_light', 'light.lounge_lamp', 'light.study_light', 'light.utility_room_switch_left']' for area_id 'utility_room'
2024-11-12 08:48:34.128 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.downstairs_wc_switch_left', 'light.hall_light', 'light.lounge_dimmer_r', 'light.lounge_main_light', 'light.lounge_lamp', 'light.study_light', 'light.utility_room_switch_left']', transition=10)' event with context.id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.346 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.dining_table_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3115, 'color_temp': 321, 'hs_color': (27.646, 53.858), 'rgb_color': (255, 180, 117), 'xy_color': (0.487, 0.381), 'friendly_name': 'Dining table light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.347 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.dining_table_light' with context.id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.347 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.347 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: delta_time='377.152217' > delay='5'
2024-11-12 08:48:34.347 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.348 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRYW1C:al:IRUW:lght:U5' lights: '['light.dining_table_light']', transition: '2.0', force: 'True'
2024-11-12 08:48:34.353 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '['light.dining_table_light']'
2024-11-12 08:48:34.353 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='True', context_id='01JCFRHC0W:al:IRUW:ntrc:T9'
2024-11-12 08:48:34.353 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.dining_table_light' with transition 2.0 and context.id=01JCFRYW1C:al:IRUW:lght:U5
2024-11-12 08:48:34.362 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Setting color_temp of light light.dining_table_light
2024-11-12 08:48:34.363 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.dining_table_light with service data {'entity_id': 'light.dining_table_light', 'transition': 2.0, 'brightness': 255, 'color_temp_kelvin': 3140}
2024-11-12 08:48:34.363 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.dining_table_light, context_id=01JCFRYW1C:al:IRUW:lght:U5, sleep_time=2.0, force=True, max_length=1, which=both, initial_sleep=False)
2024-11-12 08:48:34.365 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.dining_table_light', 'transition': 2.0, 'brightness': 255, 'color_temp_kelvin': 3140} with context.id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:34.366 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.dining_table_light']')' event with context.id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:34.367 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01JCFRYW1C:al:IRUW:lght:U5', is_skipped_hash='False'
2024-11-12 08:48:34.388 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.dining_table_light' with context.id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:34.424 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Transition finished for light light.hall_light
2024-11-12 08:48:34.521 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.play_mat_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3115, 'color_temp': 321, 'hs_color': (27.646, 53.858), 'rgb_color': (255, 180, 117), 'xy_color': (0.487, 0.381), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.521 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.play_mat_light' with context.id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.522 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.522 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: delta_time='377.321862' > delay='5'
2024-11-12 08:48:34.523 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:34.524 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRYW6V:al:IRUW:lght:U6' lights: '['light.play_mat_light']', transition: '2.0', force: 'True'
2024-11-12 08:48:34.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '['light.play_mat_light']'
2024-11-12 08:48:34.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRJZ3S:al:IRUW:ntrv:TF'
2024-11-12 08:48:34.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.play_mat_light' with transition 2.0 and context.id=01JCFRYW6V:al:IRUW:lght:U6
2024-11-12 08:48:34.539 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Setting color_temp of light light.play_mat_light
2024-11-12 08:48:34.539 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.play_mat_light with service data {'entity_id': 'light.play_mat_light', 'transition': 2.0, 'brightness': 255, 'color_temp_kelvin': 3140}
2024-11-12 08:48:34.540 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.play_mat_light, context_id=01JCFRYW6V:al:IRUW:lght:U6, sleep_time=2.0, force=True, max_length=1, which=both, initial_sleep=False)
2024-11-12 08:48:34.545 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.play_mat_light', 'transition': 2.0, 'brightness': 255, 'color_temp_kelvin': 3140} with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:34.546 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.play_mat_light']')' event with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:34.546 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01JCFRYW6V:al:IRUW:lght:U6', is_skipped_hash='False'
2024-11-12 08:48:34.556 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.play_mat_light' with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:34.650 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.hall_light' with context.id='01JCFRYVSVDEV0W658NAZ883N4'
2024-11-12 08:48:35.747 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.dining_table_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3144, 'color_temp': 318, 'hs_color': (27.604, 53.118), 'rgb_color': (255, 181, 119), 'xy_color': (0.484, 0.38), 'friendly_name': 'Dining table light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:35.748 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.dining_table_light=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3144, color_temp=318, hs_color=(27.604, 53.118), rgb_color=(255, 181, 119), xy_color=(0.484, 0.38), friendly_name=Dining table light, supported_features=44 @ 2024-11-12T08:48:35.747443+00:00>' found for light.dining_table_light
2024-11-12 08:48:35.762 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.dining_table_light, not starting timer.
2024-11-12 08:48:35.762 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.dining_table_light' with context.id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:35.763 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:35.763 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: 'on' → 'off' state change has the same context.id as the 'off' → 'on' state change for 'light.dining_table_light'. This is probably a false positive.
2024-11-12 08:48:35.763 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Cancelling adjusting lights for light.dining_table_light
2024-11-12 08:48:35.770 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.play_mat_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3144, 'color_temp': 318, 'hs_color': (27.604, 53.118), 'rgb_color': (255, 181, 119), 'xy_color': (0.484, 0.38), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:35.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.play_mat_light=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3144, color_temp=318, hs_color=(27.604, 53.118), rgb_color=(255, 181, 119), xy_color=(0.484, 0.38), friendly_name=Play mat light, supported_features=44 @ 2024-11-12T08:48:35.770272+00:00>' found for light.play_mat_light
2024-11-12 08:48:35.774 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.play_mat_light, not starting timer.
2024-11-12 08:48:35.775 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.play_mat_light' with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:35.775 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:35.775 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: 'on' → 'off' state change has the same context.id as the 'off' → 'on' state change for 'light.play_mat_light'. This is probably a false positive.
2024-11-12 08:48:35.775 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Cancelling adjusting lights for light.play_mat_light
2024-11-12 08:48:35.816 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.dining_table_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3134, 'color_temp': 319, 'hs_color': (27.618, 53.372), 'rgb_color': (255, 181, 118), 'xy_color': (0.485, 0.381), 'friendly_name': 'Dining table light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:35.817 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.dining_table_light=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3134, color_temp=319, hs_color=(27.618, 53.372), rgb_color=(255, 181, 118), xy_color=(0.485, 0.381), friendly_name=Dining table light, supported_features=44 @ 2024-11-12T08:48:35.747443+00:00>' found for light.dining_table_light
2024-11-12 08:48:35.818 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.dining_table_light, not starting timer.
2024-11-12 08:48:35.842 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.play_mat_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3134, 'color_temp': 319, 'hs_color': (27.618, 53.372), 'rgb_color': (255, 181, 118), 'xy_color': (0.485, 0.381), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:35.843 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.play_mat_light=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3134, color_temp=319, hs_color=(27.618, 53.372), rgb_color=(255, 181, 118), xy_color=(0.485, 0.381), friendly_name=Play mat light, supported_features=44 @ 2024-11-12T08:48:35.770272+00:00>' found for light.play_mat_light
2024-11-12 08:48:35.843 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No last service data for light light.play_mat_light, not starting timer.
2024-11-12 08:48:36.734 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.play_mat_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3154, 'color_temp': 317, 'hs_color': (27.589, 52.866), 'rgb_color': (255, 182, 120), 'xy_color': (0.482, 0.38), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:36.734 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.play_mat_light' is already in 'self.our_last_state_on_change' (01JCFRYW6V:al:IRUW:lght:U6) adding this state also
2024-11-12 08:48:37.052 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRYYNW:al:JNUX:ntrv:T4' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:48:37.057 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: filtered_lights: '[]'
2024-11-12 08:48:37.734 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.play_mat_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3144, 'color_temp': 318, 'hs_color': (27.604, 53.118), 'rgb_color': (255, 181, 119), 'xy_color': (0.484, 0.38), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:37.734 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: State change event of 'light.play_mat_light' is already in 'self.our_last_state_on_change' (01JCFRYW6V:al:IRUW:lght:U6) adding this state also
2024-11-12 08:48:40.833 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.dining_table_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3144, 'color_temp': 318, 'hs_color': (27.604, 53.118), 'rgb_color': (255, 181, 119), 'xy_color': (0.484, 0.38), 'friendly_name': 'Dining table light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRZ2C0JWCQG7776K7R1TA4'
2024-11-12 08:48:41.769 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Landing: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRZ399:al:JRQW:ntrv:CV' lights: 'None', transition: '45.0', force: 'False'
2024-11-12 08:48:41.788 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Landing: filtered_lights: '[]'
2024-11-12 08:48:47.312 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRZ8PF:al:IRUW:ntrv:U7' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:48:47.324 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '['light.dining_table_light', 'light.play_mat_light']'
2024-11-12 08:48:47.325 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYW1C:al:IRUW:lght:U5'
2024-11-12 08:48:47.325 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.dining_table_light' with transition 0.0 and context.id=01JCFRZ8PF:al:IRUW:ntrv:U7
2024-11-12 08:48:47.343 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Setting color_temp of light light.dining_table_light
2024-11-12 08:48:47.343 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.dining_table_light with service data {'entity_id': 'light.dining_table_light', 'brightness': 255, 'color_temp_kelvin': 3140}
2024-11-12 08:48:47.344 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.dining_table_light, context_id=01JCFRZ8PF:al:IRUW:ntrv:U7, sleep_time=0.0, force=False, max_length=1, which=both, initial_sleep=False)
2024-11-12 08:48:47.345 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRYW6V:al:IRUW:lght:U6'
2024-11-12 08:48:47.345 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.play_mat_light' with transition 0.0 and context.id=01JCFRZ8PF:al:IRUW:ntrv:U7
2024-11-12 08:48:47.355 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Setting color_temp of light light.play_mat_light
2024-11-12 08:48:47.355 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.play_mat_light with service data {'entity_id': 'light.play_mat_light', 'brightness': 255, 'color_temp_kelvin': 3140}
2024-11-12 08:48:47.356 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.play_mat_light, context_id=01JCFRZ8PF:al:IRUW:ntrv:U7, sleep_time=0.0, force=False, max_length=1, which=both, initial_sleep=False)
2024-11-12 08:48:47.357 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.dining_table_light', 'brightness': 255, 'color_temp_kelvin': 3140} with context.id='01JCFRZ8PF:al:IRUW:ntrv:U7'
2024-11-12 08:48:47.359 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.dining_table_light']')' event with context.id='01JCFRZ8PF:al:IRUW:ntrv:U7'
2024-11-12 08:48:47.359 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01JCFRZ8PF:al:IRUW:ntrv:U7', is_skipped_hash='False'
2024-11-12 08:48:47.362 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.play_mat_light', 'brightness': 255, 'color_temp_kelvin': 3140} with context.id='01JCFRZ8PF:al:IRUW:ntrv:U7'
2024-11-12 08:48:47.363 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.play_mat_light']')' event with context.id='01JCFRZ8PF:al:IRUW:ntrv:U7'
2024-11-12 08:48:47.364 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01JCFRZ8PF:al:IRUW:ntrv:U7', is_skipped_hash='False'
2024-11-12 08:48:52.552 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRZDT8:al:JNUX:ntrv:T5' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:48:52.558 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: filtered_lights: '[]'
2024-11-12 08:49:02.812 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRZQTW:al:IRUW:ntrv:U8' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:49:02.818 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '['light.dining_table_light', 'light.play_mat_light']'
2024-11-12 08:49:02.820 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRZ8PF:al:IRUW:ntrv:U7'
2024-11-12 08:49:02.821 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: State attributes of 'light.dining_table_light' did not change ({'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3144, 'color_temp': 318, 'hs_color': (27.604, 53.118), 'rgb_color': (255, 181, 119), 'xy_color': (0.484, 0.38), 'friendly_name': 'Dining table light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}) wrt 'last_service_data' ({'entity_id': 'light.dining_table_light', 'brightness': 255, 'color_temp_kelvin': 3140}) (context.id=01JCFRZQTW:al:IRUW:ntrv:U8)
2024-11-12 08:49:02.821 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.dining_table_light' with transition 0.0 and context.id=01JCFRZQTW:al:IRUW:ntrv:U8
2024-11-12 08:49:02.829 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Setting color_temp of light light.dining_table_light
2024-11-12 08:49:02.830 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.dining_table_light with service data {'entity_id': 'light.dining_table_light', 'brightness': 255, 'color_temp_kelvin': 3145}
2024-11-12 08:49:02.830 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.dining_table_light, context_id=01JCFRZQTW:al:IRUW:ntrv:U8, sleep_time=0.0, force=False, max_length=1, which=both, initial_sleep=False)
2024-11-12 08:49:02.830 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01JCFRZ8PF:al:IRUW:ntrv:U7'
2024-11-12 08:49:02.831 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: State attributes of 'light.play_mat_light' did not change ({'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3144, 'color_temp': 318, 'hs_color': (27.604, 53.118), 'rgb_color': (255, 181, 119), 'xy_color': (0.484, 0.38), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}) wrt 'last_service_data' ({'entity_id': 'light.play_mat_light', 'brightness': 255, 'color_temp_kelvin': 3140}) (context.id=01JCFRZQTW:al:IRUW:ntrv:U8)
2024-11-12 08:49:02.832 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Calling _adapt_light from _update_attrs_and_maybe_adapt_lights: 'light.play_mat_light' with transition 0.0 and context.id=01JCFRZQTW:al:IRUW:ntrv:U8
2024-11-12 08:49:02.836 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Setting color_temp of light light.play_mat_light
2024-11-12 08:49:02.837 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.play_mat_light with service data {'entity_id': 'light.play_mat_light', 'brightness': 255, 'color_temp_kelvin': 3145}
2024-11-12 08:49:02.838 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.play_mat_light, context_id=01JCFRZQTW:al:IRUW:ntrv:U8, sleep_time=0.0, force=False, max_length=1, which=both, initial_sleep=False)
2024-11-12 08:49:02.839 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.dining_table_light', 'brightness': 255, 'color_temp_kelvin': 3145} with context.id='01JCFRZQTW:al:IRUW:ntrv:U8'
2024-11-12 08:49:02.840 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.dining_table_light']')' event with context.id='01JCFRZQTW:al:IRUW:ntrv:U8'
2024-11-12 08:49:02.840 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01JCFRZQTW:al:IRUW:ntrv:U8', is_skipped_hash='False'
2024-11-12 08:49:02.842 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.play_mat_light', 'brightness': 255, 'color_temp_kelvin': 3145} with context.id='01JCFRZQTW:al:IRUW:ntrv:U8'
2024-11-12 08:49:02.843 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.play_mat_light']')' event with context.id='01JCFRZQTW:al:IRUW:ntrv:U8'
2024-11-12 08:49:02.843 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01JCFRZQTW:al:IRUW:ntrv:U8', is_skipped_hash='False'
2024-11-12 08:49:03.110 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.dining_table_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3154, 'color_temp': 317, 'hs_color': (27.589, 52.866), 'rgb_color': (255, 182, 120), 'xy_color': (0.482, 0.38), 'friendly_name': 'Dining table light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRZQTW:al:IRUW:ntrv:U8'
2024-11-12 08:49:03.111 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.dining_table_light=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3154, color_temp=317, hs_color=(27.589, 52.866), rgb_color=(255, 182, 120), xy_color=(0.482, 0.38), friendly_name=Dining table light, supported_features=44 @ 2024-11-12T08:48:35.747443+00:00>' found for light.dining_table_light
2024-11-12 08:49:03.112 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No transition in last adapt for light light.dining_table_light, not starting timer.
2024-11-12 08:49:03.198 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.play_mat_light' 'state_changed' event: '{'min_color_temp_kelvin': 2202, 'max_color_temp_kelvin': 4000, 'min_mireds': 250, 'max_mireds': 454, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], 'supported_color_modes': ['color_temp'], 'effect': None, 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 255, 'color_temp_kelvin': 3154, 'color_temp': 317, 'hs_color': (27.589, 52.866), 'rgb_color': (255, 182, 120), 'xy_color': (0.482, 0.38), 'friendly_name': 'Play mat light', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01JCFRZQTW:al:IRUW:ntrv:U8'
2024-11-12 08:49:03.199 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] AdaptiveLightingManager: New adapt '<state light.play_mat_light=on; min_color_temp_kelvin=2202, max_color_temp_kelvin=4000, min_mireds=250, max_mireds=454, effect_list=['blink', 'breathe', 'okay', 'channel_change', 'finish_effect', 'stop_effect'], supported_color_modes=['color_temp'], effect=None, color_mode=color_temp, brightness=255, color_temp_kelvin=3154, color_temp=317, hs_color=(27.589, 52.866), rgb_color=(255, 182, 120), xy_color=(0.482, 0.38), friendly_name=Play mat light, supported_features=44 @ 2024-11-12T08:48:35.770272+00:00>' found for light.play_mat_light
2024-11-12 08:49:03.199 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] No transition in last adapt for light light.play_mat_light, not starting timer.
2024-11-12 08:49:08.053 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFRZWYN:al:JNUX:ntrv:T6' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:49:08.058 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: filtered_lights: '[]'
2024-11-12 08:49:12.981 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.dining_table_light']', transition=None)' event with context.id='01JCFS01RMN18HFK422PXBWT4M'
2024-11-12 08:49:13.085 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.dining_table_light' with context.id='01JCFS01RMN18HFK422PXBWT4M'
2024-11-12 08:49:13.899 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.play_mat_light']', transition=None)' event with context.id='01JCFS02NA5F0TWHD9J7NKCQA2'
2024-11-12 08:49:14.000 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.play_mat_light' with context.id='01JCFS02NA5F0TWHD9J7NKCQA2'
2024-11-12 08:49:18.313 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFS06Z9:al:IRUW:ntrv:U9' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:49:18.327 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '[]'
2024-11-12 08:49:19.763 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Hall: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFS08CK:al:JBQW:ntrv:D6' lights: 'None', transition: '45.0', force: 'False'
2024-11-12 08:49:19.768 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Hall: filtered_lights: '[]'
2024-11-12 08:49:23.556 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFS0C33:al:JNUX:ntrv:T7' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:49:23.568 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: filtered_lights: '[]'
2024-11-12 08:49:33.814 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: '_update_attrs_and_maybe_adapt_lights' called with context.id='01JCFS0P3P:al:IRUW:ntrv:UA' lights: 'None', transition: '0.0', force: 'False'
2024-11-12 08:49:33.826 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Dining Room: filtered_lights: '[]'
  1. Your Adaptive Lighting configuration:

Configured using the UI so not sure if I can include config below

light.dining_table_light and light.play_mat_light are controlled by an Adaptive Lighting entry called Dining Room. This has interval=15 and transition=0 because they are IKEA LED2035G10 bulbs. initial_transition=2, take_over_control is on, detect_non_ha_changes is on, only_once is off, adapt_only_on_bare_turn_on is on, separate_turn_on_commands is off, intercept is on, multi_light_intercept is on.

  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)
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
serial:
  port: /dev/ttyUSB0
frontend:
  port: 8080
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
  log_level: info
device_options:
  legacy: false
homeassistant: true
devices:
  '0x881a14fffea36817':
    friendly_name: Dining table light
  '0x881a14fffe142b4c':
    friendly_name: Styrbar remote
  '0x881a14fffe024356':
    friendly_name: Play mat light
  '0x54ef441000940c2f':
    friendly_name: Dining Room switch
  '0x54ef441000b1510f':
    friendly_name: Hall stairs switch
  '0x30fb10fffed78258':
    friendly_name: Kitchen downlight sink L
  '0x60b647fffe903d5a':
    friendly_name: Kitchen downlight peninsula
  '0x30fb10fffe1de15d':
    friendly_name: Kitchen downlight sink R
  '0x60b647fffe2097bd':
    friendly_name: Kitchen downlight fridge
  '0x30fb10fffe01079a':
    friendly_name: Kitchen downlight centre
  '0x54ef441000b794e7':
    friendly_name: Utility Room switch
  '0x54ef441000b7972a':
    friendly_name: Downstairs WC switch
  '0x9035eafffed48928':
    friendly_name: Kitchen Diner wall control
  '0x00158d00087b9f0a':
    friendly_name: Emily's Room sensor
    temperature_precision: 1
    humidity_precision: 1
  '0x5cc7c1fffeae4d0a':
    friendly_name: Study light
  '0x5cc7c1fffeb401f8':
    friendly_name: Hall light
  '0x54ef441000818da0':
    friendly_name: Kitchen counter lights
  '0x5cc7c1fffeb3edec':
    friendly_name: Bedroom light
  '0x5cc7c1fffeb3ee18':
    friendly_name: Landing light
  '0x5cc7c1fffeb3f1d9':
    friendly_name: Music Room light
  '0x5cc7c1fffeb401ec':
    friendly_name: Music Room dimmer R
  '0x54ef441000b79302':
    friendly_name: Ensuite switch
  '0x5cc7c1fffeae4cf8':
    friendly_name: Lounge dimmer R
  '0x5cc7c1fffeb401e8':
    friendly_name: Lounge main light
  '0x54ef441000b79769':
    friendly_name: Hall front door switch
    state_action: true
  '0x54ef441000b79780':
    friendly_name: Bathroom switch
  '0x8c6fb9fffe1acd69':
    friendly_name: Lounge lamp
  '0xd44867fffe5aae16':
    friendly_name: Hall sensor Front Door
  '0xd44867fffe5bd9cd':
    friendly_name: Downstairs WC sensor
  '0x08ddebfffe6f3710':
    friendly_name: Home/away shortcut button
  '0x00158d008b115ac6':
    friendly_name: 'Ensuite environmental sensor '
  '0xd44867fffe5facae':
    friendly_name: Hall sensor Lounge door
  '0xd44867fffe5facb8':
    friendly_name: Hall sensor Kitchen Diner door
  '0xd44867fffe5b758f':
    friendly_name: Utility Room sensor
  '0xd44867fffe5bd67e':
    friendly_name: Spare Room sensor
  '0xd44867fffe5b6427':
    friendly_name: Bedroom window sensor
  '0xd44867fffe5faf66':
    friendly_name: Landing sensor Emily's Room door
  '0xd44867fffe5b642f':
    friendly_name: Landing sensor Spare Room door
  '0xd44867fffe5b7594':
    friendly_name: Kitchen Diner sensor
groups:
  '1':
    friendly_name: Kitchen downlights
    devices:
      - 0x60b647fffe903d5a/1
      - 0x30fb10fffed78258/1
      - 0x30fb10fffe1de15d/1
      - 0x30fb10fffe01079a/1
      - 0x60b647fffe2097bd/1
availability: false

Problematic lights are IKEA LED2035G10 bulbs.

  1. Describe the bug and how to reproduce it:

I'm using this automation which (amongst other things) should turn off the Dining table light and Play mat light. The device_ids inside the light.turn_off action are for the Dining table light, Play mat light, Kitchen downlights (Zigbee group) and Kitchen counter lights.

alias: Turn stuff off when home status changes to Away or Holiday
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_select.home_status
    to: Away
  - trigger: state
    entity_id:
      - input_select.home_status
    to: Holiday
conditions: []
actions:
  - action: light.turn_off
    metadata: {}
    data:
      transition: 10
    target:
      floor_id:
        - upstairs
      area_id:
        - downstairs_wc
        - hall
        - lounge
        - study
        - utility_room
      device_id:
        - a524ebd29895be78fe7a69658640e8ff
        - 1f5847b349e43c9c3617896684c02665
        - 0c9e135a74d58cd74918b73e7f8318e3
        - b9a8d49470efa764389f4d1c31ee3892
  - if:
      - condition: state
        entity_id: automation.turn_off_bathroom_fan_automatically
        state: "off"
    then:
      - action: fan.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: fan.bathroom_switch_right
  - if:
      - condition: state
        entity_id: automation.turn_off_downstairs_wc_fan_automatically
        state: "off"
    then:
      - action: fan.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: fan.downstairs_wc_switch_right
  - if:
      - condition: state
        entity_id: automation.turn_off_ensuite_fan_automatically
        state: "off"
    then:
      - action: fan.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: fan.ensuite_switch_right
  - action: climate.set_hvac_mode
    metadata: {}
    data:
      hvac_mode: heat
    target:
      entity_id:
        - climate.hall_thermostat
        - climate.bedroom_thermostat
  - action: climate.set_preset_mode
    metadata: {}
    data:
      preset_mode: away
    target:
      entity_id:
        - climate.hall_thermostat
        - climate.bedroom_thermostat
mode: single

As you can see from the Logbook screenshot below (for just the Play mat light to make it easier to read), the light was off at 8:42:17. The automation ran at 08:48:34 but the light was switched on. I then manually turned it off using a Zigbee-bound wall switch at 8:49:13.

logbook screenshot
  1. Steps to reproduce the behavior:
  • Start with light off
  • Run automation
  • Light turns on when it shouldn't

Possibly related but possibly not…

I note that line 6 onwards of the debug log (Found entity_ids) looks odd because each subsequent area includes the lights from the previous area. Is that intentional and if not could it be related? See:

def _get_entity_list(self, service_data: ServiceData) -> list[str]:
if ATTR_ENTITY_ID in service_data:
return cv.ensure_list_csv(service_data[ATTR_ENTITY_ID])
if ATTR_AREA_ID in service_data:
entity_ids = []
area_ids = cv.ensure_list_csv(service_data[ATTR_AREA_ID])
for area_id in area_ids:
area_entity_ids = area_entities(self.hass, area_id)
eids = [
entity_id
for entity_id in area_entity_ids
if entity_id.startswith(LIGHT_DOMAIN)
]
entity_ids.extend(eids)
_LOGGER.debug(
"Found entity_ids '%s' for area_id '%s'",
entity_ids,
area_id,
)
return entity_ids
_LOGGER.debug(
"No entity_ids or area_ids found in service_data: %s",
service_data,
)
return []

I don't know the code well but on first glance it looks unrelated, but that L2249 should read eids not entity_ids, so that only the entity IDs for the relevant area get logged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant