# Concernant l'IA : luminosité/température/couleur d'une ampoule

**URL:** <https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352>\
**Category:** Demandes livrées\
**Created:** [Juillet 17, 2026, 12:41 UTC](https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352 "2026-07-17T12:41:54Z")\
**Posts on this page:** 4\
**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 17, 2026, 12:41 UTC](https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352/1 "2026-07-17T12:41:54Z")

</div>

L’IA ne sait qu’allumer ou éteindre une lumière

- j’aimerais qu’on rajoute la gestion de la luminosité ex «&nbsp;luminosité de l’ampoule Salon à 30 %&nbsp;»

- et aussi la variation de la température couleur ex «&nbsp;mets la température de couleur de la lumière bureau à «&nbsp;blanc froid&nbsp;» (6500 °K) ou «&nbsp;blanc neutre&nbsp;» (4000°k) ou «&nbsp;Blanc chaud&nbsp;» (2700 °K)&nbsp;»

- réglage de la couleur : ex «&nbsp;lampe de la chambre en bleu&nbsp;»

---

<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, 11:55 UTC](https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352/2 "2026-07-20T11:55:54Z")

</div>

Merci pour la demande !

C’est développé dans cette PR :

> <https://github.com/GladysAssistant/Gladys/pull/2688>
>
> \## Description
> 
> Implements the feature request from the community forum: \[Concer…nant l'IA : luminosité/température/couleur d'une ampoule\](https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352).
> 
> Until now the AI assistant could only turn lights on or off (\`device\_turn\_on\_off\` on \`light:binary\` features). This PR adds a new \`device.set-light\` MCP tool (exposed to the AI chat as \`device\_set\_light\`) so the assistant can handle requests like:
> 
> \- "Set the brightness of the living room bulb to 30%"
> \- "Set the office light to cool white (6500K) / neutral white (4000K) / warm white (2700K)"
> \- "Bedroom lamp in blue"
> 
> \## Changes
> 
> \- \*\*\`server/services/mcp/lib/selectFeature.js\`\*\*: new \`isLightControlFeature\` helper matching \`light:brightness\`, \`light:color\` and \`light:temperature\` features.
> \- \*\*\`server/services/mcp/lib/buildSchemas.js\`\*\*: new \`device.set-light\` tool (registered only when at least one light control feature exists):
> - \`brightness\` as a percentage (0-100), normalized to the feature \`min\`/\`max\` range;
> - \`color\` as a hex RGB string (with or without \`#\`), converted to the integer color value;
> - \`temperature\` in Kelvin, converted to mired and clamped to the feature \`min\`/\`max\` range (same convention as the Google Actions ColorSetting trait);
> - target selection by device name or by room (all lights of the room), mirroring \`device.set-shutter\`.
> - Light control features are now also exposed in the \`schema://home\` resource and in \`device.get-state\`, so the AI can read the current brightness/color/temperature.
> \- \*\*\`server/services/mcp/lib/formatValue.js\`\*\*: \`light:color\` states are reported as hex colors (e.g. \`#0000ff\`) instead of a raw integer, which the model can interpret.
> \- \*\*\`server/config/prompts/aiChat.prompt.txt\`\*\*: prompt rule directing the model to \`device\_set\_light\` for brightness/color/temperature requests.
> 
> \## Tests
> 
> \- New tests in \`server/test/services/mcp/lib/buildSchemas.test.js\` covering the home schema exposure, the happy paths (brightness normalization, hex color conversion, Kelvin→mired conversion with clamping on both ends), room/device targeting, and every error branch (missing values, missing target, unknown device, empty room, missing features, partial dispatch).
> \- New tests in \`server/test/services/mcp/lib/formatValue.test.js\` for the hex color formatting (including \`null\` last value).
> 
> 
> 
> \<div\>\<a href="https://cursor.com/agents/bc-b30f67e3-6144-40c3-95c2-70888b4cd88c"\>\<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-b30f67e3-6144-40c3-95c2-70888b4cd88c"\>\<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 light-control support for brightness, color, and color temperature.
> \* Added controls for setting light properties by device or room.
> \* Light colors are displayed in hexadecimal format.
> \* Light-control devices and capabilities now appear in available device information.
> \* \*\*Bug Fixes\*\*
> \* Improved handling and validation of brightness, color, and temperature values, including supported device limits.
> \* Clarified that on/off controls toggle lights, while property changes use dedicated light settings.

Ça partira dans la prochaine version de Gladys 🙂

---

<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 30, 2026, 8:20 UTC](https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352/3 "2026-07-30T20:20:34Z")

</div>

C’est disponible dans Gladys Assistant 4.84 :

> [@Gladys Assistant 4.84 : Les intégrations externes sont là rocket](https://community.gladysassistant.com/t/gladys-assistant-4-84-les-integrations-externes-sont-la/10396):
>
> Bonsoir à tous !! Je suis super heureux de sortir ce soir une version qui, je pense, va vraiment changer la vitesse d’évolution du projet. Les intégrations externes arrivent enfin dans Gladys ! Elles vont permettre d’enrichir beaucoup plus rapidement la liste des appareils et services compatibles, tout en permettant à chacun de développer et partager ses propres intégrations. Je vous explique tout dans cet article backhand_index_pointing_down

---

<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 30, 2026, 8:20 UTC](https://community.gladysassistant.com/t/concernant-lia-luminosite-temperature-couleur-dune-ampoule/10352/4 "2026-07-30T20:20:37Z")

</div>


