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}

Development

$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -e .
$ pip3 install -r requirements.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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_nest_sdm-9.2.0.tar.gz (76.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_nest_sdm-9.2.0-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

Details for the file google_nest_sdm-9.2.0.tar.gz.

File metadata

  • Download URL: google_nest_sdm-9.2.0.tar.gz
  • Upload date:
  • Size: 76.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for google_nest_sdm-9.2.0.tar.gz
Algorithm Hash digest
SHA256 5fcc6f9795a4ae9410fd92760b2fd1d733c92cb95bf90307531df3ba5aed8d9a
MD5 8a000429f22d1ef82a5e36f3d3c6247d
BLAKE2b-256 d34675f6f60b4e6686bdf36f048cd67039270d0a37ba1e9a4fed1c6a94a7fbc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_nest_sdm-9.2.0.tar.gz:

Publisher: publish.yaml on allenporter/python-google-nest-sdm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file google_nest_sdm-9.2.0-py3-none-any.whl.

File metadata

  • Download URL: google_nest_sdm-9.2.0-py3-none-any.whl
  • Upload date:
  • Size: 56.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for google_nest_sdm-9.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d46bda5d83282c283388f7a5594d9a578dea8d9980474d2026ca91213cd2dc62
MD5 12ca058b642f33ca537a2b37c8a1df7a
BLAKE2b-256 3cc0580c042a46811da751090b8afef5e9f86ccf8e5e7ad0f5b2fd0de4d67aa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_nest_sdm-9.2.0-py3-none-any.whl:

Publisher: publish.yaml on allenporter/python-google-nest-sdm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

9.2.1

2 files

This release

9.2.0 This release

2 files

9.1.2

2 files

9.1.1

2 files

9.1.0

2 files

9.0.2

2 files

9.0.1

2 files

9.0.0

2 files

8.0.0

2 files

7.1.5

2 files

7.1.4

2 files

7.1.3

2 files

7.1.2

2 files

7.1.1

2 files

7.1.0

2 files

7.0.0

2 files

6.1.5

2 files

6.1.4

2 files

6.1.3

2 files

6.1.2

2 files

6.1.1

2 files

6.1.0

2 files

6.0.0

2 files

5.0.1

2 files

5.0.0

2 files

4.0.7

2 files

4.0.6

2 files

4.0.5

2 files

4.0.4

2 files

4.0.3

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.0.5

2 files

3.0.4

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.2.5

2 files

2.2.4

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.12

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

3 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

1 file

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page