Jay Taylor's notes

back to listing index

Using Home Assistant SDM Nest Integration – Maartendamen.com

[web search]
Original source (maartendamen.com)
Tags: Google tutorial homeassistant hassio nest gcp home-automation smart-device-management-api google-nest-sdm maartendamen.com
Clipped on: 2021-09-15

Skip to content
Image (Asset 1/24) alt=
Image (Asset 2/24) alt=
Image (Asset 3/24) alt=
Image (Asset 4/24) alt=
Important note: do this with the account that has access to your Nest devices.
  • Once you have paid, you should have the Google Device Access console visible. Click on Create project.

    Image (Asset 5/24) alt=
    Image (Asset 6/24) alt=
  • Google will ask you for an OAuth client ID, I recommend that you create this first before continuing. To create an OAuth client id follow the next steps. Or skip now and create an OAuth client ID later.
  • To create an OAuth client ID first visit the Google Developer console (open this in a new tab)
  • From the Google Developer Console click on Credentials and click on CREATE CREDENTIALS

    Image (Asset 7/24) alt=
    Image (Asset 8/24) alt=
  • Pick a name for your credential, and make sure you set the Redirect URL. This redirect URL needs to be externally accessible. I recommend that you use Nabu Casa (Home Assistant Cloud) for this. Your URL should be in the following format:

    https://<some id>.ui.nabu.casa/auth/external/callback

    Image (Asset 9/24) alt=You can also use your own URL, as long as it is reachable from the outside.
  • You should now be presented with an OAuth client created message. Take note of the OAuth Client ID and OAuth Client Secret. We need both later for our configuration.

    Image (Asset 10/24) alt=
    Image (Asset 11/24) alt=Click Next.
  • Next make sure you enable Events, by click on Enable.

    Image (Asset 12/24) alt=OAtuh Client ID
    OAuth Client Secret

    These are three of the four configuration parameters that are required for the new Nest Integration. Next up we need to create a Pub/Sub subscriber to follow the SDM API Event. Follow the steps for this in the next paragraph.

    Create a Pub/Sub subcriber for SDM

    We already enabled Events previously. Now we need to enable the Pub/Sub API and create a Pub/Sub subscription. To do this follow the steps below:

    1. Enable the Cloud Pub/Sub API using this link. This is easy just click on Enable.
    2. From the Google Cloud Platform console we are going to create a Pub/Sub subscription. Here is a direct link.
    3. Now within the Google Cloud Platform console, click on CREATE SUBSCRIPTION.
    4. Enter the following settings:
      – Subscription ID: I used the same name as my project.
      – Subscription topic: select enter manually and enter the topic from the Device Access Registration console. You can get the topic by going into the project and copy the Pub/Sub topic. As shown below.

      Image (Asset 13/24) alt=
      – Select Pull as a subscription type.
      – Leave the rest default and click on CREATE.

      Image (Asset 14/24) alt=
      Image (Asset 15/24) alt=
      Image (Asset 16/24) alt=
      It is ok if you see that the integration is not tested and approved by Google. Click on Next.
    5. Next you will see two more screens asking for permission. Allow those permissions.

      Image (Asset 17/24) alt=Image (Asset 18/24) alt=
      Image (Asset 19/24) alt=Image (Asset 20/24) alt=
      Image (Asset 21/24) alt=
      aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://smartdevicemanageme…[my project_id]/structures')

      You need to follow a few steps to fix this:

      1. Go the Google API management page.
      2. Click on Enable API and services

        Image (Asset 22/24) alt=
        Image (Asset 23/24) alt=
        This is what the unacked message count should look like. If you see a high number here, please go through the steps once again.

        Image (Asset 24/24) alt=
         
  • Hi, I am Maarten and I am the owner of this weblog. I post on various IT subjects that matter in my life as an IT professional.

    Recent Posts

    link to Microsoft 365 Defender cross check with on-premises Active Directory

    Recently I was reviewing the new Microsoft 365 Defender portal and I noticed that a few endpoints were missing from the device inventory. This got me thinking that it would be great if I could...

    link to Is Home Assistant Cloud (Nabu Casa) worth it?

    You have probably been using Home Assistant for quite a while, but lately you have wondered how to enable remote access to your Home Assistant installation. This is a very common question and one way...

    About

    Hi, I am Maarten and I am the owner of this weblog. I post on various IT subjects that matter in my life as an IT professional.

    Subscribe

    Stay current with the latest news about Home Automation and other topics.
    Subscribe to my mailing list and get notified when I publish a new article.
    I promise you I will not flood you with mail, and I will not ever send spam.

    Email Address*

    Name

    © 2021 Copyright Maartendamen.com