Skip to content

Color temperature control broken on HA 2026.3 — mired-to-kelvin migration needed #2182

Description

@kine90

The problem

After updating to Home Assistant Core 2026.3, all LocalTuya light entities no longer respond to color temperature commands. Brightness control still works, but color_temp_kelvin is completely ignored.

When calling light.turn_on with color_temp_kelvin, the light turns on and applies brightness correctly, but the state reports color_temp_kelvin: None — even though color_mode is color_temp. Some lights even revert to an incorrect HS color (e.g. red hs_color: (6, 100.0)) instead of the requested warm white.

This is caused by the HA 2026.3 breaking change that removed deprecated mired-based light features:

  • Removed LightEntity.color_temp, LightEntity.min_mireds, LightEntity.max_mireds properties
  • Removed ATTR_COLOR_TEMP and ATTR_KELVIN from light.turn_on service
  • Only color_temp_kelvin, min_color_temp_kelvin, max_color_temp_kelvin are now supported

LocalTuya's light platform likely still uses the removed mired-based properties (_attr_color_temp, min_mireds, max_mireds) internally. These need to be migrated to their kelvin equivalents (_attr_color_temp_kelvin, _attr_min_color_temp_kelvin, _attr_max_color_temp_kelvin).

Additionally, all LocalTuya light entities log DPS index 21 warnings at startup, which may be related.

ZHA lights on the same HA instance work perfectly with the same color_temp_kelvin calls, confirming the issue is specific to LocalTuya.

Environment

  • Localtuya version:
  • Home Assistant Core version: 2026.3.0
  • Does the device work using the Home Assistant Tuya Cloud component?
  • Does the device work using the Tinytuya (https://github.com/jasonacox/tinytuya) command line tool?
  • Was the device working with earlier versions of localtuya? Everything worked perfectly on HA 2026.2.x and prior.
  • Are you using the Tuya/SmartLife App in parallel?

Steps to reproduce

  1. Update Home Assistant Core to 2026.3.0
  2. Call light.turn_on on any LocalTuya light entity with color_temp_kelvin parameter (e.g. color_temp_kelvin: 3200)
  3. Observe that brightness is applied correctly, but color_temp_kelvin remains None in the entity state. The light does not change color temperature.

DP dump

N/A — the issue is not device-specific. All LocalTuya lights with color temperature support are affected. The DPs themselves are correct; the problem is in how the HA LightEntity properties are implemented.

Provide Home Assistant traceback/logs

DPS index 21 warnings at startup for every LocalTuya light:
2026-03-05 18:00:42.540 WARNING (MainThread) [custom_components.localtuya.light] [bf0...nah] Entity None is requesting unknown DPS index 21
2026-03-05 18:00:42.541 WARNING (MainThread) [custom_components.localtuya.light] [bf0...nah] Entity light.lampadario_cucina_up is requesting unknown DPS index 21
2026-03-05 18:00:42.542 WARNING (MainThread) [custom_components.localtuya.light] [bf1...2gk] Entity light.lampada_piccola is requesting unknown DPS index 21
2026-03-05 18:00:42.543 WARNING (MainThread) [custom_components.localtuya.light] [bf4...4im] Entity light.campingaz is requesting unknown DPS index 21
2026-03-05 18:00:42.544 WARNING (MainThread) [custom_components.localtuya.light] [bf9...a7d] Entity light.lampada is requesting unknown DPS index 21
2026-03-05 18:00:42.544 WARNING (MainThread) [custom_components.localtuya.light] [bfb...0c9] Entity light.bajour is requesting unknown DPS index 21
2026-03-05 18:00:42.545 WARNING (MainThread) [custom_components.localtuya.light] [bfc...0xc] Entity light.lampadario_cucina is requesting unknown DPS index 21
2026-03-05 18:00:42.546 WARNING (MainThread) [custom_components.localtuya.light] [bfd...nil] Entity light.faretto is requesting unknown DPS index 21

Example: light.turn_on sends color_temp_kelvin but light ignores it:
Service call:
light.turn_on: {'entity_id': 'light.faretto', 'brightness': 215, 'color_temp_kelvin': 3215}
Resulting state — brightness applied, color_temp_kelvin is None:

state light.faretto=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535,
supported_color_modes=[ColorMode.COLOR_TEMP, ColorMode.HS],
color_mode=color_temp, brightness=216, color_temp_kelvin=None,
hs_color=None, rgb_color=None, xy_color=None

Another light turns RED instead of warm white:
Service call:
light.turn_on: {'entity_id': 'light.lampada_piccola', 'brightness': 215, 'color_temp_kelvin': 3210}
Resulting state — switches to HS mode with red color:

state light.lampada_piccola=on; color_mode=hs, brightness=216,
color_temp_kelvin=None, hs_color=(6, 100.0), rgb_color=(255, 25, 0)

For comparison, a ZHA light on the same system works correctly:
Service call:
light.turn_on: {'entity_id': 'light.spot_2', 'brightness': 218, 'color_temp_kelvin': 3295}
Resulting state — color_temp_kelvin correctly applied:

state light.spot_2=on; color_mode=color_temp, brightness=218,
color_temp_kelvin=3300

Additional information

The root cause is the HA 2026.3 removal of deprecated light entity properties. LocalTuya's light.py needs to migrate from:

  • _attr_color_temp_attr_color_temp_kelvin
  • _attr_min_mireds / _attr_max_mireds_attr_min_color_temp_kelvin / _attr_max_color_temp_kelvin
  • LightEntity.color_temp property → LightEntity.color_temp_kelvin
  • ATTR_COLOR_TEMP in turn_on kwargs → ATTR_COLOR_TEMP_KELVIN

See the migration examples in the HA developer blog for the required changes.

Affected devices: All LocalTuya lights with color temperature support (tested with 8 different Tuya devices — all broken).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions