Máy điều nhiệt phải ở chế độ tương ứng với lệnh được gọi trước khi thay đổi điểm đặt nhiệt độ. Lệnh và(các) trường để thay đổi(các) điểm đặt sẽ khác nhau tuỳ theo chế độ của máy điều nhiệt.
Ví dụ: để đưa ra lệnh SetHeat, trước tiên, máy điều nhiệt phải ở chế độ SƯỞI ẤM:
Nhiệt độ mục tiêu tối thiểu cần đặt khi máy điều nhiệt ở chế độ HEATCOOL.
number Ví dụ: 20.0
coolCelsius
Nhiệt độ mục tiêu tối đa cần đặt khi máy điều nhiệt ở chế độ HEATCOOL.
number Ví dụ: 22.0
Lỗi
(Các) mã lỗi sau đây có thể được trả về liên quan đến đặc điểm này:
Thông báo Lỗi
RPC
Khắc phục sự cố
Không được phép dùng lệnh này ở chế độ hiện tại của máy điều nhiệt.
FAILED_PRECONDITION
Một số mẫu máy điều nhiệt không hỗ trợ thay đổi chế độ Tiết kiệm năng lượng khi chế độ máy điều nhiệt là TẮT, theo đặc điểm ThermostatMode . Bạn phải thay đổi chế độ của máy điều nhiệt thành HEAT, COOL hoặc HEATCOOL trước khi thay đổi chế độ Tiết kiệm năng lượng.
Giá trị làm mát phải lớn hơn giá trị sưởi ấm.
INVALID_ARGUMENT
Đảm bảo rằng trường heatCelsius nhỏ hơn trường coolCelsius trong lệnh của bạn.
Không được phép dùng lệnh khi máy điều nhiệt ở chế độ MANUAL_ECO.
FAILED_PRECONDITION
Bạn không thể đặt điểm đặt nhiệt độ khi máy điều nhiệt ở Chế độ tiết kiệm năng lượng thủ công.
[null,null,["Cập nhật lần gần đây nhất: 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"]]