Nest


The nest integration allows you to integrate your Google Nest devices in Home Assistant. This integration uses the Smart Device Management API and Google’s Cloud Pubsub to efficiently listen for changes in device state or other events. See Supported Devices for all devices supported by the SDM API.

There is currently support for the following device types within Home Assistant:

Cameras and Doorbells use Automation and Device Triggers for events and a Media Source for capturing media images on supported devices. Other device types like Smoke and CO Alarms or Security systems are not currently supported by the SDM API.

You are in control of the information and capabilities exposed to Home Assistant. You can authorize a single device, multiple devices, or different levels of functionality such as motion events, live streams, for any particular device. The integration is flexible enough to adapt based on what you allow.

The Nest Smart Device Management (SDM) API requires a US$5 fee.

Video Walkthrough

Device Access Registration

For the first phase, you will turn on the API and create the necessary credentials to have Home Assistant talk to the Nest API.

Create and configure Cloud Project [Cloud Console]
Configure OAuth Consent screen [Cloud Console]
Configure OAuth client_id and client_secret [Cloud Console]
Create a Device Access project_id [Device Access Console]

Configuration

You now should have everything needed to configure Nest in Home Assistant. Edit your configuration.yaml file and populate a nest entry in the format of the example configuration below.

# Example configuration.yaml entry
nest:
  client_id: CLIENT_ID
  client_secret: CLIENT_SECRET
  # "Project ID" in the Device Access Console (not Cloud Project ID!)
  project_id: PROJECT_ID

Then make sure to restart Home Assistant under Server Controls.

Configuration Variables

client_id string Required

Your Device Access or Nest developer client ID.

client_secret string Required

Your Device Access or Nest developer client secret.

project_id string (Optional)

Your Device Access Project ID. This enables the SDM API.

subscriber_id string (Optional)

Recommended to leave blank, and let the integration manage this for you. If you want to use your subscription, enter the full path for the Pub/sub Subscription name.

Device Setup

Once configuration.yaml has a valid nest entry, you need to add Nest to your Home Assistant instance via the user interface by using this My button:

Manual configuration steps

The Nest integration setup will walk you through the steps of authorizing your Home Assistant to access your account and Nest devices.

OAuth and Device Authorization steps

Climate

All Google Nest Thermostat models are exposed as a climate entity that use the Thermostat Traits in the SDM API. State changes to the thermostat are reported to Home Assistant through the Cloud Pubsub subscriber.

Given a thermostat named Upstairs then the climate entity is created with a name such as climate.upstairs

This feature is enabled by the following permissions:

  • Allow Home Assistant to access and control your thermostat

Sensor

All Google Nest Thermostat models have traits exposed from the SDM API. The initial values of the sensors are fetched on startup, then updated regularly using the Cloud Pubsub subscriber. The following traits are supported with sensors:

Given a thermostat named Upstairs then sensors are created with names such as sensor.upstairs_temperature or sensor.upstairs_humidity.

This feature is enabled by the following permissions:

  • Allow Home Assistant to access and control your thermostat
Additional Nest Temperature Sensors are not supported by the SDM API.

Camera

Home Assistant supports all SDM API features. However, every Camera or Doorbell device has a different set of built-in capabilities. A Camera device has one of the following live stream types:

  • RTSP: These devices have an HLS stream served by the Home Assistant Core. These cameras support server-side camera services like stream recording or image preview. See Low Latency HLS as a great option to enable to reduce stream latency.
  • WebRTC: These devices support direct browser to camera communication and a super low latency stream. A Picture Glance Card can show the live stream in the grid with the Camera View set to live (not recommended for battery-powered cameras). camera services like stream recording are not supported.

This feature is enabled by the following permissions:

  • Allow Home Assistant to see and display your camera’s livestream
  • Other permissions in the Nest or Google Home apps.

All cameras have motion and person triggers, however only some support capturing snapshots for events. The table below summarizes the Supported SDM API features for each device.

Device Live Stream Triggers / Events Media Source
for Triggers / Events
Nest Cam (indoor, wired)
Nest Cam (outdoor, battery)
WebRTC Motion
Person
N/A
Nest Cam Indoor
Nest Cam IQ Indoor
Nest Cam IQ Outdoor
Nest Cam Outdoor
RTSP
Recording
Motion
Person
Sound
Snapshot (jpg)
Nest Cam with floodlight WebRTC Motion
Person
N/A
Nest Doorbell (battery) WebRTC Motion
Person
Chime
Clip Preview (mp4)
Nest Doorbell (wired) RTSP
Recording
Motion
Person
Sound
Chime
Snapshot (jpg)
Nest Hub Max RTSP
Recording
Motion
Person
Sound
* SDM API known issue
Snapshot (jpg)

Given a camera named Front Yard then the camera is created with a name such as camera.front_yard.

Automation and Device Triggers

The Nest integration makes device triggers available to enable automation in Home Assistant. You should review the Automating Home Assistant getting started guide on automations or the Automation documentation for full details.

Screenshot Device Triggers

This feature is enabled by the following permissions:

  • Allow Home Assistant to know when there’s a camera event
  • Allow Home Assistant to know when there’s a doorbell event
  • Other permissions in the Nest or Google Home apps.

Example

This automation will trigger when a nest_event event type with a type of camera_motion is received from the specified device_id.

alias: "motion alert"
trigger:
  - platform: event
    event_type: nest_event
    event_data:
      device_id: YOUR_DEVICE_ID
      type: camera_motion
action:
  - service: notify.mobile_app_pixel_2
    data:
      title: motion detected
      message: front door motion detected
      data:
        image: /api/camera_proxy/camera.front_door

The action in this section uses the Android Companion App and the camera proxy to send a notification with a snapshot from the camera.

Media Source

The Nest Media Source platform allows you to browse clips for recent camera events. Home Assistant is not intended to be a Network Video Recorder (NVR) platform, however, basic support for capturing recent events is supported.

The table above describes which devices support event image snapshots or 10-frame mp4 video clips for recent events.

This feature is enabled by the following permissions:

  • Based on the events you’ve selected to share from this device, allow Home Assistant to access camera video clips
  • Based on the events you’ve selected to share from this device, allow Home Assistant to access camera snapshots
  • Other permissions in the Nest or Google Home apps.

Troubleshooting

  • You can manage devices and permissions granted to Home Assistant in the Nest Partner Connections Manager. Restart Home Assistant to make new devices available. See the SDM API Troubleshooting documentation for more details.

  • For general trouble with the SDM API OAuth authorization flow with Google, see Troubleshooting.

  • Check Configuration then Logs to see if there are any error messages or misconfigurations then see the error messages below.

  • Reauthentication required often: If you are getting logged out every 7 days, this means an OAuth Consent Screen misconfiugration or your authentication token was revoked by Google for some other reason.

Details about reauthentication issues
  • Error 400: redirect_uri_mismatch: This means you have an existing Web Application credential. It is recommended to delete the existing OAuth Client id and create a new Desktop App credential using the instructions above. This has the advantage of not requiring SSL or a public DNS name.

  • Thermostat does not appear or is unavailable happens due to a bug where the SDM API does return the devices. A common fix get the API to work again is to:

How to restart thermostat
  • No devices or entities are created if the SDM API is not returning any devices for the authorized account. Double-check that GCP is configured correctly to Enable the API and authorize at least one device in the OAuth setup flow. If you have trouble here, then you may want to walk through the Google instructions and issue commands directly against the API until you successfully get back the devices.

  • Error 403: access_denied means that you need to visit the OAuth Consent Screen and add your Google Account as a Test User.

  • Error: invalid_client no application name means the OAuth Consent Screen has not been fully configured for the project. Enter the required fields (App Name, Support Email, Developer Email) and leave everything else as default.

  • Subscriber error means that configuration.yaml has an incorrect subscriber_id or the subscription is misconfiugred. It is recommended to delete this from the configuration, then delete and re-add the integration to let it create a subscription for you.

  • Not receiving updates typically means a problem with the subscriber configuration. Make sure to check the logs for any error messages. Changes for things like sensors or thermostat temperature set points should be instantly published to a topic and received by the Home Assistant subscriber when everything is configured correctly.

  • You can see stats about your subscriber in the Cloud Console which includes counts of messages published by your devices, and how many have been acknowledged by your Home Assistant subscriber. You can also View Messages to see examples of published. Many old unacknowledged messages indicate the subscriber is not receiving the messages and working properly or not connected at all.

  • To aid in diagnosing subscriber problems or camera stream issues it may help to turn up verbose logging by adding some or all of these to your configuration.yaml depending on where you are having trouble:


logger:
  default: info
  logs:
    homeassistant.components.nest: debug
    homeassistant.components.nest.climate_sdm: debug
    homeassistant.components.nest.camera_sdm: debug
    homeassistant.components.nest.sensor_sdm: debug
    homeassistant.helpers.config_entry_flow: debug
    homeassistant.helpers.config_entry_oauth2_flow: debug
    google_nest_sdm: debug
    google_nest_sdm.device: debug
    google_nest_sdm.device_manager: debug
    google_nest_sdm.google_nest_subscriber: debug
    google_nest_sdm.event: debug
  • It is recommended to let Home Assistant create the Pub/Sub subscription for you. However, if you would like more control you can enter a susbcriber_id in the configuration. See Subscribe to Events for more instructions on how to manually create a subscription and use the full subscription name in the Home Assistant configuration e.g. projects/gcp-project-name/subscriptions/subscription-id

Legacy Works With Nest API

This section contains instructions for the Legacy Works with Nest API.

New users are not currently able to set up a Works With Nest Developer account. The documentation is preserved here for existing users of the API.
Legacy Works with Nest Configuration Steps