You might want to check out my automation. I do this exact thing but have a template to check all lights.
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/detect_and_adjust_lights.yaml
You might want to check out my automation. I do this exact thing but have a template to check all lights.
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/detect_and_adjust_lights.yaml