Add min_brightness setting to Light Color Mapper

Adds a minimum brightness floor (default: 5) that prevents lights from
becoming too dim. Applied to both sensor brightness and default color paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 00:51:03 +03:00
parent 9d19dfa8d3
commit eefc8993e3
2 changed files with 18 additions and 3 deletions

View File

@@ -101,6 +101,19 @@ blueprint:
max: 255
mode: slider
min_brightness:
name: Minimum Brightness
description: >
Minimum brightness for all lights (1255). If the sensor or
override brightness is below this value, this minimum is used
instead. Prevents lights from becoming too dim to see.
default: 5
selector:
number:
min: 1
max: 255
mode: slider
none_action:
name: When Sensor is Unavailable
description: "Action to take when a sensor state is None, unknown, or unavailable."
@@ -189,6 +202,7 @@ variables:
lights: !input lights
max_fps: !input max_fps
brightness_override: !input brightness_override
min_brightness: !input min_brightness
none_action: !input none_action
default_color: !input default_color
enable_debug_notifications: !input enable_debug_notifications
@@ -222,6 +236,7 @@ action:
**Pairs:** {{ pair_count }}
**FPS:** {{ max_fps }}
**Brightness Override:** {{ brightness_override }}
**Min Brightness:** {{ min_brightness }}
**Sensor States:**
{% for i in range(pair_count | int) %}
@@ -286,7 +301,7 @@ action:
entity_id: "{{ current_light }}"
data:
rgb_color: "{{ default_color }}"
brightness: "{{ brightness_override | int if brightness_override | int > 0 else 255 }}"
brightness: "{{ [brightness_override | int if brightness_override | int > 0 else 255, min_brightness | int] | max }}"
# keep_last — do nothing
@@ -295,7 +310,7 @@ action:
- variables:
sensor_rgb: "{{ state_attr(current_sensor, 'rgb_color') | default([255, 255, 255]) }}"
sensor_brightness: "{{ state_attr(current_sensor, 'brightness') | default(255) }}"
target_brightness: "{{ brightness_override | int if brightness_override | int > 0 else sensor_brightness | int }}"
target_brightness: "{{ [brightness_override | int if brightness_override | int > 0 else sensor_brightness | int, min_brightness | int] | max }}"
- service: light.turn_on
target: