粉丝架构

Nest Thermostat 

sdm.devices.traits.Fan

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

字段

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

错误

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

错误消息 RPC 问题排查
温控器风扇不可用。 FAILED_PRECONDITION 温控器不具备风扇功能。此设备无法使用粉丝相关特征和指令。

请参阅 API 错误代码参考,了解 API 错误代码的完整列表。