Fan Schema
sdm.devices.traits.Fan
This trait belongs to any device that has the system ability to control the fan.
Fields
Field | Description | Data Type |
---|---|---|
timerMode |
Current timer mode. | string Values: "ON", "OFF" |
timerTimeout |
Timestamp, in RFC 3339 format, at which timer mode will turn to OFF. | string Example: "2019-05-10T03:22:54Z" |
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"
}
}
Response
{}
SetTimer request fields
Field | Description | Data Type |
---|---|---|
timerMode |
The mode to set the fan timer. | string Values: "ON", "OFF" |
duration |
Optional. Specifies the length of time in seconds that the timer is set to run. | string Range: "1s" to "43200s" Default: "900s" |
Errors
The following error code(s) may be returned in relation to this trait:
Error Message | RPC | Troubleshooting |
---|---|---|
Thermostat fan unavailable. | FAILED_PRECONDITION |
The thermostat does not have a fan capability. Fan-related traits and commands cannot be used for this device. |
See the API Error Code Reference for the full list of API error codes.