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

detect_non_ha_changes incorrectly detecting changes from rgb_color to color_temp #449

Closed
nathang21 opened this issue Mar 15, 2023 · 33 comments · Fixed by #514
Closed

detect_non_ha_changes incorrectly detecting changes from rgb_color to color_temp #449

nathang21 opened this issue Mar 15, 2023 · 33 comments · Fixed by #514

Comments

@nathang21
Copy link

Version information:

version 1.4.1

Description:

I have 2 govee lightstrips in the Kitchen controlled by Adaptive Lighting, both are members of an HA group called "Kitchen Lightstrips" which is what I set AL to control.

AL works correctly and adjusts the color/brightness but doing so causes them to get flagged as manual control, when no manual control actions were done. I'm not sure how to avoid this, but this problem isn't happening with my other lights/rooms in the house with seperate AL configurations.

See below for logs, these 2 the lines appear odd to me, but i'm not sure how to avoid this.

'light.kitchen_lightstrip_bot' **switched from RGB mode to color_temp or visa versa**
'adaptive_lighting.**manual_control**' event fired for switch.adaptive_lighting_kitchen for light light.kitchen_lightstrip_bot

Logs

2023-03-15 09:37:42.733 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (26.739, 36.078), 'rgb_color': (255, 204, 163), 'xy_color': (0.424, 0.366), 'rate_limit_total': 100, 'rate_limit_remaining': 51, 'rate_limit_reset_seconds': -1678887462.71, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVJQV9SMZWY9074JB60P6VE6'
…
2023-03-15 09:37:52.639 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (26.739, 36.078), 'rgb_color': (255, 204, 163), 'xy_color': (0.424, 0.366), 'rate_limit_total': 100, 'rate_limit_remaining': 51, 'rate_limit_reset_seconds': -1678887472.62, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVJQVKF8K1YSFRWN2BAKRETJ'
…
2023-03-15 09:38:22.527 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'^pQZ':interval:b'1O''
2023-03-15 09:38:22.529 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_top', 'light.kitchen_lightstrip_bot'], 45.0, force=False, context.id=adapt_lgt:b'^pQZ':interval:b'1O')' called
2023-03-15 09:38:22.530 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-15 09:38:22.531 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of 'light.kitchen_lightstrip_top' didn't change wrt change event nr. 0 (context.id=adapt_lgt:b'^pQZ':interval:b'1O')
2023-03-15 09:38:22.532 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_top', 'brightness': 255, 'color_temp_kelvin': 3995} with context.id='adapt_lgt:b'^pQZ':interval:b'1O''
2023-03-15 09:38:22.535 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-15 09:38:22.536 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] color RGB of 'light.kitchen_lightstrip_bot' significantly changed from (255, 136, 12) to (255, 204, 163) with context.id='adapt_lgt:b'^pQZ':interval:b'1O''
2023-03-15 09:38:22.536 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] color RGB of 'light.kitchen_lightstrip_bot' significantly changed from (255, 136, 12) to (255, 204, 163) with context.id='adapt_lgt:b'^pQZ':interval:b'1O''
2023-03-15 09:38:22.536 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-15 09:38:22.536 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'adaptive_lighting.manual_control' event fired for switch.adaptive_lighting_kitchen for light light.kitchen_lightstrip_bot
@th3w1zard1
Copy link
Collaborator

Can you post your config? what's your interval set to and your transition? do you have detect_non_ha_changes set to true?

@nathang21
Copy link
Author

do you have detect_non_ha_changes set to true?

Yes, without that it won't detect manual control changes that I actually want (via physical switches / other apps).

Not sure how to get the config in YAML format, but here are screenshots
image
image
image

The only thing I changed since filing this issue, was enabling prefer_rgb_color to see if that helps. So far not noticing any difference.

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 15, 2023

Try setting your transition and sleep_transition and initial transition higher than your interval setting (see #377 for the reason why that's important) and report back. I'll try testing your settings on my end in the meantime right quick.

@nathang21
Copy link
Author

Thanks for the quick response, now i'm having trouble reproducing (it seems prefer_rgb_color helps with my govee lightstrips).

When it happens again, I will attempt the transition fix.

@nathang21
Copy link
Author

Update: Still happening, attempting the transition fix. Seems like for most people, that fixed the issue of lights turning BACK on unintentionally after being turned off (which I have also experienced), but the manual control flag is more of the issue i've been trying to debug.

Perhaps the interval is related to both, will report back here with findings once I give it some time.

1 similar comment
@nathang21
Copy link
Author

Update: Still happening, attempting the transition fix. Seems like for most people, that fixed the issue of lights turning BACK on unintentionally after being turned off (which I have also experienced), but the manual control flag is more of the issue i've been trying to debug.

Perhaps the interval is related to both, will report back here with findings once I give it some time.

@nathang21
Copy link
Author

Okay this morning the same thing happened, lights came on via my normal good morning automation (after being off all night), but got tagged with manual control.

New Config:
image

Logs:

2023-03-17 07:05:39.715 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'6$}''
2023-03-17 07:05:39.717 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'6$}')' called
2023-03-17 07:05:54.717 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'77P''
2023-03-17 07:05:54.721 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'77P')' called
2023-03-17 07:05:59.338 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top']')' event with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:05:59.555 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 128, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4894, 'rate_limit_reset_seconds': -1679051159.55, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:05:59.556 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 128, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4894, 'rate_limit_reset_seconds': -1679051159.55, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:05:59.561 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Detected an 'off' → 'on' event for 'light.kitchen_lightstrip_bot' with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:05:59.561 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: sleep started for 'light.kitchen_lightstrip_bot' with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:05:59.562 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Detected an 'off' → 'on' event for 'light.kitchen_lightstrip_top' with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:05:59.562 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: sleep started for 'light.kitchen_lightstrip_top' with context.id='01GVQKYX4C2FNZ7BP5JW6RN54F'
2023-03-17 07:06:02.739 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Sleep Mode: Kitchen: Turning off
2023-03-17 07:06:02.763 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: _sleep_mode_switch_state_event, event: '<Event state_changed[L]: entity_id=switch.adaptive_lighting_sleep_mode_kitchen, old_state=<state switch.adaptive_lighting_sleep_mode_kitchen=on; icon=mdi:theme-light-dark, friendly_name=Adaptive Lighting Sleep Mode: Kitchen @ 2023-03-16T23:13:22.550828-04:00>, new_state=<state switch.adaptive_lighting_sleep_mode_kitchen=off; icon=mdi:theme-light-dark, friendly_name=Adaptive Lighting Sleep Mode: Kitchen @ 2023-03-17T07:06:02.744313-04:00>>'
2023-03-17 07:06:02.764 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:02.768 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=True, context.id=adapt_lgt:b'@9-+':sleep:b'7Yq')' called
2023-03-17 07:06:02.771 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:06:02.771 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_bot', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:02.776 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:06:02.777 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_top', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:02.801 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_bot']')' event with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:02.802 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_top']')' event with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:02.832 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Called 'adaptive_lighting.set_manual_control' service with '{'entity_id': ['switch.adaptive_lighting_living_room', 'switch.adaptive_lighting_kitchen', 'switch.adaptive_lighting_master_bedroom', 'switch.adaptive_lighting_office', 'switch.adaptive_lighting_nursery'], 'manual_control': False, 'lights': []}'
2023-03-17 07:06:02.834 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Called 'adaptive_lighting.set_manual_control' service with '{'entity_id': ['switch.adaptive_lighting_living_room', 'switch.adaptive_lighting_kitchen', 'switch.adaptive_lighting_master_bedroom', 'switch.adaptive_lighting_office', 'switch.adaptive_lighting_nursery'], 'manual_control': False, 'lights': []}'
2023-03-17 07:06:02.841 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Called 'adaptive_lighting.set_manual_control' service with '{'entity_id': ['switch.adaptive_lighting_living_room', 'switch.adaptive_lighting_kitchen', 'switch.adaptive_lighting_master_bedroom', 'switch.adaptive_lighting_office', 'switch.adaptive_lighting_nursery'], 'manual_control': False, 'lights': []}'
2023-03-17 07:06:02.843 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Called 'adaptive_lighting.set_manual_control' service with '{'entity_id': ['switch.adaptive_lighting_living_room', 'switch.adaptive_lighting_kitchen', 'switch.adaptive_lighting_master_bedroom', 'switch.adaptive_lighting_office', 'switch.adaptive_lighting_nursery'], 'manual_control': False, 'lights': []}'
2023-03-17 07:06:02.845 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:02.847 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=True, context.id=adapt_lgt:b'@9-+':service:b'7z_')' called
2023-03-17 07:06:02.848 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:06:02.848 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_bot', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:02.850 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:06:02.850 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_top', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:02.850 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Called 'adaptive_lighting.set_manual_control' service with '{'entity_id': ['switch.adaptive_lighting_living_room', 'switch.adaptive_lighting_kitchen', 'switch.adaptive_lighting_master_bedroom', 'switch.adaptive_lighting_office', 'switch.adaptive_lighting_nursery'], 'manual_control': False, 'lights': []}'
2023-03-17 07:06:02.870 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_bot']')' event with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:02.870 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_top']')' event with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:04.222 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4908, 'rate_limit_reset_seconds': -1679051164.22, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:04.229 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4908, 'rate_limit_reset_seconds': -1679051164.22, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:04.243 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4908, 'rate_limit_reset_seconds': -1679051164.23, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':service:b'7z_''
2023-03-17 07:06:04.254 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4908, 'rate_limit_reset_seconds': -1679051164.25, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':sleep:b'7Yq''
2023-03-17 07:06:06.860 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.kitchen_lightstrips', 'light.christmas_lights_indoor', 'light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top']' for area_id 'f38491bdeed84132858f8149ecc90535'
2023-03-17 07:06:06.885 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Found entity_ids '['light.kitchen_lightstrips', 'light.christmas_lights_indoor', 'light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top', 'light.tv_lightstrip', 'light.living_room', 'light.tv_stand_lightstrip']' for area_id '5cf7420556ca49a98c8594ad05b52fed'
2023-03-17 07:06:06.885 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrips', 'light.christmas_lights_indoor', 'light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top', 'light.tv_lightstrip', 'light.living_room', 'light.tv_stand_lightstrip']')' event with context.id='01GVQKZ53M5KT176BG87ZCMY18'
2023-03-17 07:06:06.915 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top']')' event with context.id='01GVQKZ53M5KT176BG87ZCMY18'
2023-03-17 07:06:07.040 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4913, 'rate_limit_reset_seconds': -1679051167.03, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQKZ53M5KT176BG87ZCMY18'
2023-03-17 07:06:07.040 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4913, 'rate_limit_reset_seconds': -1679051167.04, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQKZ53M5KT176BG87ZCMY18'
2023-03-17 07:06:07.048 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4913, 'rate_limit_reset_seconds': -1679051167.04, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQKZ53M5KT176BG87ZCMY18'

2023-03-17 07:06:09.717 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:09.719 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'84L')' called
2023-03-17 07:06:09.720 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:06:09.721 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of 'light.kitchen_lightstrip_bot' didn't change wrt change event nr. 0 (context.id=adapt_lgt:b'@9-+':interval:b'84L')
2023-03-17 07:06:09.721 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_bot', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:09.724 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:06:09.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of 'light.kitchen_lightstrip_top' didn't change wrt change event nr. 0 (context.id=adapt_lgt:b'@9-+':interval:b'84L')
2023-03-17 07:06:09.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_top', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:09.733 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4913, 'rate_limit_reset_seconds': -1679051169.72, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQKZ53M5KT176BG87ZCMY18'
2023-03-17 07:06:09.734 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_bot']')' event with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:09.735 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4913, 'rate_limit_reset_seconds': -1679051169.73, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQKZ53M5KT176BG87ZCMY18'
2023-03-17 07:06:09.735 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_top']')' event with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:10.914 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4916, 'rate_limit_reset_seconds': -1679051170.91, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:10.927 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4917, 'rate_limit_reset_seconds': -1679051170.93, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':interval:b'84L''
2023-03-17 07:06:20.367 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4917, 'rate_limit_reset_seconds': -1679051180.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQKZJ9XG3YBZSWWVJ0CJ7SW'
2023-03-17 07:06:20.368 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4917, 'rate_limit_reset_seconds': -1679051180.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQKZJ9YTW0V1A8M6KR8D5PA'

2023-03-17 07:06:24.719 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:24.723 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'8Vm')' called
2023-03-17 07:06:24.727 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:06:24.729 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of 'light.kitchen_lightstrip_bot' didn't change wrt change event nr. 0 (context.id=adapt_lgt:b'@9-+':interval:b'8Vm')
2023-03-17 07:06:24.730 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_bot', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:24.736 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:06:24.738 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of 'light.kitchen_lightstrip_top' didn't change wrt change event nr. 0 (context.id=adapt_lgt:b'@9-+':interval:b'8Vm')
2023-03-17 07:06:24.738 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.kitchen_lightstrip_top', 'brightness': 255, 'color_temp_kelvin': 2000} with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:24.747 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4917, 'rate_limit_reset_seconds': -1679051184.73, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQKZPJRYK6KPG1X1WHNSQRF'
2023-03-17 07:06:24.748 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_bot']')' event with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:24.751 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4917, 'rate_limit_reset_seconds': -1679051184.74, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQKZPK15WVRDN9G9T2DFNKY'
2023-03-17 07:06:24.752 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.kitchen_lightstrip_top']')' event with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:25.930 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4920, 'rate_limit_reset_seconds': -1679051185.93, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:25.952 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'color_temp_kelvin': 2000, 'color_temp': 500, 'rate_limit_total': 100, 'rate_limit_remaining': -4921, 'rate_limit_reset_seconds': -1679051185.95, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'assumed_state': True, 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='adapt_lgt:b'@9-+':interval:b'8Vm''
2023-03-17 07:06:37.514 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051197.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM031X336WXYPKXB5EMFPK'
2023-03-17 07:06:37.515 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051197.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM031Z995XJ755QQM9EX1J'
2023-03-17 07:06:39.720 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'8w>''
2023-03-17 07:06:39.722 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'8w>')' called
2023-03-17 07:06:39.723 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:06:39.724 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:39.724 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:39.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:06:39.727 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:39.727 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:39.735 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051199.72, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM057C4F0AGEXNE27N15VC'
2023-03-17 07:06:39.736 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051199.73, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM057EQK7JS09GMJJ9MT3W'
2023-03-17 07:06:50.358 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051210.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM0FKD52QGRKP60Q65T284'
2023-03-17 07:06:50.360 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051210.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM0FKENVJFP8V3H65M6TY2'
2023-03-17 07:06:54.643 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'mbow':interval:b'91H''
2023-03-17 07:06:54.644 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.chair_light', 'light.desk_lightstrip', 'light.couch_light', 'light.desk_lightbar', 'light.dlight_3ep5wwf9', 'light.dishwasher_light'], 30.0, force=False, context.id=adapt_lgt:b'mbow':interval:b'91H')' called
2023-03-17 07:06:54.722 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'91H''
2023-03-17 07:06:54.723 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'91H')' called
2023-03-17 07:06:54.724 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:06:54.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:54.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:54.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:06:54.728 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:54.728 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-17 07:06:54.735 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051214.72, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM0KW5BS7SC1BN9HFABFSP'
2023-03-17 07:06:54.736 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4925, 'rate_limit_reset_seconds': -1679051214.73, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM0KW65V65G5H2F8RN2JRZ'
2023-03-17 07:07:09.723 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'9Si''
2023-03-17 07:07:09.724 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'9Si')' called
2023-03-17 07:07:09.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_bot
2023-03-17 07:07:09.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-17 07:07:09.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_bot' switched from RGB mode to color_temp or visa versa
2023-03-17 07:07:09.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'adaptive_lighting.manual_control' event fired for switch.adaptive_lighting_kitchen for light light.kitchen_lightstrip_bot
2023-03-17 07:07:09.730 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: Setting color_temp of light light.kitchen_lightstrip_top
2023-03-17 07:07:09.731 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-17 07:07:09.731 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-17 07:07:09.731 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'adaptive_lighting.manual_control' event fired for switch.adaptive_lighting_kitchen for light light.kitchen_lightstrip_top
2023-03-17 07:07:09.739 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4927, 'rate_limit_reset_seconds': -1679051229.73, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM12GYQZSBRM5QRZXP2PF0'
2023-03-17 07:07:09.740 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4927, 'rate_limit_reset_seconds': -1679051229.73, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM12H26ET9Q775APK92ZYK'
2023-03-17 07:07:10.097 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.tv_lightstrip' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], 'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>, 'brightness': 182, 'color_temp_kelvin': 2000, 'color_temp': 500, 'hs_color': (30.601, 94.547), 'rgb_color': (255, 136, 13), 'xy_color': (0.599, 0.382), 'mode': 'normal', 'dynamics': 'none', 'friendly_name': 'TV Lightstrip', 'supported_features': <LightEntityFeature.TRANSITION|FLASH: 40>}' with context.id='01GVQM12WDS1XGV38E4RFZAEVN'
2023-03-17 07:07:20.362 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4927, 'rate_limit_reset_seconds': -1679051240.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM1CX02K0DEQ0X4J58DZFG'
2023-03-17 07:07:20.365 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4927, 'rate_limit_reset_seconds': -1679051240.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM1CX3VX0QRBWPZ08H48HQ'
2023-03-17 07:07:24.646 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'mbow':interval:b'9t;''
2023-03-17 07:07:24.647 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.chair_light', 'light.desk_lightstrip', 'light.couch_light', 'light.desk_lightbar', 'light.dlight_3ep5wwf9', 'light.dishwasher_light'], 30.0, force=False, context.id=adapt_lgt:b'mbow':interval:b'9t;')' called
2023-03-17 07:07:24.723 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'9t;''
2023-03-17 07:07:24.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'9t;')' called
2023-03-17 07:07:24.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_bot' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'9t;'.
2023-03-17 07:07:24.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_top' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'9t;'.
2023-03-17 07:07:37.630 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4931, 'rate_limit_reset_seconds': -1679051257.61, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM1XRE7TJCHW6PGGGW0X86'
2023-03-17 07:07:37.631 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4931, 'rate_limit_reset_seconds': -1679051257.62, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM1XRFW9ZJSNBKGPB5BF3R'
2023-03-17 07:07:39.724 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'9}E''
2023-03-17 07:07:39.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'9}E')' called
2023-03-17 07:07:39.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_bot' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'9}E'.
2023-03-17 07:07:39.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_top' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'9}E'.
2023-03-17 07:07:50.360 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4931, 'rate_limit_reset_seconds': -1679051270.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM2A6F2DMHK8J4XT17M11R'
2023-03-17 07:07:50.361 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4931, 'rate_limit_reset_seconds': -1679051270.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM2A6GKM1YZA2982BPT1SC'
2023-03-17 07:07:54.725 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'APf''
2023-03-17 07:07:54.726 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'APf')' called
2023-03-17 07:07:54.727 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_bot' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'APf'.
2023-03-17 07:07:54.727 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_top' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'APf'.
2023-03-17 07:08:09.727 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'Aq)''
2023-03-17 07:08:09.729 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Kitchen: '_adapt_lights(['light.kitchen_lightstrip_bot', 'light.kitchen_lightstrip_top'], 30.0, force=False, context.id=adapt_lgt:b'@9-+':interval:b'Aq)')' called
2023-03-17 07:08:09.729 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_bot' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'Aq)'.
2023-03-17 07:08:09.729 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: 'light.kitchen_lightstrip_top' is being manually controlled, stop adapting, context.id=adapt_lgt:b'@9-+':interval:b'Aq)'.
2023-03-17 07:08:20.362 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4931, 'rate_limit_reset_seconds': -1679051300.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVQM37FZ4EV65YHC8Y3GPWFC'
2023-03-17 07:08:20.365 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (30.496, 94.902), 'rgb_color': (255, 136, 12), 'xy_color': (0.599, 0.382), 'rate_limit_total': 100, 'rate_limit_remaining': -4931, 'rate_limit_reset_seconds': -1679051300.35, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVQM37G0MY35GNBSC8ZHQTNF'
2023-03-17 07:08:24.729 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Kitchen: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt:b'@9-+':interval:b'A`A''

@th3w1zard1
Copy link
Collaborator

'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
Is your good morning automation disabling the sleep switch for the light? Could you post your good morning automation so we can see the sequence of events? I could probably write you a fix pretty quick.

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 18, 2023

I'd rename your issue to something like:

detect_non_ha_changes incorrectly detecting changes from rgb_color to color_temp

You're welcome to try my Pull Request to see if it fixes your issue.. Shameless plug to my own PR as I need testers. Just add alt_detect_method: true to your config to get started.

@nathang21 nathang21 changed the title Manual control incorrectly set from changes made by AL detect_non_ha_changes incorrectly detecting changes from rgb_color to color_temp Mar 18, 2023
@nathang21
Copy link
Author

nathang21 commented Mar 18, 2023

'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa Is your good morning automation disabling the sleep switch for the light? Could you post your good morning automation so we can see the sequence of events? I could probably write you a fix pretty quick.

It does yes, here is is. For what it's worth, i've previously tried adding delays, and adjusting the order of actions but haven't noticed any improvements. It doesn't seem like disabling sleep mode before/after turning on the lights made much of a difference, but i've tried so many different things at this point I might be conflating variables.

automation.yaml
alias: Good morning automation
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 75f3d34c516e472f8865e361c3e64b47
    entity_id: binary_sensor.keypad_occupancy_sensor_2
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 3
  - type: motion
    platform: device
    device_id: 846e89dac7f620b1cf0f5424f7171883
    entity_id: binary_sensor.living_room_motion_sensor_2
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 3
  - type: motion
    platform: device
    device_id: 6a2621fefb96255214ee13495ee7d44c
    entity_id: binary_sensor.office_occupancy_sensor_2
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 3
condition:
  - condition: and
    conditions:
      - condition: device
        device_id: f5dc6eec3d92ebd49b5777d1a63c9766
        domain: alarm_control_panel
        entity_id: alarm_control_panel.abode_alarm_2
        type: is_armed_home
      - condition: time
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
          - sun
        after: "05:00:00"
        before: "11:30:00"
action:
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.living_room_lights
    continue_on_error: true
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.kitchen_lightstrips
    continue_on_error: true
  - device_id: f5dc6eec3d92ebd49b5777d1a63c9766
    domain: alarm_control_panel
    entity_id: alarm_control_panel.abode_alarm_2
    type: disarm
    code: "2369"
    continue_on_error: true
  - service: media_player.media_pause
    target:
      device_id: 7ac1d8ba91ef1c3bbb772171feb735fa
      entity_id: media_player.googlenestpointead9_3
    data: {}
    continue_on_error: true
  - service: media_player.volume_set
    target:
      device_id: 7ac1d8ba91ef1c3bbb772171feb735fa
      entity_id: media_player.googlenestpointead9_3
    data:
      volume_level: 0.5
    continue_on_error: true
  - service: climate.set_temperature
    data:
      target_temp_low: 65
      target_temp_high: 75
      hvac_mode: heat_cool
    target:
      device_id: 4dd6c5a84f9d751f6af17b64315500a7
      entity_id: climate.hallway
    continue_on_error: true
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.alarm_on_off
    continue_on_error: true
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.adaptive_lighting_sleep_mode_living_room
        - switch.adaptive_lighting_sleep_mode_kitchen
        - switch.adaptive_lighting_sleep_mode_master_bedroom
    continue_on_error: true
  - service: script.disable_adaptive_lighting_manual_control
    data: {}
    enabled: true
mode: single
script.yaml
alias: Disable Adaptive Lighting Manual Control
sequence:
  - service: adaptive_lighting.set_manual_control
    data:
      entity_id:
        - switch.adaptive_lighting_living_room
        - switch.adaptive_lighting_kitchen
        - switch.adaptive_lighting_master_bedroom
        - switch.adaptive_lighting_office
        - switch.adaptive_lighting_nursery
      manual_control: false
mode: single

I'd rename your issue to something like:

detect_non_ha_changes incorrectly detecting changes from rgb_color to color_temp

Done.

You're welcome to try my Pull Request to see if it fixes your issue.. Shameless plug to my own PR as I need testers. Just add alt_detect_method: true to your config to get started.

This looks great, when I get some time later this weekend I will hopefully give this a shot. Thanks for all the help.

@th3w1zard1
Copy link
Collaborator

No problem at all!

@th3w1zard1
Copy link
Collaborator

Sorry to ask for more but I also need to see your script.disable_adaptive_lighting_manual_control

@nathang21
Copy link
Author

Oops sorry about that, just edited my comment above to include that.

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 18, 2023

Found the problem(I think)

Just have your script turn the main adaptive switch off and on again for now, I'll see what I can do for a more perm fix.

Turning the main switch off and on resets manual control and should start the adaptive process fresh

@nathang21
Copy link
Author

That's a good idea, thats effectively what i've been doing as a workaround everytime I notice it's not adapting properly.
Will report back.

I also just installed your PR, probably going to use all 3 new config options, looks to be exactly what I need. I will leave feedback there if you prefer.

@th3w1zard1
Copy link
Collaborator

Fantastic! Yes if you use that PR please leave any future issues you have specifically concerning manual control there as to not confuse the devs.

@nathang21
Copy link
Author

@th3w1zard1 So little update, still having the same issue "lights not adapting when expected" however after using your PR, i'm noticing manual control is not set at all, but the lights still fail to adapt, I also see some new errors in the logs (see screenshot). At first it did seem like the interval changes you suggested above helped so maybe I should have waited before also testing the PR.

Would love your thoughts here on how best to proceed.

image


2023-03-19 21:41:57.515 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAWA3T4Y5SD6D15Q1NMMM3) adding this state also
KeyError: 'light.kitchen_lightstrip_bot'
KeyError: 'light.kitchen_lightstrip_bot'
2023-03-19 21:42:27.504 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8935, 'rate_limit_reset_seconds': -1679276547.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVYAX7D7SHGV0RR84CN5Y799'
2023-03-19 21:42:27.505 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_bot' is already in 'self.last_state_change' (01GVYAX7D7SHGV0RR84CN5Y799) adding this state also
2023-03-19 21:42:27.508 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8935, 'rate_limit_reset_seconds': -1679276547.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVYAX7D833BAGK2D6NM4GW81'
2023-03-19 21:42:27.508 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAX7D833BAGK2D6NM4GW81) adding this state also
KeyError: 'light.kitchen_lightstrip_bot'
2023-03-19 21:42:56.432 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8940, 'rate_limit_reset_seconds': -1679276576.42, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVYAY3N47JSRK8S8X8SK5BME'
2023-03-19 21:42:56.432 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_bot' is already in 'self.last_state_change' (01GVYAY3N47JSRK8S8X8SK5BME) adding this state also
2023-03-19 21:42:56.436 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8940, 'rate_limit_reset_seconds': -1679276576.42, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVYAY3N67Y35GA1PDJS1RZZ6'
2023-03-19 21:42:56.436 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAY3N67Y35GA1PDJS1RZZ6) adding this state also
KeyError: 'light.kitchen_lightstrip_bot'
2023-03-19 21:42:57.507 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8940, 'rate_limit_reset_seconds': -1679276577.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVYAY4PRM7P4XRY9F1F5HFYQ'
2023-03-19 21:42:57.507 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_bot' is already in 'self.last_state_change' (01GVYAY4PRM7P4XRY9F1F5HFYQ) adding this state also
2023-03-19 21:42:57.514 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8940, 'rate_limit_reset_seconds': -1679276577.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVYAY4PSVWP2RST73V61E8Q1'
2023-03-19 21:42:57.514 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAY4PSVWP2RST73V61E8Q1) adding this state also
KeyError: 'light.kitchen_lightstrip_bot'
KeyError: 'light.kitchen_lightstrip_bot'
2023-03-19 21:43:27.514 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8940, 'rate_limit_reset_seconds': -1679276607.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVYAZ209CHAXBKAV7VNH0DYQ'
2023-03-19 21:43:27.514 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_bot' is already in 'self.last_state_change' (01GVYAZ209CHAXBKAV7VNH0DYQ) adding this state also
2023-03-19 21:43:27.519 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8940, 'rate_limit_reset_seconds': -1679276607.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVYAZ20AWJ3P4WCV4BDPXM38'
2023-03-19 21:43:27.519 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAZ20AWJ3P4WCV4BDPXM38) adding this state also
KeyError: 'light.kitchen_lightstrip_bot'
KeyError: 'light.kitchen_lightstrip_bot'
2023-03-19 21:43:56.798 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8944, 'rate_limit_reset_seconds': -1679276636.79, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVYAZYKJ6NMHRD8FHCGYK1BZ'
2023-03-19 21:43:56.799 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_bot' is already in 'self.last_state_change' (01GVYAZYKJ6NMHRD8FHCGYK1BZ) adding this state also
2023-03-19 21:43:56.806 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8944, 'rate_limit_reset_seconds': -1679276636.79, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVYAZYKKQX451Q4KMBGW3W0S'
2023-03-19 21:43:56.807 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAZYKKQX451Q4KMBGW3W0S) adding this state also
2023-03-19 21:43:57.507 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_bot' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8944, 'rate_limit_reset_seconds': -1679276637.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Bot', 'supported_features': 19}' with context.id='01GVYAZZ9S517HQ78BYVCCEKBV'
2023-03-19 21:43:57.507 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_bot' is already in 'self.last_state_change' (01GVYAZZ9S517HQ78BYVCCEKBV) adding this state also
2023-03-19 21:43:57.511 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.kitchen_lightstrip_top' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 9009, 'min_mireds': 111, 'max_mireds': 500, 'supported_color_modes': [<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.HS: 'hs'>], 'color_mode': <ColorMode.HS: 'hs'>, 'brightness': 255, 'hs_color': (28.171, 64.314), 'rgb_color': (255, 168, 90), 'xy_color': (0.522, 0.387), 'rate_limit_total': 100, 'rate_limit_remaining': -8944, 'rate_limit_reset_seconds': -1679276637.5, 'rate_limit_reset': '1969-12-31T19:00:00', 'rate_limit_on': 5, 'manufacturer': 'Govee', 'model': 'H6159', 'friendly_name': 'Kitchen Lightstrip Top', 'supported_features': 19}' with context.id='01GVYAZZ9T1AAEPYD3BV17B8DX'
2023-03-19 21:43:57.511 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.kitchen_lightstrip_top' is already in 'self.last_state_change' (01GVYAZZ9T1AAEPYD3BV17B8DX) adding this state also
KeyError: 'light.kitchen_lightstrip_bot'

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 20, 2023

Oof a 'task exception was never received' is really bad. I'm confused why I haven't seen it on my side.
Could you post your config please? I just need to know which of the new options are set, if any, assuming your config is the same as before. And some log entries that exist before and after the 'task exception was never retrieved' error fires? The logs you posted only show basic state changes and it's not much to work with.

I put out a substantial update to the PR in the past 24 hours that I'm hoping will fix the 'task exception was never received' error.. but as much as I'd like testers I'm not going to ask you to forgo ensured stability. But if you're still willing to test please grab the latest build!

Otherwise, if you're a bit tired of dealing with the bugs and would like to regain stability, I'd revert back to the main build, as I really think just turning on and off the switch will bypass that 'rgb_color to color_temp' check. I really think that will fix your original issue.

@nathang21
Copy link
Author

nathang21 commented Mar 20, 2023

Apologies, regarding the new options I had the following (otherwise same config except I added separate_turn_on_commands: true since sometimes only 1 of my kitchen lightstrips turns on via my good morning / arrive home automations):

strict_adapting: true
alt_detect_method: true
autoreset_control_time: 10000

Thankfully it's pretty easy to revert back to the official release via HACS, so I did that last night, but I am happy to continue helping out with your PR, but I may be a bit slow to respond with work, and a baby on the way any day now!

I'll grab the latest build and report back with more logs if/when I can reproduce.

EDIT: Just re-installed the latest PR, and restarted - so far no errors in logs.

Otherwise, if you're a bit tired of dealing with the bugs and would like to regain stability, I'd revert back to the main build, as I really think just turning on and off the switch will bypass that 'rgb_color to color_temp' check. I really think that will fix your original issue.

With this in mind on the main build, do you still recommend setting the interval lower than all the transition times as well?
What about when using PR, is that no longer necessary?

Just want to make sure i'm not conflating issues/solutions here, and will try to keep the variable changes to a minimum.

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 20, 2023

Thankfully it's pretty easy to revert back to the official release via HACS, so I did that last night, but I am happy to continue helping out with your PR, but I may be a bit slow to respond with work, and a baby on the way any day now!

Congratulations!!

Otherwise, if you're a bit tired of dealing with the bugs and would like to regain stability, I'd revert back to the main build, as I really think just turning on and off the switch will bypass that 'rgb_color to color_temp' check. I really think that will fix your original issue.

With this in mind on the main build, do you still recommend setting the interval lower than all the transition times as well?

Setting interval lower than the transition time is necessary if you want a manual change event to fire while using detect_non_ha_changes: true. If the interval is higher than the transition you'll get bizarre things like lights turning on on their own overnight. The baby and possible SO may not appreciate that. See #377 (comment) for more info and #417

What about when using PR, is that no longer necessary?

interval and transition time relation will not matter for strict_adapting: false and alt_detect_method: true only for detect_non_ha_changes: true

Just want to make sure i'm not conflating issues/solutions here, and will try to keep the variable changes to a minimum.

Please use this as you like, change as much as you want! it's the best way to find new issues.

@nathang21
Copy link
Author

Using the latest official version of this addon (test PR has been closed/merged it seems), i'm still getting manual control tagged on my kitchen lightstrip(s) almost always despite never changing anything outside of HA.

Please let me know if I can provide more detail or help test in anyway @th3w1zard1.

Config:

lights:
- light.kitchen_lightstrips
prefer_rgb_color: false
include_config_in_attributes: true
initial_transition: 60
sleep_transition: 60
transition: 30
interval: 30
min_brightness: 100
max_brightness: 100
min_color_temp: 2000
max_color_temp: 4500
sleep_brightness: 50
sleep_rgb_or_color_temp: color_temp
sleep_color_temp: 1000
sleep_rgb_color:
- 255
- 56
- 0
sunrise_time: null
max_sunrise_time: null
sunrise_offset: 0
sunset_time: null
min_sunset_time: null
sunset_offset: 0
only_once: false
take_over_control: true
detect_non_ha_changes: true
separate_turn_on_commands: true
send_split_delay: 500
adapt_delay: 500
name: Kitchen
Manual control
light.kitchen_lightstrip_top
Brightness pct
100
Color temp kelvin
2,470
Rgb color
255, 157.86372421387597, 67.26974398205067
Xy color
0.55, 0.389
Hs color
28.71, 72.941
Sun position
0.19

Logs (trimmed to last ~12 hours:
al3.log

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 30, 2023

Using the latest official version of this addon (test PR has been closed/merged it seems), i'm still getting manual control tagged on my kitchen lightstrip(s) almost always despite never changing anything outside of HA.

Please let me know if I can provide more detail or help test in anyway @th3w1zard1.

@nathang21
From the logs it looks like the latest version of the addon still has your original issue:

2023-03-30 07:19:46.194 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-30 07:19:46.194 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-30 07:19:46.194 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'light.kitchen_lightstrip_top' switched from RGB mode to color_temp or visa versa
2023-03-30 07:19:46.194 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'adaptive_lighting.manual_control' event fired for switch.adaptive_lighting_kitchen for light light.kitchen_lightstrip_top

The pr #450 we've been testing has been closed in favor of #486. Would you mind seeing if #486 fixes your issue?

@nathang21
Copy link
Author

Done, same issue, manual control applied right away after HA restart.

Logs:
al4.log

@th3w1zard1
Copy link
Collaborator

These are really good logs, I'm glad I added the extra debugging.

Looking at this now.

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Mar 31, 2023

So it looks like the service data we're sending the light is getting converted into rgb_color after the light.turn_on, then when we check for a manual change it's detecting color_temp existed in the service data, but not in the state.

I'm just going to remove that bit of code as it doesn't seem to catch any real manual events anyway. I can't imagine someone swapping to rgb_color then using the exact same values that adaptive lighting sent in it's last service data under color_temp

tl;dr I fixed the problem, please try the new build!

@nathang21
Copy link
Author

Okay I've been running this all day, few things I noticed.

  1. Just noticed this error.
This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/adaptive_lighting/switch.py:1279
Integration: Adaptive Lighting (documentation, issues)
First occurred: 08:48:30 (3 occurrences)
Last logged: 10:19:16

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/adaptive_lighting/switch.py", line 1383, in _light_event
    await self._update_attrs_and_maybe_adapt_lights(
  File "/config/custom_components/adaptive_lighting/switch.py", line 1243, in _update_attrs_and_maybe_adapt_lights
    await self._update_manual_control_and_maybe_adapt(
  File "/config/custom_components/adaptive_lighting/switch.py", line 1279, in _update_manual_control_and_maybe_adapt
    if self.turn_on_off_listener.manual_control[light]:
KeyError: 'light.dlight_3ep5wwf9'
  1. Full logs for original issue.
    al5.log

  2. Potentially another issue I encountered today, I intentionally tried to turn off my Office lights, but as far as i could tell manual control was never set, and after 3-4 minutes the lights would turn back on again. This happened about 5 times. Perhaps this is a side effect of Styling #1, but not sure that would make sense, if AL crashed I would have expected nothing to adapt. Happy to open another issue to track this if it happens again.

@th3w1zard1
Copy link
Collaborator

Hey - I should be able to roll out another fix for this in the next few minutes!

th3w1zard1 added a commit to th3w1zard1/adaptive-lighting that referenced this issue Mar 31, 2023
- `significant_change` now checks `last_state_change[light][0]` instead of `last_service_data[light]` to fix basnijholt#449
- Readded 'switched from RGB mode to color_temp or visa versa' in both `switch.py` and `test_switch.py`
Fixed `KeyError: 'light'` during forced call of `_update_manual_control_and_maybe_adapt()`
@th3w1zard1
Copy link
Collaborator

  1. Fixed
  2. Which 'original issue' is in these logs? I did a few searches with CTRL+F and I can't find the 'switched from rgb_color to color_temp or visa versa' or any of the errors from 1.
  3. Side-effect of 1 - also fixed.

I need to test the build quickly to ensure it'll work correctly before I waste your time.

@th3w1zard1
Copy link
Collaborator

I lost power due to a storm but I'll push these fixes once it's restored 😁

@th3w1zard1
Copy link
Collaborator

@nathang21 Pushed the changes, double checked a few things from your logs, everything should probably be fixed this time.

@th3w1zard1
Copy link
Collaborator

@nathang21 Hey wanted to point out you can set manual_control: false via your original method or switch on/off the main adapt switch. Both turned out to be unrelated to your problem.

th3w1zard1 added a commit that referenced this issue Apr 3, 2023
* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <[email protected]>
basnijholt added a commit that referenced this issue Apr 3, 2023
* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <[email protected]>
basnijholt added a commit that referenced this issue Apr 3, 2023
* Change (WIP)

* Update test_switch.py

* Refactor

* Revert "Revert "Small refactor""

This reverts commit 3731c99.

* Update README.md

* Fix the test

* Bump to 1.9.0 (#518)

* Basic community fixes PR (#460)

* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <[email protected]>

* Undo accidental changes introduced in #509, but adds the changes from #460 (#521)

* Release 1.9.1 (#522)

* Bump to 1.9.1

* Add CODEOWNERS

---------

Co-authored-by: Benjamin Auquite <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@nathang21
Copy link
Author

@th3w1zard1 Should I upgrade to the official v 1.9.1 or stay on the PR #486 from a few days ago (whichever commit this is [1]), since it looks like that will be split up into multiple PR's? Things are working much much better now, not 100% sure it's perfect yet, but will keep monitoring.

[1] adaptive-lighting-rewrite_detect_non_ha_changes_slowattempt (2).zip

basnijholt added a commit that referenced this issue Apr 4, 2023
* Add auto_reset_manual_control with async timer

* cherry-pick wait for transition stuff

* Update switch.py

* not renamed in this branch yet.

* Update switch.py

* update tests

* Update switch.py

* merge related fix

* cleanup

* Revert "cleanup"

This reverts commit 3aa2f32.

* Update switch.py

* Update switch.py

* Update switch.py

* Small refactor

* Move test to old position for better diffs

* Revert "Small refactor"

This reverts commit b986b3f.

* Update README.md

* fix the test

last_state_change isn't updated quick enough.

* #510 changes (#516)

* Change (WIP)

* Update test_switch.py

* Refactor

* Revert "Revert "Small refactor""

This reverts commit 3731c99.

* Update README.md

* Fix the test

* Bump to 1.9.0 (#518)

* Basic community fixes PR (#460)

* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <[email protected]>

* Undo accidental changes introduced in #509, but adds the changes from #460 (#521)

* Release 1.9.1 (#522)

* Bump to 1.9.1

* Add CODEOWNERS

---------

Co-authored-by: Benjamin Auquite <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* No need to wrap the reset

* Remove unused attrs

* Shorter log message

* revert unrelated tests change

* remove unused function

* Use patch

* Bump to 1.10.0

---------

Co-authored-by: Bas Nijholt <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <[email protected]>
@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Apr 4, 2023

@nathang21 Unfortunately this fix couldn't make it into 1.10.0 but you can grab #514 as I wrote that pr to fix your issue here specifically.

#514 is a clone of 1.10.0 with the only change being the fix for this issue.

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