# Matter - Climatiseur : Gestion des modes

**URL:** <https://community.gladysassistant.com/t/matter-climatiseur-gestion-des-modes/10225>\
**Category:** Demandes livrées\
**Tags:** matter, intégration\
**Created:** [Mai 12, 2026, 7:26 UTC](https://community.gladysassistant.com/t/matter-climatiseur-gestion-des-modes/10225 "2026-05-12T19:26:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Juillet 20, 2026, 12:17 UTC](https://community.gladysassistant.com/t/matter-climatiseur-gestion-des-modes/10225/5 "2026-07-20T12:17:40Z")

</div>

Grâce aux nouvelles `supported_options` développés récemment, j’ai pu développer cette fonctionnalité !

Pour tester, je vous proposes une image Docker:

```auto
ghcr.io/gladysassistant/gladys-preview:cursor-matter-ac-mode-management-fb55

```

La PR :

> <https://github.com/gladysassistant/gladys/pull/2690>
>
> \## Description
> 
> Adds air conditioner operating mode management to the Matter int…egration, as requested on the community forum: https://community.gladysassistant.com/t/matter-climatiseur-gestion-des-modes/10225
> 
> Air conditioners exposed over Matter (e.g. Daikin units bridged through Matterbridge) expose their operating mode through the \`Thermostat\` cluster \`SystemMode\` attribute. Until now, Gladys only handled the local temperature and the heating/cooling setpoints, so the mode selector visible in Apple Home was missing in Gladys.
> 
> \### Server (\`server/services/matter\`)
> 
> \- New \`utils/thermostatMatterMapping.js\`: bidirectional mapping between Matter \`SystemMode\` (Off/Auto/Cool/Heat/EmergencyHeat/Precooling/FanOnly/Dry/Sleep) and Gladys \`AC\_MODE\` (Auto/Cooling/Heating/Drying/Fan), plus \`getAcModeSupportedOptions\` which builds the feature \`supported\_options\` from the Thermostat cluster capabilities (Auto only when the cluster has the \`AutoMode\` feature, Heat only with the \`Heating\` feature; Dry/FanOnly have no Matter capability flag and are always exposed on cooling devices).
> \- \`convertToGladysDevice\`: devices whose Thermostat cluster supports the \`cooling\` feature now expose an \`air-conditioning/mode\` feature (\`:mode\` external id suffix) with its \`supported\_options\` (persisted via the mechanism introduced in #2567), and \`min\`/\`max\` derived from them.
> \- \`matter.listenToStateChange\`: subscribes to \`SystemMode\` attribute changes and emits the mapped Gladys AC mode (values without a Gladys equivalent, such as \`Off\`, are ignored — on/off is handled by the \`OnOff\` cluster).
> \- \`matter.readInitialDeviceStates\`: reads the initial \`SystemMode\` value on startup.
> \- \`matter.setValue\`: writes the \`SystemMode\` attribute when the user changes the mode from Gladys.
> \- README compatibility table updated.
> 
> \### Server (core fix)
> 
> \- \`utils/normalizeSupportedOptions.js\`: strip the DB metadata fields (\`device\_feature\_id\`, \`created\_at\`, \`updated\_at\`) from \`supported\_options\` payloads. Devices fetched from the API include the full \`DeviceFeatureSupportedOption\` rows, so re-saving a device from an integration page failed validation with \`"\[0\].device\_feature\_id" is not allowed\` (found while testing this PR end-to-end).
> 
> \### Front
> 
> \- \`AirConditioningModeDeviceFeature\` now renders the mode buttons dynamically from the feature \`supported\_options\` (sorted by \`sort\_order\`, labels translated per mode with the stored label as fallback). Features without \`supported\_options\` (e.g. existing MELCloud devices) keep the previous behavior: Auto/Cool/Heat, plus Dry/Fan when the feature \`max\` covers them.
> \- New \`drying\`/\`fan\` translations added to \`en\`, \`fr\`, and \`de\`.
> 
> \## Tests
> 
> \- New unit tests for \`thermostatMatterMapping\` (all mappings, unknown-value branches, and supported options per capability combination).
> \- Updated/extended tests for \`convertToGladysDevice\`, \`listenToStateChange\`, \`readInitialDeviceStates\`, \`setValue\`, \`matter.init\` and \`normalizeSupportedOptions\` (metadata stripping round-trip).
> \- \`npm run coverage\` on the server passes (4337 tests), with 100% line coverage on every touched file. Front \`prettier-check\`, \`eslint\`, \`compare-translations\`, \`build\` and the full Cypress suite pass.
> 
> \## End-to-end validation
> 
> Tested against \*\*two real Matter nodes\*\* built with matter.js and commissioned into Gladys through the Matter integration UI/API:
> 
> \- a Room Air Conditioner with Thermostat \`Heating + Cooling + AutoMode\` → Mode feature with 5 supported options (Auto, Cool, Heat, Dry, Fan);
> \- a second one with \`Heating + Cooling\` only (no AutoMode) → Mode feature with 4 supported options (no Auto).
> 
> The options are persisted in \`t\_device\_feature\_supported\_option\`:
> 
> \`\`\`
> matter-1-1-513-mode|0|Auto|0 matter-2-1-513-mode|1|Cool|0
> matter-1-1-513-mode|1|Cool|1 matter-2-1-513-mode|2|Heat|1
> matter-1-1-513-mode|2|Heat|2 matter-2-1-513-mode|3|Dry|2
> matter-1-1-513-mode|3|Dry|3 matter-2-1-513-mode|4|Fan|3
> matter-1-1-513-mode|4|Fan|4
> \`\`\`
> 
> The dashboard widget follows them — the first device shows 5 buttons, the second only 4 (no Auto), and clicking a mode writes the correct Matter \`SystemMode\` to each device:
> 
> \[matter\_ac\_supported\_options\_demo.mp4\](https://cursor.com/agents/bc-6057d516-266d-490e-8877-6dc49a82fb55/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fmatter\_ac\_supported\_options\_demo.mp4)
> 
> \`\`\`
> \[VIRTUAL-AC\] systemMode changed to 1 (Auto)
> \[VIRTUAL-AC\] systemMode changed to 8 (Dry)
> \[VIRTUAL-AC-NOAUTO\] systemMode changed to 3 (Cool)
> \[VIRTUAL-AC-NOAUTO\] systemMode changed to 7 (FanOnly)
> \`\`\`
> 
> \[Paired Matter AC device card with Mode feature\](https://cursor.com/agents/bc-6057d516-266d-490e-8877-6dc49a82fb55/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fmatter\_device\_card\_with\_mode\_feature.webp)
> 
> 
> \<sub\>To show artifacts inline, \<a href="https://cursor.com/dashboard/cloud-agents#my-pull-requests"\>enable\</a\> in settings.\</sub\>
> 
> 
> \<div\>\<a href="https://cursor.com/agents/bc-6057d516-266d-490e-8877-6dc49a82fb55"\>\<picture\>\<source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"\>\<source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"\>\<img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"\>\</picture\>\</a\>&nbsp;\<a href="https://cursor.com/background-agent?bcId=bc-6057d516-266d-490e-8877-6dc49a82fb55"\>\<picture\>\<source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"\>\<source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"\>\<img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"\>\</picture\>\</a\>&nbsp;\</div\>
> 
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Added Matter thermostat HVAC operating mode control (Auto/Cooling/Heating/Drying/Fan) with mode availability derived from the device’s supported options and kept in sync.
> \* Unified AC mode selection so all mode buttons update through the same flow.
> \* \*\*Documentation\*\*
> \* Updated Matter thermostat documentation to describe HVAC system modes.
> \* \*\*Bug Fixes\*\*
> \* Improved supported-option saving by stripping database metadata from option objects.
> \* Skip unknown/unmapped thermostat system modes and ignore unsupported app mode values to prevent incorrect updates.
> \* \*\*Localization\*\*
> \* Added/extended English, French, and German labels for the new drying and fan modes.

---

_[View the full topic](https://community.gladysassistant.com/t/matter-climatiseur-gestion-des-modes/10225)._
