Smart home intents

Smart home intents are simple messaging objects that describe what smart home Action to perform such as turn on a light or cast audio to a speaker.

All of the smart home intents are contained in the action.devices namespace and you must provide fulfillment for them. Whenever the Google Assistant sends an intent to fulfillment, a user's third-party OAuth 2 access token is passed in the Authorization header.

These are the supported smart home intents:

SYNC

The action.devices.SYNC intent is used to request the list of smart home devices that the user has connected and are available for use.

When a user sets up their devices with the Google Home app, they also get authenticated to your cloud infrastructure. Then, the Assistant receives an OAuth2 token. At this point, the Google Assistant sends a action.devices.SYNC intent to your fulfillment to retrieve the initial list of user devices and capabilities from your cloud infrastructure.

This figure shows the interaction between the Google infrastructure
    and the partner infrastructure. From the Google infrastructure there is a
    list of partners that is available to the Assistant client app, which then
    flows to the partner infrastructure to complete OAuth authentication. The OAuth
    authentication on the partner side is the partner setup webview, OAuth webview,
    optional settings ands terms, and partner cloud services. The partner infrastructure,
    then returns the OAuth credentials to the Assistant client app. The partner
    cloud services sends available devices and capabilities to Assistant services,
    which then stores the information in the Home Graph.
Figure 1

To avoid unlinking and relinking a user’s account, you can send a request sync to the Google Assistant. This sends the action.devices.SYNC intent to your fulfillment to sync the list of devices and capabilities. See Implement Request Sync for more information.

Figure 2

During local execution setup, the Local Home platform checks the SYNC response from your smart home Action’s cloud fulfillment. To learn more about how to modify your SYNC response to support local execution, see Update SYNC response in cloud fulfillment.

QUERY

The action.devices.QUERY intent is used to query the current state of smart home devices.

When users are querying device status, to answer a question such as Hey Google, what lights are on in the kitchen?, the Google Assistant sends a action.devices.QUERY intent to your fulfillment.

Figure 3

For the best user experience, you should implement Report State to proactively report the current state of a user’s devices directly to Home Graph. For example, this lets the Google Assistant know if your user turned on a smart light with a physical light switch.

Figure 4

EXECUTE

The action.devices.EXECUTE intent is used to provide commands to execute on smart home devices.

When users send commands to devices with the Google Assistant, your fulfillment receives a action.devices.EXECUTE intent to your fulfilment that describes the action and the devices to act upon. A user can execute an action on a device with a command such as Hey Google, turn on my living room lights .

Figure 5

DISCONNECT

The action.devices.DISCONNECT intent is triggered to inform you when a user has unlinked the app account from the Google Assistant. After receiving a action.devices.DISCONNECT intent, you should not report state for this user's devices.