mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-15 08:14:04 +02:00
Fix intensity restoration and RGB output
This commit is contained in:
parent
51e0b11860
commit
844c7ced85
9 changed files with 220 additions and 45 deletions
|
|
@ -4,7 +4,7 @@ icon: lucide/sliders-horizontal
|
|||
|
||||
# Intensity
|
||||
|
||||
Intensity scales how far the adaptive settings travel from their floor, without leaving adaptive mode. It is the option to reach for when you want a dimmer room that still tracks the sun — a "mood" level, rather than a fixed brightness.
|
||||
Intensity blends the adaptive settings toward a configured endpoint, without leaving adaptive mode. It provides a room-wide "mood" level that still tracks the sun.
|
||||
|
||||
## The Dial
|
||||
|
||||
|
|
@ -32,13 +32,13 @@ output = floor_value + (adaptive_value - floor_value) × intensity / 100
|
|||
|
||||
| Intensity | Result |
|
||||
|-----------|--------|
|
||||
| `100` (default) | The adaptive values, unchanged. The dial costs nothing until you move it. |
|
||||
| `100` (default) | The adaptive values, unchanged; interpolation is skipped. |
|
||||
| `0` | The floor. |
|
||||
| in between | A scaled adaptive curve — the sun still moves the lights at every setting. |
|
||||
|
||||
The key property is that the lights stay adaptive at every value. Intensity does not freeze a light at a level; it moves the whole curve closer to the floor and keeps following the sun from there. Both brightness and color are scaled together.
|
||||
Between 0 and 100, the light keeps following the sun with a smaller range. At 0, the target stays at the endpoint. Both brightness and color are blended, subject to the profile's adaptation switches and each light's manual-control status and supported color modes.
|
||||
|
||||
Changing the dial re-adapts the lights immediately rather than waiting for the next `interval`, and the value survives a restart.
|
||||
Changing the dial re-adapts eligible, already-on lights immediately rather than waiting for the next `interval`, even with `only_once` enabled. It does not turn lights on or clear manual control. While the main switch is off, it stores the value for later. The value survives a restart and is restored before startup adaptation; `only_once` still prevents startup adaptation.
|
||||
|
||||
## Choosing the Floor
|
||||
|
||||
|
|
@ -46,16 +46,16 @@ The floor is set per configuration with `intensity_floor`:
|
|||
|
||||
| `intensity_floor` | 0% gives | Use it when |
|
||||
|-------------------|----------|-------------|
|
||||
| `sleep` (default) | `sleep_brightness` / `sleep_color_temp` | You want the dial to reach as low as the configuration goes. 0% then matches [sleep mode](sleep-mode.md). |
|
||||
| `sleep` (default) | `sleep_brightness` and the configured sleep color | You want 0% to match [sleep mode](sleep-mode.md). RGB sleep colors are used on color-capable lights; CT-only lights use `sleep_color_temp`. |
|
||||
| `minimum` | `min_brightness` / `min_color_temp` | You want the dial to stay inside the range the adaptive curve already uses. |
|
||||
|
||||
`minimum` never takes a light below what Adaptive Lighting would have done at its darkest anyway. The trade is that it does less and less as the evening goes on, and **color stops moving after sunset** — the adaptive color temperature is already `min_color_temp` there, so the floor and the value being interpolated from are the same number.
|
||||
|
||||
`sleep` keeps the dial useful at every hour, because the sleep settings sit below the adaptive curve at all times.
|
||||
The `sleep` endpoint can go below `min_brightness`. It dims and warms the light only when the sleep settings are dimmer and warmer than the current adaptive target. If you configured a brighter or cooler sleep setting, lowering intensity instead moves toward that setting. Intensity 0 means the configured endpoint, not off.
|
||||
|
||||
## `transition_until_sleep` Overrides the Floor
|
||||
|
||||
With [`transition_until_sleep`](sleep-mode.md) enabled, the adaptive color temperature after sunset descends *below* `min_color_temp` towards `sleep_color_temp`. A `min_color_temp` floor would then sit **above** the adaptive value, and turning the dial down would make the light *cooler* — the opposite of what a dimmer should do.
|
||||
With [`transition_until_sleep`](sleep-mode.md) enabled, the adaptive color after sunset moves toward the sleep color. When sleep is warmer than `min_color_temp`, using the minimum endpoint could make dial-down cool the light during that period.
|
||||
|
||||
For that reason the `sleep` floor is forced whenever `transition_until_sleep` is on, whatever `intensity_floor` says. The switch's `intensity_floor` attribute reports the floor actually in use, so you can see when this applies:
|
||||
|
||||
|
|
@ -76,8 +76,10 @@ The main switch exposes both values:
|
|||
| `intensity` | The current dial value, 0-100. |
|
||||
| `intensity_floor` | The floor in use, `sleep` or `minimum`, after the `transition_until_sleep` override. |
|
||||
|
||||
`change_switch_settings` preserves intensity, including when resetting settings to factory or configuration defaults. Set the number to 100 to restore the unmodified adaptive curve. Automations watching `brightness_pct` see the blended target, so changing intensity can trigger their brightness thresholds.
|
||||
|
||||
## Why Not Just Scale `min_brightness` and `max_brightness`?
|
||||
|
||||
Rescaling the brightness band from an automation works, but it hardcodes each configuration's band in the automation. Retuning a light in Adaptive Lighting then silently puts the two out of step, and the automation has to be updated in parallel forever. It also leaves color untouched unless you cap `max_color_temp` separately.
|
||||
An `input_number` helper and `change_switch_settings` automation can reproduce this brightness curve by replacing each original bound `B` with `floor + (B - floor) * intensity / 100`. Both bounds keep following the sun; this does not freeze the target. The automation needs the original bounds and must keep them in sync when the profile is retuned. Ordinary color-temperature bounds can be transformed similarly, but this alone does not reproduce sleep-RGB blending.
|
||||
|
||||
The dial reads the configuration's own numbers, so there is nothing to keep in sync, and it moves color along with brightness.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue