Syncing Two Matter Lights in Home Assistant

syncing-two-matter-lights-in-home-assistant.md
title Syncing Two Matter Lights in Home Assistant
date
author VahaC
read 8 min read
category Smart home
tags #automation #HomeAssistant #Light #Matter #SmartHome
Syncing Two Matter Lights in Home Assistant

Reliable Guide to Syncing Two Matter Lights in Home Assistant

⚠️ Updated for Home Assistant 2026.3+ (March 2026). HA 2026.3 removed the deprecated mired-based color_temp parameter and the kelvin parameter from the light.turn_on action, and also removed the color_temp, min_mireds, and max_mireds light entity attributes entirely. If this Matter Lights in Home Assistant sync automation was built before that release, both the kelvin: branch and the color_temp: (mireds) branch below will fail or silently stop working. This post has been rewritten to use color_temp_kelvin exclusively. Sources: Home Assistant Developer Blog — “Remove deprecated light features” (Feb 23, 2026) and Home Assistant 2026.3 — “A clean sweep” release notes.

Make your second light mirror power, brightness, and color temperature from the first one — reliably and fast. This guide covers Matter Lights in Home Assistant synchronization end to end, tuned for the current, Kelvin-only color temperature model.


TL;DR 🧾

  • L2 is the source, L3 is the target.
  • Mirrors on/off, brightness, and CCT using Kelvin only (mireds support has been removed from HA core as of 2026.3, so it’s removed here too — see the callout above).
  • Uses numeric guards to avoid bad states.
  • mode: restart keeps things snappy during slider drags.

Why Sync Matter Lights in Home Assistant This Way? 💡

Light groups mirror power well, but attributes (brightness/CCT) can be flaky across vendors. This automation enforces deterministic one-way syncing with Kelvin-only logic and solid guards — the same practical, step-by-step approach used across the rest of vahac.com. If you also run a Zigbee dimmer for manual light control, my MOES Zigbee Knob kitchen light setup walks through the same HA 2026.3 Kelvin migration for brightness/CT stepping.


Requirements ✅

Before setting up this Matter Lights in Home Assistant sync, make sure you have:

  • Home Assistant 2026.3 or newer for this version of the automation (Kelvin-only, no mireds fallback).
  • Two light entities (here named):
    • Source (L2): light.matter_living_light_2
    • Target (L3): light.matter_living_light_3
  • Source must expose color_temp_kelvin. On Home Assistant 2026.3+, this is the only color-temperature attribute a light entity can expose — color_temp (mireds) no longer exists on any light entity, regardless of the underlying integration. Source: HA Developer Blog, Feb 23, 2026.

Tip: Kelvin is the intuitive scale (e.g., 2700 K = warm, 6500 K = cool). The old reciprocal mired scale is gone from core HA as of 2026.3 — if you’re on an older HA version, you’ll need the pre-2026.3 version of this automation (not covered here), and you should plan your upgrade path since mired-based automations will break the moment you update.


Full YAML (copy-paste) 📦

Replace entity IDs to match your setup. Reconstructed and fixed for HA 2026.3 — see the callout at the top of this post.

This is the complete, ready-to-paste automation for Matter Lights in Home Assistant syncing:

alias: Sync power + brightness + color temp
triggers:
  - id: power
    trigger: state
    entity_id: light.matter_living_light_2
  - id: brightness
    trigger: state
    entity_id: light.matter_living_light_2
    attribute: brightness
  - id: ct_kelvin
    trigger: state
    entity_id: light.matter_living_light_2
    attribute: color_temp_kelvin
conditions: []
actions:
  - choose:
      # Power branch: mirror on/off, then push brightness + Kelvin on turn-on
      - conditions:
          - condition: template
            value_template: "{{ trigger.id == 'power' }}"
        sequence:
          - if:
              - condition: state
                entity_id: light.matter_living_light_2
                state: "off"
            then:
              - action: light.turn_off
                target:
                  entity_id: light.matter_living_light_3
            else:
              - action: light.turn_on
                target:
                  entity_id: light.matter_living_light_3
              - if:
                  - condition: template
                    value_template: >-
                      {{ state_attr('light.matter_living_light_2', 'brightness') is number }}
                then:
                  - action: light.turn_on
                    target:
                      entity_id: light.matter_living_light_3
                    data:
                      brightness: >-
                        {{ state_attr('light.matter_living_light_2', 'brightness') | int }}
              - if:
                  - condition: template
                    value_template: >-
                      {{ state_attr('light.matter_living_light_2', 'color_temp_kelvin') is number }}
                then:
                  - action: light.turn_on
                    target:
                      entity_id: light.matter_living_light_3
                    data:
                      color_temp_kelvin: >-
                        {{ state_attr('light.matter_living_light_2', 'color_temp_kelvin') | int }}
      # Live brightness updates while L2 is on
      - conditions:
          - condition: template
            value_template: "{{ trigger.id == 'brightness' }}"
        sequence:
          - condition: state
            entity_id: light.matter_living_light_2
            state: "on"
          - condition: template
            value_template: "{{ trigger.to_state.attributes.brightness is number }}"
          - action: light.turn_on
            target:
              entity_id: light.matter_living_light_3
            data:
              brightness: "{{ trigger.to_state.attributes.brightness | int }}"
      # Live color temperature updates (Kelvin only) while L2 is on
      - conditions:
          - condition: template
            value_template: "{{ trigger.id == 'ct_kelvin' }}"
        sequence:
          - condition: state
            entity_id: light.matter_living_light_2
            state: "on"
          - condition: template
            value_template: "{{ trigger.to_state.attributes.color_temp_kelvin is number }}"
          - action: light.turn_on
            target:
              entity_id: light.matter_living_light_3
            data:
              color_temp_kelvin: "{{ trigger.to_state.attributes.color_temp_kelvin | int }}"
mode: restart

What I removed compared to the original, and why:

  • The entire mireds (ct_mireds) branch and the color_temp data key. As of HA 2026.3, no light entity can expose a color_temp (mireds) attribute and light.turn_on rejects the color_temp data key outright with extra keys not allowed @ data['color_temp']. That branch could never fire again even if left in place.
  • The kelvin: data key, replaced with color_temp_kelvin:. light.turn_on no longer accepts kelvin either — same developer blog source as above lists ATTR_KELVIN among the removed service call arguments.
  • The state_attr(L2, 'kelvin') fallback. This is my own technical assessment, not something I found documented explicitly: to my knowledge, Home Assistant light entities have never exposed a state attribute literally named kelvin — only color_temp_kelvin. ATTR_KELVIN was an input parameter for light.turn_on, not an output attribute on the entity’s state.

How It Works (Short & Sweet) 🛠️

Here’s the logic behind this Matter Lights in Home Assistant automation, step by step:

  • Power OFFlight.turn_off(L3).
  • Power ONlight.turn_on(L3) → copy brightness (if numeric) → copy Kelvin (if numeric).
  • While ON: attribute-specific updates listen to brightness or color_temp_kelvin and forward only that field.

Guards that matter:

  • ... is number avoids errors on unknown/unavailable.
  • condition: state == on prevents changes while the source is off.
  • mode: restart keeps the last change winning during rapid slider moves.

Attribute Primer 🌈

These are the only attributes this Matter Lights in Home Assistant setup cares about:

  • Brightness: HA service data uses 0–255 (even if UI shows %).
  • Kelvin (color_temp_kelvin): 2700 K (warm) ↔ 6500 K (cool). As of HA 2026.3, this is the only valid color-temperature attribute and service parameter for lights.
  • Mireds (color_temp) — historical note only: this reciprocal scale existed prior to HA 2026.3 and is no longer part of core Home Assistant. If you’re reading this on an installation older than 2026.3, be aware that upgrading will break any automation still referencing color_temp, min_mireds, or max_mireds.

Testing Checklist ✅🧪

Run through this checklist after wiring up your Matter Lights in Home Assistant automation:

  • Toggle L2 on/off → L3 mirrors instantly.
  • Drag brightness on L2 → L3 tracks smoothly.
  • Set Kelvin on L2 (e.g., 2700/4000/6500) → L3 matches.
  • While L2 is off, changing sliders should not affect L3; turning L2 on snaps L3 to the latest look.

Troubleshooting 🔍

If your Matter Lights in Home Assistant sync isn’t behaving, check these first:

  • Brightness doesn’t update → Check Developer Tools → States: ensure L2 brightness is numeric while ON.
  • CCT doesn’t update → Verify L2 exposes color_temp_kelvin (Developer Tools → States) and that L3 also accepts color_temp_kelvin in its supported_color_modes.
  • extra keys not allowed @ data['color_temp'] or data['kelvin'] → you’re still running a pre-2026.3 version of this automation on HA 2026.3+. Replace it with the YAML above.
  • Flicker/lag → Device may rate-limit; mode: restart already helps. Consider adding a small for: delay to the brightness trigger if needed.
  • No loops → Only L2 → L3 is wired. Don’t add automations that write L3 → L2 unless you isolate them.

FAQ ❓

Q: Why prefer Kelvin over mireds? A: As of Home Assistant 2026.3, there is no longer a choice — mireds support (color_temp, min_mireds, max_mireds) has been removed from core entirely. Every Matter Lights in Home Assistant automation, and every light entity it controls, must use color_temp_kelvin.

Q: Will this mess with effects or scenes? A: If L2 changes due to a scene, L3 will mirror. Use a helper to pause syncing when you want L3 independent.


Conclusion 🧩

A single, guarded automation keeps two bulbs visually identical across vendors — power, brightness, and CCT — using Kelvin-only logic as required by current Home Assistant versions. For more on what changed around this release, see my Home Assistant 2026.4 feature roundup, and if you want to put a physical dashboard next to these lights, check my Home Assistant custom dashboard strategies post. This approach to Matter Lights in Home Assistant syncing stays clean, fast, and dependable even after the Kelvin-only migration.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.