智能家居 ObjectDetection 特征架构

action.devices.traits.ObjectDetection - 此特征属于可以检测物体或人并向用户发送通知的设备。默认情况下,在门铃响铃后,内置 Google 助理的智能显示屏和智能音箱会播报所有 ObjectDetection 通知。

设备属性

无。

设备状态

无。

设备命令

无。

设备通知

具有此特征的设备可能会在设备状态发生变化时返回以下通知载荷。如需详细了解如何实现通知,请参阅智能家居 Action 的通知

字段 类型 说明
ObjectDetection 对象

必填。

通知负载。

priority 整数

必填。

表示通知级别。目前支持的值为 0,表示应大声读出通知。

detectionTimestamp 整数

必填。

检测到对象的周期时间戳(以毫秒为单位)。

objects 对象

必填。

按类别检测到的对象的集合。

named 数组

由用户识别并标有标签的对象列表。

[item, ...] String

对象标签。

至少需要 1 项。

familiar 整数

用户可识别的不带标签的对象数。

unfamiliar 整数

设备检测到的用户可能无法识别的对象数量。

unclassified 整数

检测到设备无法分类的对象数。

示例

2000 年 1 月 1 日检测到两个未知物体。

{
  "ObjectDetection": {
    "objects": {
      "unclassified": 2
    },
    "priority": 0,
    "detectionTimestamp": 946684800000
  }
}

2000 年 1 月 1 日检测到您认识的人。

{
  "ObjectDetection": {
    "objects": {
      "familiar": 1
    },
    "priority": 0,
    "detectionTimestamp": 946684800000
  }
}

2000 年 1 月 1 日检测到 Alice。

{
  "ObjectDetection": {
    "objects": {
      "named": [
        "Alice"
      ]
    },
    "priority": 0,
    "detectionTimestamp": 946684800000
  }
}

设备出错

查看错误和异常的完整列表。