當你與 Google Assistant such as "Hey Google, turn on the bedroom light", Hey Google is the invocation and turn on the bedroom light is known as the grammar. Google determines the smart home intent from the grammar and sends it over to the developer cloud (fulfillment). The developer can then execute the command on the device and returns a response back to Google. 進行對話時
執行要求處理意圖並傳回回應後,smart home 動作會依賴 Google Home Graph . With Home Graph, Assistant can sync devices, query device states, and execute commands on a device.
裝置類型
裝置類型可讓 Assistant 瞭解您的裝置應使用文法。舉例來說,如果您將裝置定義為淺色,使用者就可以透過 Assistant 透過 Hey Google,開燈與裝置互動。
如需支援裝置類型的完整清單,請參閱裝置類型一文。
裝置特徵
裝置特徵會定義裝置類型的功能。您可以將多個裝置特徵結合於任何裝置類型。例如,您可以讓 Light 裝置使用 OnOff、Brightness 和 FanSpeed 特性。雖然 FanSpeed 特性可能不是最常用的光照特性,但您可以使用任何新裝置的特性。
當您在裝置裝置類型中新增裝置特性時,裝置會沿用您新增的每個裝置特性的狀態。舉例來說,當您使用 OnOff 時,裝置現在可以將 on
狀態回報為 true
或 false
。
如需支援特性的完整清單,請參閱 Device Traits。