Stay organized with collections
Save and categorize content based on your preferences.
Fan Schema
Nest Thermostat
sdm.devices.traits.Fan
This trait belongs to any device that has the system ability to control the fan.
Fields
Sample GET request and response
Request
GET /enterprises/ project-id
/devices/ device-id
Response
{
"name" : "enterprises/ project-id
/devices/ device-id
",
"traits" : {
" sdm.devices.traits.Fan
" : {
"timerMode" : "ON",
"timerTimeout" : "2019-05-10T03:22:54Z"
}
}
}
Commands
SetTimer
Change the fan timer.
SetTimer request and response
Request
POST /enterprises/ project-id
/devices/ device-id
:executeCommand
{
"command" : " sdm.devices.commands.Fan.SetTimer
",
"params" : {
"timerMode" : "ON",
"duration" : "3600s"
}
}
SetTimer request fields
Errors
The following error code(s) may be returned in relation to this trait:
See the API Error Code Reference
for
the full list of API error codes.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-25 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003esdm.devices.traits.Fan\u003c/code\u003e trait applies to devices with fan control capabilities, providing fields like \u003ccode\u003etimerMode\u003c/code\u003e and \u003ccode\u003etimerTimeout\u003c/code\u003e to manage the fan's timer settings.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve fan status using a GET request to the device's endpoint, which returns a JSON response containing the current \u003ccode\u003etimerMode\u003c/code\u003e and \u003ccode\u003etimerTimeout\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSetTimer\u003c/code\u003e command allows you to adjust the fan's timer by specifying the desired \u003ccode\u003etimerMode\u003c/code\u003e and an optional \u003ccode\u003eduration\u003c/code\u003e in seconds through a POST request.\u003c/p\u003e\n"],["\u003cp\u003ePotential errors, such as \u003ccode\u003eFAILED_PRECONDITION\u003c/code\u003e, may occur if the thermostat lacks fan capabilities, indicating that fan-related functionalities are unavailable for the device.\u003c/p\u003e\n"]]],["The `Fan` trait controls a device's fan. Key information includes the `timerMode` (ON/OFF) and `timerTimeout`, indicating when the mode will switch OFF. A GET request retrieves the current fan state. The `SetTimer` command, using a POST request, adjusts the `timerMode` and `duration` (optional, default 900s) within a range from 1s to 43200s. A potential `FAILED_PRECONDITION` error arises if the device lacks fan capability.\n"],null,["\u003cbr /\u003e\n\nFan Schema\n==========\n\n[Nest Thermostat](/nest/device-access/api/thermostat)\n\n`sdm.devices.traits.Fan`\n\nThis trait belongs to any device that has the system ability to control the fan.\n\n\u003cbr /\u003e\n\nFields\n------\n\n\n| Field | Description | Data Type |\n|----------------|----------------------------------------------------------------------|------------------------------------------|\n| `timerMode` | Current timer mode. | `string` Values: \"ON\", \"OFF\" |\n| `timerTimeout` | Timestamp, in RFC 3339 format, at which timer mode will turn to OFF. | `string` Example: \"2019-05-10T03:22:54Z\" |\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.Fan\" : {\n \"timerMode\" : \"ON\",\n \"timerTimeout\" : \"2019-05-10T03:22:54Z\"\n }\n }\n }\n\n\u003cbr /\u003e\n\nCommands\n--------\n\n\u003cbr /\u003e\n\n### SetTimer\n\nChange the fan timer.\n\n#### SetTimer request and response\n\n### Request\n\n POST /enterprises/project-id/devices/device-id:executeCommand\n {\n \"command\" : \"sdm.devices.commands.Fan.SetTimer\",\n \"params\" : {\n \"timerMode\" : \"ON\",\n \"duration\" : \"3600s\"\n }\n }\n\n### Response\n\n```\n{}\n```\n\n#### SetTimer request fields\n\n| Field | Description | Data Type |\n|-------------|-----------------------------------------------------------------------------------|--------------------------------------------------|\n| `timerMode` | The mode to set the fan timer. | `string` Values: \"ON\", \"OFF\" |\n| `duration` | *Optional.* Specifies the length of time in seconds that the timer is set to run. | `string` Range: \"1s\" to \"43200s\" Default: \"900s\" |\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| Thermostat fan unavailable. | `FAILED_PRECONDITION` | The thermostat does not have a fan capability. Fan-related traits and commands cannot be used for this device. |\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"]]