Pour définir le mode du thermostat sur CHAUFFAGE, CLIMATISATION ou CHAUFFCLIM, utilisez la commande SetMode du trait ThermostatMode.
Cette commande a un impact sur d'autres caractéristiques, en fonction de l'état actuel du mode Éco ou des modifications apportées à ce mode :
Si le mode Éco est désactivé, le mode du thermostat est défini par défaut sur le dernier mode standard (CHAUFFAGE, CLIMATISATION, CHAUFF. • CLIM. ou DÉSACTIVÉ) qui était actif.
Les codes d'erreur suivants peuvent être renvoyés en lien avec ce trait :
Message d'erreur
RPC
Dépannage
La commande n'est pas autorisée dans le mode thermostat actuel.
FAILED_PRECONDITION
Certains modèles de thermostats ne permettent pas de modifier le mode Éco lorsque le mode du thermostat est DÉSACTIVÉ, conformément au trait ThermostatMode . Le mode du thermostat doit être défini sur CHAUFFAGE, CLIMATISATION ou CHAUFFCLIM avant de pouvoir modifier le mode Éco.
Commande non autorisée lorsque le thermostat est en mode MANUAL_ECO.
FAILED_PRECONDITION
Vous ne pouvez pas définir la température mémorisée lorsque le thermostat est en mode Éco manuel.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/29 (UTC).
[null,null,["Dernière mise à jour le 2025/07/29 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003esdm.devices.traits.ThermostatEco\u003c/code\u003e trait applies to Nest thermostats that support Eco modes, enabling control over energy-saving settings.\u003c/p\u003e\n"],["\u003cp\u003eThis trait allows retrieval of the thermostat's current Eco mode, available modes, and temperature thresholds for heating and cooling in Eco mode.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003eSetMode\u003c/code\u003e command to change the Eco mode of the thermostat to \u003ccode\u003eMANUAL_ECO\u003c/code\u003e or \u003ccode\u003eOFF\u003c/code\u003e, impacting other thermostat behaviors.\u003c/p\u003e\n"],["\u003cp\u003eCertain thermostat models may require the thermostat mode to be set to HEAT, COOL, or HEATCOOL before allowing changes to the Eco mode.\u003c/p\u003e\n"],["\u003cp\u003eWhile in \u003ccode\u003eMANUAL_ECO\u003c/code\u003e mode, temperature setpoints cannot be adjusted and are not returned by the ThermostatTemperatureSetpoint trait.\u003c/p\u003e\n"]]],["The `ThermostatEco` trait manages a thermostat's Eco modes, which can be either \"MANUAL_ECO\" or \"OFF\". It details the `availableModes`, `mode`, `heatCelsius` (lowest heating temperature), and `coolCelsius` (highest cooling temperature). The `SetMode` command changes the Eco mode. In MANUAL_ECO mode, temperature setpoint changes are not allowed, and commands related to that are rejected. When in OFF mode, the thermostat defaults to the last active standard mode. Some models require switching to HEAT, COOL, or HEATCOOL before changing Eco mode.\n"],null,["\u003cbr /\u003e\n\nThermostatEco Schema\n====================\n\n[Nest Thermostat](/nest/device-access/api/thermostat)\n\n`sdm.devices.traits.ThermostatEco`\n\nThis trait belongs to device types of THERMOSTAT that support ECO modes.\n\n\u003cbr /\u003e\n\nFields\n------\n\n\n| Field | Description | Data Type |\n|------------------|------------------------------------------------------------------------------------|------------------------------------------------|\n| `availableModes` | List of supported Eco modes. | `array(string)` Value: \\[\"MANUAL_ECO\", \"OFF\"\\] |\n| `mode` | The current Eco mode of the thermostat. | `string` Values: \"MANUAL_ECO\", \"OFF\" |\n| `heatCelsius` | Lowest temperature in Celsius at which the thermostat begins heating in Eco mode. | `number` Example: 20.0 |\n| `coolCelsius` | Highest temperature in Celsius at which the thermostat begins cooling in Eco mode. | `number` Example: 22.0 |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Sample GET request and response\n\n### Request\n\n```\nGET /enterprises/project-id/devices/device-id\n```\n\n### Response\n\n {\n \"name\" : \"enterprises/project-id/devices/device-id\",\n \"traits\" : {\n \"sdm.devices.traits.ThermostatEco\" : {\n \"availableModes\" : [\"MANUAL_ECO\", \"OFF\"],\n \"mode\" : \"MANUAL_ECO\",\n \"heatCelsius\" : 20.0,\n \"coolCelsius\" : 22.0\n }\n }\n }\n\n\u003cbr /\u003e\n\nCommands\n--------\n\n\u003cbr /\u003e\n\n### SetMode\n\nChange the thermostat Eco mode.\n\n\u003cbr /\u003e\n\nTo change the thermostat mode to HEAT, COOL, or HEATCOOL, use the [SetMode](/nest/device-access/traits/device/thermostat-mode#setmode) command of the ThermostatMode trait.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis command impacts other traits, based on the current status of, or changes to, the Eco mode:\n\n- If Eco mode is OFF, the thermostat mode will default to the last standard mode (HEAT, COOL, HEATCOOL, or OFF) that was active.\n- If Eco mode is MANUAL_ECO:\n - Commands for the [ThermostatTemperatureSetpoint](/nest/device-access/traits/device/thermostat-temperature-setpoint) trait are rejected.\n - Temperature setpoints are not returned by the [ThermostatTemperatureSetpoint](/nest/device-access/traits/device/thermostat-temperature-setpoint) trait.\n\n\u003cbr /\u003e\n\n| Some thermostat models do not support changing the Eco mode when the thermostat mode is OFF, according to the [ThermostatMode](/nest/device-access/traits/device/thermostat-mode) trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the Eco mode.\n\n#### SetMode request and response\n\n### Request\n\n POST /enterprises/project-id/devices/device-id:executeCommand\n {\n \"command\" : \"sdm.devices.commands.ThermostatEco.SetMode\",\n \"params\" : {\n \"mode\" : \"MANUAL_ECO\"\n }\n }\n\n### Response\n\n```\n{}\n```\n\n#### SetMode request fields\n\n| Field | Description | Data Type |\n|--------|-------------------------------------------|--------------------------------------|\n| `mode` | The Eco mode to change the thermostat to. | `string` Values: \"MANUAL_ECO\", \"OFF\" |\n\n\u003cbr /\u003e\n\n\nErrors\n------\n\nThe following error code(s) may be returned in relation to this trait:\n\n| Error Message | RPC | Troubleshooting |\n|---------------------------------------------------------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Command not allowed in current thermostat mode. | `FAILED_PRECONDITION` | Some thermostat models do not support changing the Eco mode when the thermostat mode is OFF, according to the [ThermostatMode](/nest/device-access/traits/device/thermostat-mode) trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the Eco mode. |\n| Command not allowed when thermostat in MANUAL_ECO mode. | `FAILED_PRECONDITION` | The temperature setpoint cannot be set when the thermostat is in manual Eco mode. |\n\nSee the [API Error Code Reference](/nest/device-access/reference/errors/api) for\nthe full list of API error codes.\n\n\u003cbr /\u003e"]]