You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I absolutely love this integration! The adaptive light control is fantastic and has become an essential part of my Home Assistant setup. Thank you for your great work.
I'm running into an issue when using Adaptive Lighting with a virtual CCT light that I've created from two separate warm-white and cool-white channels using a template light.
My observation is that the integration and the template light get into a conflict, likely a timing issue. When Adaptive Lighting adjusts the color temperature and brightness of the virtual light, my template's logic updates the two underlying physical lights. This subsequent state change appears to be incorrectly detected by Adaptive Lighting as a manual override, causing it to stop adapting.
Here is my light template configuration:
- light:
- name: "Studio Licht"
unique_id: studio_licht
min_mireds: 167
max_mireds: 333
availability: >
{{ not is_state('light.studio_warmes_licht', 'unavailable') and
not is_state('light.studio_kaltes_licht', 'unavailable') }}
state: >
{{ is_state('light.studio_kaltes_licht', 'on') or is_state('light.studio_warmes_licht', 'on') }}
level: >
{{ [state_attr('light.studio_kaltes_licht', 'brightness') | int(0),
state_attr('light.studio_warmes_licht', 'brightness') | int(0)] | max }}
temperature: >
{% set ww_bright = state_attr('light.studio_warmes_licht', 'brightness') | int(0) %}
{% set cw_bright = state_attr('light.studio_kaltes_licht', 'brightness') | int(0) %}
{% set total_bright = ww_bright + cw_bright %}
{% if total_bright > 0 %}
{% set ww_ratio = ww_bright / total_bright %}
{% set min_mireds = 167 %}
{% set max_mireds = 333 %}
{{ (min_mireds + (ww_ratio * (max_mireds - min_mireds))) | int }}
{% else %}
250
{% endif %}
turn_on:
- service: light.turn_on
target:
entity_id:
- light.studio_warmes_licht
- light.studio_kaltes_licht
turn_off:
- service: light.turn_off
target:
entity_id:
- light.studio_kaltes_licht
- light.studio_warmes_licht
set_level:
- service: light.turn_on
target:
entity_id: light.studio_warmes_licht
data:
brightness: >
{% set mireds = state_attr(this.entity_id, 'color_temp') | int(250) %}
{% set min_mireds = 167 %}
{% set max_mireds = 333 %}
{% set ww_ratio = (mireds - min_mireds) / (max_mireds - min_mireds) %}
{% set cw_ratio = 1 - ww_ratio %}
{% set max_ratio = [ww_ratio, cw_ratio] | max %}
{% if max_ratio > 0 %}
{{ (brightness * ww_ratio / max_ratio) | round(0) | int }}
{% else %}
0
{% endif %}
- service: light.turn_on
target:
entity_id: light.studio_kaltes_licht
data:
brightness: >
{% set mireds = state_attr(this.entity_id, 'color_temp') | int(250) %}
{% set min_mireds = 167 %}
{% set max_mireds = 333 %}
{% set ww_ratio = (mireds - min_mireds) / (max_mireds - min_mireds) %}
{% set cw_ratio = 1 - ww_ratio %}
{% set max_ratio = [ww_ratio, cw_ratio] | max %}
{% if max_ratio > 0 %}
{{ (brightness * cw_ratio / max_ratio) | round(0) | int }}
{% else %}
0
{% endif %}
set_temperature:
- service: light.turn_on
target:
entity_id: light.studio_warmes_licht
data:
brightness: >
{% set level = state_attr(this.entity_id, 'brightness') | int(255) %}
{% set min_mireds = 167 %}
{% set max_mireds = 333 %}
{% set ww_ratio = (color_temp - min_mireds) / (max_mireds - min_mireds) %}
{% set cw_ratio = 1 - ww_ratio %}
{% set max_ratio = [ww_ratio, cw_ratio] | max %}
{% if max_ratio > 0 %}
{{ (level * ww_ratio / max_ratio) | round(0) | int }}
{% else %}
0
{% endif %}
- service: light.turn_on
target:
entity_id: light.studio_kaltes_licht
data:
brightness: >
{% set level = state_attr(this.entity_id, 'brightness') | int(255) %}
{% set min_mireds = 167 %}
{% set max_mireds = 333 %}
{% set ww_ratio = (color_temp - min_mireds) / (max_mireds - min_mireds) %}
{% set cw_ratio = 1 - ww_ratio %}
{% set max_ratio = [ww_ratio, cw_ratio] | max %}
{% if max_ratio > 0 %}
{{ (level * cw_ratio / max_ratio) | round(0) | int }}
{% else %}
0
{% endif %}
And here are the relevant debug logs showing the "manual control" detection:
2025-09-27 22:54:30.302 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Studio: filtered_lights: '['light.studio_licht']'
2025-09-27 22:54:30.302 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01K66F6KRN:al:KN2H:trn_:05'
2025-09-27 22:54:30.306 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Brightness of 'light.studio_licht' significantly changed from 49 to 219 with context.id='01K66F9C4S:al:KN2H:ntrv:06'
2025-09-27 22:54:30.306 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Studio: State attributes of 'light.studio_licht' changed ({...}) wrt 'last_service_data' ({'entity_id': 'light.studio_licht', 'brightness': 49, 'color_temp_kelvin': 3003}) (context.id=01K66F9C4S:al:KN2H:ntrv:06)
2025-09-27 22:54:30.307 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] 'adaptive_lighting.manual_control' event fired for switch.adaptive_lighting_studio for light light.studio_licht
2025-09-27 22:54:30.307 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Marking 'light.studio_licht' as manually controlled.
Is there a recommended way to configure a template light like this to work correctly with Adaptive Lighting? Any help or guidance would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello developers,
First of all, I absolutely love this integration! The adaptive light control is fantastic and has become an essential part of my Home Assistant setup. Thank you for your great work.
I'm running into an issue when using Adaptive Lighting with a virtual CCT light that I've created from two separate warm-white and cool-white channels using a template light.
My observation is that the integration and the template light get into a conflict, likely a timing issue. When Adaptive Lighting adjusts the color temperature and brightness of the virtual light, my template's logic updates the two underlying physical lights. This subsequent state change appears to be incorrectly detected by Adaptive Lighting as a manual override, causing it to stop adapting.
Here is my light template configuration:
And here are the relevant debug logs showing the "manual control" detection:
Is there a recommended way to configure a template light like this to work correctly with Adaptive Lighting? Any help or guidance would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions