Skip to main content

python-google-nest-sdm

This is a library for Google Nest Device Access using the Smart Device Management API.

Usage

This can be used with the sandbox which requires Registration, accepting terms and a fee.

You'll want to following the Get Started guides for setup including steps in the google cloud console. Overall, this is fairly complicated with many steps that are easy to get wrong. It is likely worth it to make sure you can get the API working using their supplied curl commands with your account before attempting to use this library.

Structure

This API was designed for use in Home Assistant following the advice in Building a Python Library for an API.

If you are integrating this from outside Home Assistant, you'll need to create your own oauth integration and token refresh mechanism and tooling.

Fetching Data

This is an example to use the command line tool to access the API:

PROJECT_ID="some-project-id"
CLIENT_ID="some-client-id"
CLIENT_SECRET="some-client-secret"
# Initial call will ask you to authorize OAuth2 then cache the token
google_nest --project_id="${PROJECT_ID}" --client_id="${CLIENT_ID}" --client_secret="${CLIENT_SECRET}" list_structures
# Subsequent calls only need the project id
google_nest --project_id="${PROJECT_ID}" get_device "some-device-id"
google_nest --project_id="${PROJECT_ID}" set_mode COOL
google_nest --project_id="${PROJECT_ID}" set_cool 25.0

Subscriptions

See Device Access: Getting Started: Subscribe to Events for documentation on how to create a pull subscription.

You can create the subscription to use with the tool with these steps:

This is an example to run the command line tool to subscribe:

PROJECT_ID="some-project-id"
SUBSCRIPTION_ID="projects/some-id/subscriptions/enterprise-some-project-id-python-google-nest"
google_nest --project_id="${PROJECT_ID}" subscribe ${SUBSCRIPTION_ID}

Known Issues

  • Event image pre-fetching on WebRTC-only cameras: Google's SDM API can advertise the sdm.devices.traits.CameraEventImage trait on cameras that only support WEB_RTC (and not RTSP), causing CameraEventImage.GenerateImage to fail with a 400 INVALID_ARGUMENT error. This is an upstream SDM API issue (#358755975, #457610949). As a workaround, EventMediaManager automatically disables further event image pre-fetching for a device after receiving this error.

Development

$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -e .
$ pip3 install -r requirements_dev.txt

# Running tests
$ pytest

# Running tests w/ Code Coverage
$ pytest --cov=google_nest_sdm tests/ --cov-report=term-missing

# Formatting and linting
$ pre-commit run --all-files

Funding and Support

If you are interested in donating money to this effort, instead send a donation to Black Girls Code which is a great organization growing the next generation of software engineers.

Metadata

Release files for google-nest-sdm 9.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-nest-sdm 9.2.3
File Size Uploaded Provenance Actions
google_nest_sdm-9.2.3.tar.gz 77.6 kB With provenance Details for google_nest_sdm-9.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for google-nest-sdm 9.2.3
File Interpreter ABI Platform Actions
google_nest_sdm-9.2.3-py3-none-any.whl Python 3 none any Details for google_nest_sdm-9.2.3-py3-none-any.whl

Total release size: 134.8 kB

Release files / google_nest_sdm-9.2.3.tar.gz

Download URL google_nest_sdm-9.2.3.tar.gz
Size 77.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4fc421c476f0752e814b743a24aed2120642c3178c9c2b43c8cfde1b56b845b3
BLAKE2b-256 checksum
How to use checksums
3453b902191aed83ff1ae5b2acd623e57570e86bf83f10a2213fab4f32195d26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / google_nest_sdm-9.2.3-py3-none-any.whl

Download URL google_nest_sdm-9.2.3-py3-none-any.whl
Size 57.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4378b69deb5ed11e7c147791dedd43afc7275dad8a48fea54bc810bcd1f77b6c
BLAKE2b-256 checksum
How to use checksums
237b25f15820a425d0a0f75e047afdb6624e3d4e4884bb31257db6cb5a0538e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for google-nest-sdm 9.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for google_nest_sdm-9.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

9.2.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page