(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.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-29 UTC."],[[["\u003cp\u003eThe \u003ccode\u003esdm.devices.traits.ThermostatMode\u003c/code\u003e trait allows you to interact with the thermostat mode (HEAT, COOL, HEATCOOL, OFF) of compatible Nest Thermostat devices.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the available and current thermostat modes using a GET request to the device's endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSetMode\u003c/code\u003e command allows you to change the thermostat mode to a desired value by sending a POST request.\u003c/p\u003e\n"],["\u003cp\u003eEco modes are managed separately through the \u003ccode\u003eThermostatEco\u003c/code\u003e trait and not through this trait.\u003c/p\u003e\n"],["\u003cp\u003eCertain thermostat models may have limitations on changing the Eco mode while the thermostat mode is OFF, requiring a switch to HEAT, COOL, or HEATCOOL first.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\nThermostatMode Schema\n=====================\n\n[Nest Thermostat](/nest/device-access/api/thermostat)\n\n`sdm.devices.traits.ThermostatMode`\n\nThis trait belongs to device types of THERMOSTAT that support different thermostat modes.\n\n\u003cbr /\u003e\n\nFields\n------\n\n\n| Field | Description | Data Type |\n|------------------|-------------------------------------|--------------------------------------------------------------|\n| `availableModes` | List of supported thermostat modes. | `array(string)` Value: \\[\"HEAT\", \"COOL\", \"HEATCOOL\", \"OFF\"\\] |\n| `mode` | The current thermostat mode. | `string` Values: \"HEAT\", \"COOL\", \"HEATCOOL\", \"OFF\" |\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.ThermostatMode\" : {\n \"availableModes\" : [\"HEAT\", \"COOL\", \"HEATCOOL\", \"OFF\"],\n \"mode\" : \"COOL\"\n }\n }\n }\n\n\u003cbr /\u003e\n\nCommands\n--------\n\n\u003cbr /\u003e\n\n### SetMode\n\nChange the thermostat mode.\n\n\u003cbr /\u003e\n\n| This trait does not work with Eco modes. See the [ThermostatEco](/nest/device-access/traits/device/thermostat-eco) trait for more information.\n\n\u003cbr /\u003e\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.ThermostatMode.SetMode\",\n \"params\" : {\n \"mode\" : \"HEAT\"\n }\n }\n\n### Response\n\n```\n{}\n```\n\n#### SetMode request fields\n\n| Field | Description | Data Type |\n|--------|---------------------------------------|----------------------------------------------------|\n| `mode` | The mode to change the thermostat to. | `string` Values: \"HEAT\", \"COOL\", \"HEATCOOL\", \"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 trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the 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"]]