Le thermostat doit être dans le mode correspondant à la commande appelée avant de modifier les consignes de température. La commande et le ou les champs permettant de modifier la ou les températures de consigne varient en fonction du mode du thermostat.
Par exemple, pour émettre la commande
SetHeat, le thermostat doit d'abord être en mode CHAUFFAGE :
Notez que les commandes de température de consigne n'acceptent que les degrés Celsius comme paramètre, bien que le Google Nest Thermostat puisse afficher la température en degrés Celsius ou Fahrenheit.
SetHeat
Définit la température de consigne lorsque le thermostat est en mode CHAUFFAGE.
Température cible minimale à définir lorsque le thermostat est en mode CHAUFFAGE/CLIMATISATION.
number Exemple : 20.0
coolCelsius
Température de consigne maximale à définir lorsque le thermostat est en mode CHAUFFAGE/CLIMATISATION.
number Exemple : 22.0
Erreurs
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.
La valeur de refroidissement doit être supérieure à la valeur de chauffage.
INVALID_ARGUMENT
Assurez-vous que le champ heatCelsius est inférieur au champ coolCelsius dans votre commande.
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.ThermostatTemperatureSetpoint\u003c/code\u003e trait allows you to get and set the target temperature(s) for Nest thermostats in HEAT, COOL, and HEATCOOL modes using Celsius.\u003c/p\u003e\n"],["\u003cp\u003eGET requests retrieve the current target temperature(s) based on the thermostat's current mode, returning \u003ccode\u003eheatCelsius\u003c/code\u003e for HEAT and HEATCOOL, and \u003ccode\u003ecoolCelsius\u003c/code\u003e for COOL and HEATCOOL.\u003c/p\u003e\n"],["\u003cp\u003eYou can use commands like \u003ccode\u003eSetHeat\u003c/code\u003e, \u003ccode\u003eSetCool\u003c/code\u003e, and \u003ccode\u003eSetRange\u003c/code\u003e to change the target temperature(s), ensuring the thermostat is in the corresponding mode before sending the command.\u003c/p\u003e\n"],["\u003cp\u003eTemperature setpoints are specified in Celsius only and cannot be changed when the thermostat is in Eco or manual Eco mode.\u003c/p\u003e\n"],["\u003cp\u003eWhen setting a temperature range in HEATCOOL mode, ensure \u003ccode\u003eheatCelsius\u003c/code\u003e is lower than \u003ccode\u003ecoolCelsius\u003c/code\u003e to avoid errors.\u003c/p\u003e\n"]]],["The `ThermostatTemperatureSetpoint` trait for Nest thermostats manages target temperatures. It uses `heatCelsius` and `coolCelsius` fields for HEAT and COOL modes, or both for HEATCOOL. A GET request returns the current temperature set for the active mode. To change setpoints, use `SetHeat`, `SetCool`, or `SetRange` commands, ensuring the thermostat is in the corresponding mode (HEAT, COOL, or HEATCOOL). Setpoint adjustments can be rejected in Eco mode or if `coolCelsius` is not greater than `heatCelsius`.\n"],null,["\u003cbr /\u003e\n\nThermostatTemperatureSetpoint Schema\n====================================\n\n[Nest Thermostat](/nest/device-access/api/thermostat)\n\n`sdm.devices.traits.ThermostatTemperatureSetpoint`\n\nThis trait belongs to device types of THERMOSTAT that support setting target temperature and temperature range.\n\n\u003cbr /\u003e\n\nFields\n------\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| **Note:** A GET request for this trait only returns the current mode's temperature value(s).\n\n\u003cbr /\u003e\n\n| Field | Description | Data Type |\n|---------------|-----------------------------------------------------------------------|------------------------|\n| `heatCelsius` | Target temperature in Celsius for thermostat HEAT and HEATCOOL modes. | `number` Example: 20.0 |\n| `coolCelsius` | Target temperature in Celsius for thermostat COOL and HEATCOOL modes. | `number` Example: 22.0 |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Sample GET request and response - HEAT\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.ThermostatTemperatureSetpoint\" : {\n \"heatCelsius\" : 20.0,\n }\n }\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Sample GET request and response - COOL\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.ThermostatTemperatureSetpoint\" : {\n \"coolCelsius\" : 22.0\n }\n }\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Sample GET request and response - HEATCOOL\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.ThermostatTemperatureSetpoint\" : {\n \"heatCelsius\" : 20.0,\n \"coolCelsius\" : 22.0\n }\n }\n }\n\n\u003cbr /\u003e\n\nCommands\n--------\n\nThe thermostat must be in the mode that corresponds to the command being called prior to changing\nthe temperature setpoints. The command and field(s) to change the setpoint(s) varies by thermostat\nmode.\n\nFor example, to issue the\n\nSetHeat\ncommand, the thermostat must be in HEAT mode first:\n\n| Mode | Command | Field(s) |\n|----------|----------------------------------------------------------------------------------------|------------------------------|\n| HEAT | [SetHeat](/nest/device-access/traits/device/thermostat-temperature-setpoint#setheat) | `heatCelsius` |\n| COOL | [SetCool](/nest/device-access/traits/device/thermostat-temperature-setpoint#setcool) | `coolCelsius` |\n| HEATCOOL | [SetRange](/nest/device-access/traits/device/thermostat-temperature-setpoint#setrange) | `heatCelsius`, `coolCelsius` |\n\nNote that the setpoint commands only take degrees in Celsius as a parameter, though the\nGoogle Nest Thermostat can display temperature in either degrees Celsius or Fahrenheit.\n| All Set\\* commands will be rejected if the thermostat is in Eco mode. See the [ThermostatEco](/nest/device-access/traits/device/thermostat-eco) trait for more information.\n\n\u003cbr /\u003e\n\n### SetHeat\n\nSets the target temperature when the thermostat is in HEAT mode.\n\n#### SetHeat request and response\n\n### Request\n\n POST /enterprises/project-id/devices/device-id:executeCommand\n {\n \"command\" : \"sdm.devices.commands.ThermostatTemperatureSetpoint.SetHeat\",\n \"params\" : {\n \"heatCelsius\" : 22.0\n }\n }\n\n### Response\n\n```\n{}\n```\n\n#### SetHeat request fields\n\n| Field | Description | Data Type |\n|---------------|--------------------------------------------------------------------|------------------------|\n| `heatCelsius` | The target temperature to set when the thermostat is in HEAT mode. | `number` Example: 22.0 |\n\n### SetCool\n\nSets the target temperature when the thermostat is in COOL mode.\n\n#### SetCool request and response\n\n### Request\n\n POST /enterprises/project-id/devices/device-id:executeCommand\n {\n \"command\" : \"sdm.devices.commands.ThermostatTemperatureSetpoint.SetCool\",\n \"params\" : {\n \"coolCelsius\" : 20.0\n }\n }\n\n### Response\n\n```\n{}\n```\n\n#### SetCool request fields\n\n| Field | Description | Data Type |\n|---------------|--------------------------------------------------------------------|------------------------|\n| `coolCelsius` | The target temperature to set when the thermostat is in COOL mode. | `number` Example: 20.0 |\n\n### SetRange\n\nSets the minimum and maximum temperatures when the thermostat is in HEATCOOL mode.\n\n#### SetRange request and response\n\n### Request\n\n POST /enterprises/project-id/devices/device-id:executeCommand\n {\n \"command\" : \"sdm.devices.commands.ThermostatTemperatureSetpoint.SetRange\",\n \"params\" : {\n \"heatCelsius\" : 20.0,\n \"coolCelsius\" : 22.0\n }\n }\n\n### Response\n\n```\n{}\n```\n\n#### SetRange request fields\n\n| Field | Description | Data Type |\n|---------------|--------------------------------------------------------------------------------|------------------------|\n| `heatCelsius` | The minimum target temperature to set when the thermostat is in HEATCOOL mode. | `number` Example: 20.0 |\n| `coolCelsius` | The maximum target temperature to set when the thermostat is in HEATCOOL mode. | `number` Example: 22.0 |\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| Cool value must be greater than heat value. | `INVALID_ARGUMENT` | Make sure that the `heatCelsius` field is less than the `coolCelsius` field in your command. |\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"]]