# Obtain Google Nest Device Access and Commercial Development

To control Nest devices using Seam, you must first create a [Google Device Access](https://developers.google.com/nest/device-access) project—including an associated OAuth client—and provide information about this project to Seam through the [Seam Console](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/seam-console). We recommend that you apply for [Google Commercial Development](https://developers.google.com/nest/device-access/project/apply) for your Nest devices.

{% hint style="info" %}
The period of time that Google takes to approve Commercial Development may range from a week to more than a month. For more information, see [Apply for Commercial Development](https://developers.google.com/nest/device-access/project/apply) on the Google Device Access site.

Further, once Google approves your Commercial Development application, you can gradually scale the number of managed devices as you proceed through the Google stages to reach [Google certification for Commercial Production](https://developers.google.com/nest/device-access/project/apply#certification_for_commercial_production).
{% endhint %}

***

## Google Developer Account and Rate Limits

Note the restrictive [account and rate limits](https://developers.google.com/nest/device-access/project/limits) in the Google Device Access Sandbox environment while testing the integration with customers.

***

## 1. Start Google Device Access Project Creation

Sign in to your Google account and start the process of creating a Google Device Access Project.

1. Open a web browser and go to the following URL:\
   <https://developers.google.com/nest/device-access>

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FQtMV51IgJRP22pkMMs0z%2Fgoogle-device-access-home-page.png?alt=media&#x26;token=1b4cd322-76a6-4428-83d7-46a60859e238" alt="Navigate to the Google Device Access website."><figcaption></figcaption></figure>
2. Click **Go to Console**.
3. Sign in to your Google account.
4. If you have not yet paid the Google Developer Registration Fee (currently, US$5) to access the Google Device Access Console, perform the following steps:

   1. Select the checkbox to agree to the Google terms of service and then click **Continue to payment**.
   2. Add a credit or debit card if you have not done so already.
   3. Click **Buy**.

   When the purchase is complete, Google displays the Device Access Console welcome page.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FroBWncVcpk704T5hyDVm%2Fgoogle-device-access-console-home-page.png?alt=media&#x26;token=d8098acd-b5ff-40cc-9ed6-b454b791dd13" alt="Google Device Access Console Welcome page"><figcaption></figcaption></figure>
5. Click **Create project**.
6. Type a name for your Nest development project and then click **Next**.

## 2. Create an OAuth Client

Use the Google Cloud console to create an OAuth 2.0 client and then download the associated client ID and secret.

1. On the **Add your OAuth client ID** page, click **Learn more**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FmNe2pYv8v3ODyzhIzrRZ%2Fgoogle-add-your-oauth-client-id-page-learn-more.png?alt=media&#x26;token=5d5cf992-b90f-4249-8e04-ce7f0574164c" alt="On the Add your OAuth client ID page, click Learn more."><figcaption></figcaption></figure>

{% hint style="warning" %}
Google displays the **Authorize an Account** page in a separate browser tab or window. Do not close the original browser window or tab containing the **Add your OAuth client ID** page.
{% endhint %}

2. On the **Authorize an Account** page, click **Google Cloud Credentials**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2F4X5NV6zwcqPTuCzvNOcR%2Fgoogle-authorize-an-account-page.png?alt=media&#x26;token=ea168cf1-b73b-40db-8251-c759a82af0f8" alt="Google Device Access Console Authorize an Account page"><figcaption></figcaption></figure>
3. In the Google Cloud welcome dialog, select your country, select the checkbox to agree to the Google terms of service, and then click **Agree and Continue**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FX5EtkdRes0Jiu6Mt8Hf5%2Fgoogle-cloud-welcome-dialog.png?alt=media&#x26;token=6c41c7e9-e036-46a1-854f-6ac949349abc" alt="Select your country, select the checkbox to agree to the Google terms of service, and then click Agree and Continue."><figcaption></figcaption></figure>
4. On the Google Cloud **Credentials** page, click **Create Project**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FuIlEq6e5IJtGNdLR27VY%2Fgoogle-cloud-credentials-page.png?alt=media&#x26;token=fb23f377-8cc1-4d86-803b-0fbd0a79ca80" alt="On the Google Cloud Credentials page, click Create Project."><figcaption></figcaption></figure>
5. In the Google Cloud **Select a resource** window, click **New Project**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FGpECiYsTZbUsJ1nbup48%2Fgoogle-cloud-select-a-resource-window.png?alt=media&#x26;token=a04d500a-9941-4a92-8d60-8e0ac5f85260" alt=""><figcaption></figcaption></figure>
6. In the Google Cloud **New Project** page, type a name for the new project, specify the organization and location, and then click **Create**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FWzcFUtThED6VFm4MmIGF%2Fgoogle-cloud-new-project-page.png?alt=media&#x26;token=94ec0b46-c73a-40f1-a533-25e596bc16ff" alt="In the Google Cloud New Project page, type a name for the new project, specify the organization and location, and then click Create."><figcaption></figcaption></figure>
7. On the Google Cloud **Create OAuth client ID** page, click **Configure Consent Screen**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FdNuJ7CZcsBm0hHjOU6Q3%2Fgoogle-cloud-create-oauth-client-id-page.png?alt=media&#x26;token=87a11a5e-c0e3-45ed-a9a1-4892e527163c" alt="On the Google Cloud Create OAuth client ID page, click Configure Consent Screen."><figcaption></figcaption></figure>
8. On the Google Cloud **OAuth consent screen** page, select the **External** user type and then click **Create**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FvAMLRp5RglzRHTTLNzsS%2Fgoogle-cloud-oauth-consent-screen-page.png?alt=media&#x26;token=1a1897bc-dfab-491c-9676-1bb26ff954a1" alt="On the Google Cloud OAuth consent screen page, select the External user type and then click Create."><figcaption></figcaption></figure>
9. On the Google Cloud **Edit app registration** page, type the **App name**, **User support email**, and **Developer Contact information** **Email addresses** and then click **Save and Continue**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FKlul7vpA38QyQnxcApO8%2Fgoogle-cloud-edit-app-registration-page.png?alt=media&#x26;token=ec156d4e-e886-4033-945f-764e2115abb1" alt="On the Google Cloud Edit app registration page, type the App name, User support email, and Developer Contact information Email addresses and then click Save and Continue."><figcaption></figcaption></figure>
10. Move to the bottom of the Google Cloud **Scopes** page and click **Save and Continue**.
11. On the Google Cloud **Test Users** page, click **Add Users**, add the Google account associated with a Nest thermostat as a test user, and then click **Save and Continue**.\
    It is important to remember that the initial Google Device Access Sandbox environment includes [account and rate limits](https://developers.google.com/nest/device-access/project/limits). Consequently, we recommend that you [apply for Google Commercial Development](#5.-apply-for-google-commercial-development) as part of this procedure. In addition, before you obtain Google Commercial Development, you an only use the Seam API to control devices associated directly with the test user accounts that you specify on the **Test Users** page. For more information, see [Brand-Specific Errors](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/device-and-system-integration-guides/google-nest-thermostats/..#brand-specific-errors).

    <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FTTxchXy4tL2uWJWHFwrO%2Fgoogle-cloud-test-users-page.png?alt=media&#x26;token=9ae31c65-3da9-4eda-8a0c-80d08b221cd8" alt="On the Google Cloud Test Users page, click Add Users, add the Google account associated with a Nest thermostat as a test user, and then click Save and Continue."><figcaption></figcaption></figure>
12. In the left navigation pane of the Google Cloud **Summary** page, click **Credentials**.

    <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FthqA4b1jGEPjESq6XjEe%2Fgoogle-cloud-summary-page.png?alt=media&#x26;token=1fbe4297-50ac-41dd-93e6-8bb65e41b190" alt="In the left navigation pane of the Google Cloud Summary page, click Credentials."><figcaption></figcaption></figure>
13. On the Google Cloud **Credentials** page, click **Create Credentials** > **OAuth client ID**.

    <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FCZTJ0nJNWPUdTWIJEYEJ%2Fgoogle-cloud-create-credentials-menu.png?alt=media&#x26;token=cb4a8b57-853d-4503-9fef-10a9f64293fe" alt="On the Google Cloud Credentials page, click Create Credentials > OAuth client ID."><figcaption></figcaption></figure>
14. On the Google Cloud **Create OAuth client ID** page, specify the following information:
    1. In the **Application type** field, select **Web application**.<br>

       <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2F8VCa4q6a7qJ4XHtw1Ver%2Fgoogle-cloud-credentials-application-type-field.png?alt=media&#x26;token=72dbc3aa-2566-406b-ba3b-27ada7890849" alt="On the Google Cloud Create OAuth client ID page, select Web application."><figcaption></figcaption></figure>
    2. Type a name for the OAuth 2.0 client.
    3. In the **Authorized redirect URIs** area, click **Add URI** and then choose one of the following two options:
       * **Option 1 (easy):** Add the following URI to redirect to Seam:\
         [`https://connect.getseam.com/internal/nest/complete_oauth`](https://connect.getseam.com/internal/nest/complete_oauth)
       * **Option 2 (recommended):** Create a CNAME record in your DNS settings (for example, `nestoauth.mydomain.com`) and redirect it to the following URI:

         [`https://connect.getseam.com/internal/nest/complete_oauth`](https://connect.getseam.com/internal/nest/complete_oauth)\
         Setting up a CNAME ensures that the Google OAuth screen displays "continue to \[mydomain.com]" instead of "continue to getseam.com."

         <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FOex77hOUHNA2D29P6i3h%2Fnest-oauth-redirect-uri-setup.png?alt=media&#x26;token=f20e8b4a-31ee-413a-b9fe-1ec14370355a" alt="Setting up a CNAME ensures that the Google OAuth screen displays &#x22;continue to [mydomain.com]&#x22; instead of &#x22;continue to getseam.com.&#x22;"><figcaption></figcaption></figure>
15. At the bottom of the Google Cloud **Create OAuth client ID** page, click **Create**.\
    The OAuth client created dialog displays the client ID and secret for the newly-created OAuth client.
16. In the **OAuth client created** dialog, click **Download JSON** and then click **OK**.

    <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FJTDEu87ZqjJ3Smw9c7ti%2Fgoogle-cloud-oauth-client-created-dialog.png?alt=media&#x26;token=a2ac9d53-3837-446e-821c-bee6be8b7964" alt="In the OAuth client created dialog, click Download JSON and then click OK."><figcaption></figcaption></figure>
17. In the **OAuth 2.0 Client IDs** area on the Google Cloud **Credentials** page, click the copy button in the row that represents the client ID that you created.

    <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FamgU1nYyED9dnlgUg0oo%2Fgoogle-cloud-oauth-2.0-client-ids-table.png?alt=media&#x26;token=7bdf5f27-05ae-4f83-8631-3253cb855928" alt="In the OAuth 2.0 Client IDs area on the Google Cloud Credentials page, click the copy button in the row that represents the client ID that you created."><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure to keep this copied OAuth client ID in the clipboard. You must paste this ID into a field later in this procedure.
{% endhint %}

## 3. Enable the Google Smart Device Management API

To control Nest devices with the Seam API, you must enable the Google Smart Device Management API.

1. In the left navigation pane of the **Google Credentials** page, click **Enabled APIs & services** and then click **Enable APIs and Services**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FHkJbFSLkiAAYTWyRtNJ4%2Fgoogle-cloud-enable-apis-and-services-link.png?alt=media&#x26;token=1e506e16-e5bd-4fa3-9e40-33c78f5be958" alt="In the left navigation pane of the Google Credentials page, click Enabled APIs &#x26; services and then click Enable APIs and Services."><figcaption></figcaption></figure>
2. In the search box on the Google Cloud **API Library** welcome page, type `Smart Device Management API` and then press **Enter**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2F7ETiN0NKCDDESs3fwlv7%2Fgoogle-cloud-api-library-welcome-page.png?alt=media&#x26;token=bad10d5e-7427-44cf-82a2-7d0cfab8708b" alt="In the search box on the Google Cloud API Library welcome page, type Smart Device Management API and then press Enter."><figcaption></figcaption></figure>
3. In the search results, click **Smart Device Management API**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FG7WlhiWa8LbIFU6n4bwj%2Fgoogle-cloud-api-library-smart-device-management-api-search-results.png?alt=media&#x26;token=e7365120-6b68-4237-86ce-8c2e1f6f6add" alt="In the search results, click Smart Device Management API."><figcaption></figcaption></figure>
4. On the **Product details** page for the Smart Device Management API, click **Enable**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FTTSq6r1pcjTlouzLRJDQ%2Fgoogle-smart-device-management-api-enable-button.png?alt=media&#x26;token=d2dbb701-f8f9-4f66-94d4-db1ca4abfddb" alt="On the Product details page for the Smart Device Management API, click Enable."><figcaption></figcaption></figure>

## 4. Complete Google Device Access Project Creation

Add the ID of the OAuth client that you created to the Google Device Access project that you are creating and then complete the project creation.

1. Return to the browser tab or window that contains the **Add your OAuth client ID** page from the beginning of this procedure.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FgfaOjXdT27LNV99noHBB%2Fgoogle-add-your-oauth-client-id-page.png?alt=media&#x26;token=733e1d8f-7393-4a32-bc9b-dd890c805d15" alt="Return to the browser tab or window that contains the Add your OAuth client ID page."><figcaption></figcaption></figure>
2. In the **Enter your OAuth client ID** field, paste the copied OAuth client ID and then click **Next**.
3. On the **Events** page, click **Enable** and then click **Create project**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2Fj8AZPUN5pQ4TiJfVgwGQ%2Fgoogle-create-a-project-events-page.png?alt=media&#x26;token=08a71e42-a01f-48f7-a0ec-ed5da6fdc17f" alt="On the Events page, click Enable and then click Create project."><figcaption></figcaption></figure>

## 5. Apply for Google Commercial Development

We recommend that you apply for [Google Commercial Development](https://developers.google.com/nest/device-access/project/apply), which enables you to control more devices. Before Google approves your Commercial Development application, you are subject to [account and rate limits](https://developers.google.com/nest/device-access/project/limits). Then, once Google approves your Commercial Development application, you can gradually scale the number of managed devices as you proceed through the Google stages to reach [Google certification for Commercial Production](https://developers.google.com/nest/device-access/project/apply#certification_for_commercial_production).

{% hint style="info" %}
Once you have applied for Google Commercial Development, Google reviews your application. The period of time that Google takes to approve Commercial Development may range from a week to more than a month.&#x20;

It is imperative to be aware of this delay before testing your commercial application.

However, we can help you test the settings and configuration of the original test device that you added to your account at the beginning of this procedure.
{% endhint %}

1. On the Google project information page for your new project, click **Apply for commercial development**.

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2F24fBUCd57eFN2kaHURNI%2Fgoogle-device-access-console-project-info-page.png?alt=media&#x26;token=feecc8ab-6f15-4b61-bc88-df2a047476ba" alt="On the Google project information page for your new project, click Apply for commercial development."><figcaption></figcaption></figure>
2. On the **Applying for Commercial Development** page, click **Next**.
3. On the **Google Non-Disclosure Agreement** page, type the following information:

   * **Company Name**
   * **Developer Name**
   * **Developer Corporate Email Address**
   * **Name of Company Authorized Representative**

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FtTp0MvpS3VfjoAocXh1v%2Fgoogle-non-disclosure-agreement-page.png?alt=media&#x26;token=be3789fb-fc9d-4cbd-9766-3175ccab9e51" alt="Complete the Google Non-Disclosure Agreement."><figcaption></figcaption></figure>
4. Select the checkbox to agree to the Google Non-Disclosure Agreement and then click **Next**.
5. In the Google Commercial Development application, specify the requested information and then click **Apply**.<br>

   <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FGmG13gVrcQKI8mCZp2Fs%2Fgoogle-commercial-development-application.png?alt=media&#x26;token=1f11d066-b458-470d-8f1b-958569e55e51" alt="Complete the Google Commercial Development application."><figcaption></figcaption></figure>

## 6.  Provide Your Project Information to Seam through the Seam Console

In the [Seam Console](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/seam-console), add your Google Device Access project information. It is not necessary to wait for Google Commercial Development approval before adding this information in the Seam Console.

{% hint style="info" %}
You must be the owner of your Seam [workspace](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/workspaces) to perform this procedure.
{% endhint %}

1. Locate and note the following information:
   * Google Device Access project ID\
     Find this information on the project information page for your Google Device Access project.<br>

     <figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2FCg3FDLV9JtBDr31NU8rM%2Fgoogle-device-access-project-info.png?alt=media&#x26;token=b6d310b7-e532-4c0e-9cf2-57e9dc44794d" alt=""><figcaption></figcaption></figure>
   * OAuth client ID and secret\
     Find this information in the JSON file that you downloaded when creating the OAuth client earlier in this procedure.
2. In a web browser, go to <https://console.seam.co>.
3. [Log in to the Seam Console](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/seam-console#log-in-to-the-seam-console-using-an-email-address).
4. In upper-right corner of the Seam Console, click your username and then select **Workspace Settings**.
5. On the **Workspace Settings** page, next to **Nest Developer Settings**, click **Edit**.
6. In the **Nest Developer Settings** dialog, type or paste your project ID, Client ID, and Client secret.&#x20;

<figure><img src="https://2727122207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxnN2A67918om1UthYWsF%2Fuploads%2Fclw0mZnBnQN0GKvLke3e%2Fnest-developer-settings.png?alt=media&#x26;token=6c55ab91-fb5a-4fde-8517-df6d508e9a5d" alt="Specify your Google Nest developer settings." width="375"><figcaption></figcaption></figure>

6. Click **Save**.
