Skip to content

Support kelvin light color-temp attributes (HA 2026.3+) - #33

Merged
adborbas merged 1 commit into
mainfrom
fix-light-color-temp-kelvin
Jul 17, 2026
Merged

Support kelvin light color-temp attributes (HA 2026.3+)#33
adborbas merged 1 commit into
mainfrom
fix-light-color-temp-kelvin

Conversation

@adborbas

Copy link
Copy Markdown
Owner

Changes

  • LightEntity.update(from:): read the kelvin color-temp attributes (color_temp_kelvin, min_color_temp_kelvin, max_color_temp_kelvin) as a fallback, deriving mireds from them when the legacy mired attributes are absent. Legacy mireds are still preferred when present.
  • LightController.setColorTemp: send color_temp_kelvin instead of the removed color_temp (mireds) service parameter.
  • Added LightEntityTests cases covering kelvin-derived (inverted) bounds and legacy-mireds-preferred.

Why

HA 2026.3 removed the mired light attributes (color_temp, min_mireds, max_mireds) and the color_temp light.turn_on parameter in favour of the kelvin equivalents. Hemera read/wrote only mireds, so the color-temp control silently disappeared for lamps on updated servers. This restores it while keeping older (mireds-only) servers working.

Notes

  • color_temp_kelvin has been accepted by light.turn_on since HA 2022.11, so the single kelvin write path covers every version Hemera supports — no dual write needed.
  • mireds and kelvin are reciprocals, so the bounds invert: the coolest mired (min) derives from the highest kelvin.
  • Verified on a physical iPhone 17 Pro against a live 2026.3 server; a broader 2025.10→2026.7 breaking-change sweep found no other regressions in Hemera's surface.

HA 2026.3 removed the mired light attributes (color_temp, min_mireds,
max_mireds) and the color_temp turn_on parameter in favour of the kelvin
equivalents, so Hemera's color-temp control silently disappeared for lamps
on updated servers.

Read path (LightEntity): prefer the legacy mired attributes when present,
otherwise derive them from color_temp_kelvin / min_/max_color_temp_kelvin
(reciprocal conversion; bounds invert). Write path (LightController): send
color_temp_kelvin, accepted by HA since 2022.11 so it covers every version
Hemera supports. Both old and new servers now work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@adborbas
adborbas merged commit ce4eb3c into main Jul 17, 2026
1 check passed
@adborbas
adborbas deleted the fix-light-color-temp-kelvin branch July 18, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant