风扇架构

Nest Thermostat 

sdm.devices.traits.Fan

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

字段

字段 说明 数据类型
timerMode 当前计时器模式。 string
值:“ON”“OFF”
timerTimeout 计时器模式将变为“OFF”的时间戳,采用 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
值:“ON”“OFF”
duration 可选。 指定计时器设置为运行的时间长度(以秒为单位)。 string
范围:“1s”到“43200s”
默认值:“900s”

错误

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

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

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