智能家居 Action 依赖于Google Home Graph, a database that stores and provides contextual data about the home and its devices. The Home Graph database stores information about structures (for example, home or office), rooms (for example, bedroom or living room), and devices (for example, speaker and light bulb). For example, Home Graph can store the concept of a home with a living room that contains multiple types of devices from different manufacturers such as a light, television, and speaker. This information is available to Google Assistant in order to execute user requests based on the appropriate context. State data, such as if a light bulb is on, is not stored in the long term - it’s ephemeral and is only used in the Home Graph.
Home Graph 基本上就是住宅的逻辑图。它可让您与 Assistant 进行自然对话。 如果你坐在小书房里,想要关闭小书房里的灯,你只需说“Ok Google,把灯关了”就行了,而不用说明当前所在的房间。
Home Graph 的优势:
- 隐式命令。您(Google Home device, and your lights are in the same room. All you have to say is turn on the lights. You do not need to specify what room the lights are in.)
- 更好地控制显式定位。你可以从另一个房间关闭厨房内来自多家制造商的灯。smart home intent is determined for a particular room that is identified in Home Graph.
结构
Google Home app (GHA) lets a user configure multiple structures which allows a user to manage multiple houses. Each structure has its own set of rooms and devices. A structure consists of the following:
- 管理员 - 结构所有者的帐号。每个结构必须至少有一名管理员。定义管理员后,就可以与其他用户共享和停止共享结构。
- 房间 - 属于结构构成部分的房间。
- 标签 - 标识结构的标签,如“约翰的住宅”。
- 设备 - 属于结构构成部分的设备。这些设备可能来自多个制造商。
图 1 显示了一个拥有住宅、三个房间和多部设备的住宅示例:

Rooms
房间属于结构的一部分,由以下部分构成:
- 标签 - 标识房间的标签,例如“主卧室”。
- 设备 - 属于房间组成部分的设备。这些设备可能来自多个制造商。
设备
一台设备必须属于至少一个结构,最多可属于 1 个房间,并且具有以下属性:
- 类型 - 设备的类型,例如灯具、摄像头或空调设备。
- 特征 - 设备支持的特征类型。每种设备都可以具有多个特征。灯可能具有
Brightness
和ColorSetting
等特征。
特征
特征具有以下属性:
- 属性 - 设备静态不变的设备属性。属性可以是温度单位或模式。
- 状态 - 设备的状态。灯可能会返回一个亮度状态,以指示特定灯的当前亮度。每个设备特征都会为设备添加不同的设备状态。
- 标签 - 用于标识设备的标签,如“卧室灯”。