Open lennon101 opened 7 months ago
I'd love some feedback or comments on this? Perhaps its how the template light is setup or something else on my end?
Here's a snippet from the HA log relating to this issue:
2023-11-30 16:35:56.629 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01HGFF1WTM6C50AJ8PTV9RSTYR', is_skipped_hash='False'
2023-11-30 16:35:56.629 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01HGFF1WTM6C50AJ8PTV9RSTYR): entity_id=['light.bathroom_vanity_led_lights'], params=>', service_data='{'entity_id': ['light.bathroom_vanity_led_lights'], 'params': {}}'
2023-11-30 16:35:56.629 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{'Adaptive Lighting: LED Lights ': ['light.bathroom_vanity_led_lights']}', skipped='[]'
2023-11-30 16:35:56.629 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (3) _service_interceptor_turn_on_handler: intercepting entity_ids='['light.bathroom_vanity_led_lights']'
2023-11-30 16:35:56.629 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Intercepted TURN_ON call with data {'params': {}, 'entity_id': ['light.bathroom_vanity_led_lights']} (01HGFF1WTM6C50AJ8PTV9RSTYR)
2023-11-30 16:35:56.630 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] LED Lights : Setting color_temp of light light.bathroom_vanity_led_lights
2023-11-30 16:35:56.630 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.bathroom_vanity_led_lights with service data {'entity_id': 'light.bathroom_vanity_led_lights', 'brightness': 255, 'color_temp_kelvin': 3810}
2023-11-30 16:35:56.631 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.bathroom_vanity_led_lights']')' event with context.id='01HGFF1WTM6C50AJ8PTV9RSTYR'
2023-11-30 16:35:56.631 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] LED Lights : execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.bathroom_vanity_led_lights, context_id=01HGFF1WTP:al:JRCU:dpt_:03, sleep_time=0.0, force=False, max_length=1, which=both, initial_sleep=True)
2023-11-30 16:35:56.633 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (0) _service_interceptor_turn_on_handler: call.context.id='01HGFF1WTM6C50AJ8PTV9RSTYR', is_skipped_hash='False'
2023-11-30 16:35:56.633 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (1) _service_interceptor_turn_on_handler: call='<ServiceCall light.turn_on (c:01HGFF1WTM6C50AJ8PTV9RSTYR): entity_id=['light.bathroom_vanity_led_lights'], params=>', service_data='{'entity_id': ['light.bathroom_vanity_led_lights'], 'params': {}}'
2023-11-30 16:35:56.633 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (2) _service_interceptor_turn_on_handler: switch_to_eids='{'Adaptive Lighting: LED Lights ': ['light.bathroom_vanity_led_lights']}', skipped='[]'
2023-11-30 16:35:56.633 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] (3) _service_interceptor_turn_on_handler: intercepting entity_ids='['light.bathroom_vanity_led_lights']'
2023-11-30 16:35:56.633 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Intercepted TURN_ON call with data {'params': {}, 'entity_id': ['light.bathroom_vanity_led_lights']} (01HGFF1WTM6C50AJ8PTV9RSTYR)
2023-11-30 16:35:56.634 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] LED Lights : Setting color_temp of light light.bathroom_vanity_led_lights
2023-11-30 16:35:56.634 DEBUG (MainThread) [custom_components.adaptive_lighting.adaptation_utils] Preparing adaptation data for light.bathroom_vanity_led_lights with service data {'entity_id': 'light.bathroom_vanity_led_lights', 'brightness': 255, 'color_temp_kelvin': 3810}
2023-11-30 16:35:56.635 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.bathroom_vanity_led_lights']')' event with context.id='01HGFF1WTM6C50AJ8PTV9RSTYR'
2023-11-30 16:35:56.635 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] LED Lights : execute_cancellable_adaptation_calls with data: AdaptationData(entity_id=light.bathroom_vanity_led_lights, context_id=01HGFF1WTT:al:JRCU:dpt_:04, sleep_time=0.0, force=False, max_length=1, which=both, initial_sleep=True)
2023-11-30 16:35:56.635 WARNING (MainThread) [homeassistant.helpers.script.bathroom_vanity_led_lights] Bathroom Vanity LED Lights: Already running
Just an update on this. I've since discovered that if I un-tick the option intercept
tick-box then AL is able to turn the template light and off and change its colour (but not to the correct colour) but that seems to be about it. Brightness control is still not working. Screenshot of current options ticked/unticked below:
TLDR:
light.turn_on
service correctly when using my template light. After enabling the AL for the template light, and attempting to manually call theturn_on
service for that light, the light fails to turn on and I get an error in HA logs saying:Interestingly, I can still turn off that light entity using the
turn_off
service for that light. However, theturn_on
service no longer works and the light is inoperable until I disable the AL using theswitch.adaptive_lighting_**
Please confirm that you have completed the following steps:
Required information for bug reports:
Your Adaptive Lighting configuration: I have set up the light using the UI, but a duplicate of the settings is below
My light template config is below
Describe the bug and how to reproduce it: I have a Template Light that implements the service call
light.Turn_On
as well as several other necessary service calls in order to turn a warm-white LED strip and a cool-white LED strip into a single light entity with brightness and temperature control. However, when I try to use this light template in the Adapative Light settings, the service calllight.turn_on
doesn't seem to be getting interrupted in the right way. I've checked the home assistant logs and the only error I'm getting is:light.turn_on
for the template light