# Ajout de ColorTemperature et XY dans intégration matter pour les ampoules

**URL:** <https://community.gladysassistant.com/t/ajout-de-colortemperature-et-xy-dans-integration-matter-pour-les-ampoules/10363>\
**Category:** Demande de fonctionnalités\
**Tags:** feature-core, in-progress\
**Created:** [Juillet 20, 2026, 10:11 UTC](https://community.gladysassistant.com/t/ajout-de-colortemperature-et-xy-dans-integration-matter-pour-les-ampoules/10363 "2026-07-20T10:11:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris75](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/6a8cbe/32.png) [@Chris75](https://community.gladysassistant.com/u/Chris75)\
**Post date:** [Juillet 20, 2026, 10:11 UTC](https://community.gladysassistant.com/t/ajout-de-colortemperature-et-xy-dans-integration-matter-pour-les-ampoules/10363/1 "2026-07-20T10:11:32Z")

</div>

**voir le sujet :** [Fonctionnalités différentes entre Zigbee et matter](https://community.gladysassistant.com/t/fonctionnalites-differentes-entre-zigbee-et-matter/10360)

---

<div class="post-metadata">

**Author:** ![cursor-bot](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cursor-bot/32/22252_2.png) [@cursor-bot](https://community.gladysassistant.com/u/cursor-bot)\
**Post date:** [Août 17, 2026, 12:07 UTC](https://community.gladysassistant.com/t/ajout-de-colortemperature-et-xy-dans-integration-matter-pour-les-ampoules/10363/2 "2026-08-17T12:07:36Z")

</div>

Salut tout le monde !

Ce sujet est désormais **en cours de développement**.

Une PR a été ouverte pour supporter les modes ColorTemperature et XY du cluster ColorControl Matter :

> <https://github.com/GladysAssistant/Gladys/pull/2908>
>
> Implements feature request: https://community.gladysassistant.com/t/ajout-de-col…ortemperature-et-xy-dans-integration-matter-pour-les-ampoules/10363
> 
> \### Description
> 
> Gladys' Matter integration only handled the \*\*Hue/Saturation\*\* mode of the \`ColorControl\` cluster. Bulbs that report their color through the \*\*XY\*\* (CIE 1931) mode and/or expose a \*\*color temperature\*\* — for example the IKEA KAJPLATS bulb paired through the IKEA DIRIGERA hub — only showed ON/OFF and brightness in Gladys, while the very same bulb exposes color and color temperature when paired over Zigbee2mqtt. This PR adds support for those two remaining modes of the cluster.
> 
> \*\*What changed (\`server/services/matter\`)\*\*
> 
> \- \*\*Device discovery\*\* (\`utils/convertToGladysDevice.js\`)
> - a \`light\`/\`color\` feature is now created when the cluster \`featureMap\` advertises \*\*either\*\* \`hueSaturation\` \*\*or\*\* \`xy\` (previously only \`hueSaturation\`)
> - a \`light\`/\`temperature\` feature is created when the cluster advertises \`colorTemperature\`, using the \`ColorTempPhysicalMinMireds\` / \`ColorTempPhysicalMaxMireds\` range reported by the bulb, with a fallback to the usual \`153\`–\`500\` range when the bulb does not expose it or advertises an inconsistent range
> - a Hue/Saturation-only bulb is strictly unchanged, and a bulb advertising no color mode at all still gets no color feature
> \- \*\*Reading state\*\* (\`lib/matter.readInitialDeviceStates.js\`, \`lib/matter.listenToStateChange.js\`)
> - \`CurrentX\` / \`CurrentY\` are read and subscribed to when the bulb only supports the XY mode (Hue/Saturation keeps priority when both are supported)
> - \`ColorTemperatureMireds\` is read and subscribed to when the color temperature mode is supported
> \- \*\*Sending commands\*\* (\`lib/matter.setValue.js\`)
> - \`MoveToColor\` is sent for XY-only bulbs, \`MoveToHueAndSaturation\` is still used when Hue/Saturation is supported
> - \`MoveToColorTemperature\` is sent for the color temperature feature
> 
> \*\*Units and conversions\*\*
> 
> No new device feature category or type was introduced — this reuses the existing \`light\`/\`color\` and \`light\`/\`temperature\` types already used by Zigbee2mqtt, Philips Hue and Tasmota.
> 
> \- \*\*Color temperature\*\*: Gladys stores it in \*\*mireds\*\*, which is exactly the unit used by Matter, so no numeric conversion is needed — only range handling and validation (\`utils/colorControlMatterMapping.js\`).
> \- \*\*Color\*\*: Matter stores \`CurrentX\`/\`CurrentY\` as \`uint16\` equal to the CIE xy chromaticity × 65536. \`xyToInt()\` already existed in \`server/utils/colors.js\`; this PR adds its reverse, \`intToXy()\`, so the conversion works in both directions (reading state and sending a command). Both directions are unit-tested, including a round-trip test.
> 
> \### Forum
> 
> Forum: https://community.gladysassistant.com/t/ajout-de-colortemperature-et-xy-dans-integration-matter-pour-les-ampoules/10363
> 
> Context and diagnosis by @Pierre-Gilles in the linked discussion: https://community.gladysassistant.com/t/fonctionnalites-differentes-entre-zigbee-et-matter/10360
> 
> \### Checklist
> 
> \- \[x\] Tests pass: new unit tests were added for every changed server file, mirroring the source structure (\`server/test/services/matter/...\`, \`server/test/utils/colors.test.js\`). A targeted \`nyc\` run reports \*\*100% line coverage and no uncovered branch on the lines changed by this PR\*\*. The full \`npm test\` suite was run: the only failures are pre-existing environment failures on this machine (gateway backup tests requiring the \`sqlite3\` CLI, which is not installed), verified to fail identically on \`master\`.
> \- \[x\] Linter and prettier pass on the server (\`npm run prettier\`, \`npm run prettier-check\`, \`npm run eslint\` — 0 errors)
> \- \[x\] No undocumented breaking change — the \`ColorControl\` line of \`server/services/matter/README.md\` was updated
> \- \[\] Cypress was \*\*not\*\* run (no front-end change: the frontend already renders the \`light\`/\`color\` and \`light\`/\`temperature\` feature types, so no new i18n key or component was needed)
> 
> \### Notes for reviewers
> 
> \> This pull request was opened by an automated Claude Code run and \*\*needs human review before merging\*\*.
> 
> It \*\*could not be tested against real hardware\*\* — no Matter device was available in this environment. Everything is covered by unit tests with mocked Matter nodes following the existing patterns in \`server/test/services/matter/\`. Testing on a real bulb that uses the XY and/or ColorTemperature modes (such as the IKEA KAJPLATS behind a DIRIGERA hub) would be very valuable before merging, in particular:
> 
> \- that the color rendered by the bulb matches the color picked in Gladys (the XY conversion uses the Wide RGB D65 matrices, the same family of conversion already used by \`xyToInt\` for Philips Hue and Zigbee2mqtt)
> \- that the mireds range advertised by the bulb produces a usable slider range in the UI
> 
> 
> \---
> \_Generated by \[Claude Code\](https://claude.ai/code/session\_01BRdJPgpjHkz9LKu39n8fm8)\_
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Added support for Matter lights using XY color control, including color conversion and live state updates.
> \* Added Matter color-temperature support with automatic handling of supported temperature ranges.
> \* Improved compatibility across hue/saturation, XY color, and color-temperature controls.
> \* \*\*Bug Fixes\*\*
> \* Added safer handling for unavailable or unsupported color attributes.
> \* Added fallback behavior for missing or invalid color-temperature ranges.
> \* \*\*Documentation\*\*
> \* Updated Matter compatibility documentation to reflect expanded color-control support.

N’hésitez pas à suivre la PR, à tester dès que possible et à faire vos retours ici.
