风扇架构

Nest Thermostat 

sdm.devices.traits.Fan

此特征属于系统能够控制风扇的任何设备。

字段

字段 说明 数据类型
timerMode 当前的计时器模式。 string
值:“开启”“关闭”
timerTimeout 采用 RFC 3339 格式的时间戳,达到此格式时,计时器模式会关闭。 string
示例:“2019-05-10T03:22:54Z”

示例 GET 请求和响应

请求

GET /enterprises/project-id/devices/device-id

响应

{
  "name" : "enterprises/project-id/devices/device-id",
  "traits" : {
    "sdm.devices.traits.Fan" : {
      "timerMode" : "ON",
      "timerTimeout" : "2019-05-10T03:22:54Z"
    }
  }
}

命令

SetTimer

更改风扇计时器。

SetTimer 请求和响应

请求

POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "sdm.devices.commands.Fan.SetTimer",
  "params" : {
    "timerMode" : "ON",
    "duration" : "3600s"
  }
}

响应

{}

SetTimer 请求字段

字段 说明 数据类型
timerMode 用于设置风扇计时器的模式。 string
值:“开启”“关闭”
duration 可选。指定计时器设置的运行时长(以秒为单位)。 string
范围:“1s”到“43200s”
默认值:“900s”

错误数

可能会返回与此 trait 相关的以下错误代码:

错误消息 RPC 问题排查
温控器风扇不可用。 FAILED_PRECONDITION 温控器没有风扇功能无法使用与风扇相关的特征和命令。

如需查看 API 错误代码的完整列表,请参阅 API 错误代码参考