Smart home intents are simple messaging objects that describe
what Cloud-to-cloud integration 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
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](https://developers.home.google.com/cloud-to-cloud/primer/intents.md.txt#sync)
- [QUERY](https://developers.home.google.com/cloud-to-cloud/primer/intents.md.txt#query)
- [EXECUTE](https://developers.home.google.com/cloud-to-cloud/primer/intents.md.txt#execute)
- [DISCONNECT](https://developers.home.google.com/cloud-to-cloud/primer/intents.md.txt#disconnect)

## 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 (GHA), they also
get authenticated to your cloud infrastructure. Then,
Assistant receives an OAuth2 token. At this point,
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.](https://developers.home.google.com/static/cloud-to-cloud/primer/images/smarthome001.png) Figure 1: Interaction between Google and Partner infrastructure

To avoid unlinking and relinking a user's account, you can send a request sync
to Assistant. This sends the `action.devices.SYNC` intent
to your fulfillment to sync the list of devices and capabilities. See
[Implement Request Sync](https://developers.home.google.com/cloud-to-cloud/integration/request-sync.md.txt) for more
information.
![Flow diagram of a SYNC intent](https://developers.home.google.com/static/cloud-to-cloud/primer/images/smarthome002.png) Figure 2: SYNC intent

During [local fulfillment](https://developers.home.google.com/local-home/overview.md.txt) 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 fulfillment, see
[Update SYNC response in cloud fulfillment](https://developers.home.google.com/local-home/device-discovery.md.txt#update_sync_response_in_the_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?* ,
Assistant sends a `action.devices.QUERY` intent to your
fulfillment.
![Flow diagram of a QUERY intent](https://developers.home.google.com/static/cloud-to-cloud/primer/images/query-diagram.png) Figure 3: QUERY intent

For the best user experience, you should implement
[Report State](https://developers.home.google.com/cloud-to-cloud/integration/report-state.md.txt) to proactively report
the current state of a user's devices directly to
Google Home Graph. For example, this lets
Assistant know if your user turned on a smart light with a
physical light switch.
![Reporting device state using Report State](https://developers.home.google.com/static/cloud-to-cloud/primer/images/smarthome004.png) Figure 4: Report device state

## EXECUTE

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

When users send commands to devices with 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*.
![Flow diagram of an EXECUTE intent](https://developers.home.google.com/static/cloud-to-cloud/primer/images/smarthome003.png) Figure 5: EXECUTE intent

## DISCONNECT

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