Skip to main content

Client for Bradford White Wave API

Project description

Bradford White Wave Client

A Python client library for the Bradford White Wave API for water heaters. The "Wave" platform is new and separate from the previous "Connect" platform. For instance the original Aerotherm uses an optional "Connect" module add-on, while the Aerotherm G2 has built-in connectivity to the "Wave" platform.

This library is designed for use in a Home Assistant integration and general automation tasks.

To build this I took some inspiration from the bradford-white-connect-client library and did some digging into how the new app works.

Authentication

Some manual steps are required to authenticate with the API, since for the time being I have been unable to fully automate the process.

  1. Run the example script:
    python example_script.py
    
  2. The script will generate a login URL. Open it in your browser.
  3. Log in with your Bradford White Wave credentials.
  4. The browser will receive a redirect, but (at least for Firefox) it will fail to follow this redirect and show an error page.
  5. Open the network tab in your browser's development tools and refresh the page. You'll see the failed redirect response. Look for the location: header starting with com.bradfordwhiteapps.bwconnect:// in the response. Redirect Example
  6. Copy the full url and paste it back into the script terminal.
  7. The script will save your credentials to .credentials.json so future runs of the script will skip the above steps (this file is in .gitignore).

Usage

Once you have a refresh_token, you can initialize the client:

client = BradfordWhiteClient(refresh_token="YOUR_REFRESH_TOKEN")
await client.authenticate()

From there, there are several methods available:

# List devices
await client.list_devices()

# Get status
await client.get_status("MAC_ADDRESS")

# Get energy usage
await client.get_energy("MAC_ADDRESS", "hourly")

# Set temperature
await client.set_temperature("MAC_ADDRESS", 120)

# Set mode
from bradford_white_wave_client.models import BradfordWhiteMode
await client.set_mode("MAC_ADDRESS", BradfordWhiteMode.HEAT_PUMP)

Installation

pip install bradford-white-wave-client

Features

  • Async/Await support using aiohttp
  • Type-hinted with Pydantic models
  • Auto-refresh of access tokens

Disclaimers

  • This is an unofficial library and is not affiliated with Bradford White.
  • I have only tested with an Aerotherm G2.
  • This is largely written in "collaboration" with Gemini, though I have manually reviewed the code and verified the flows.

Project details


Download files

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

Source Distribution

bradford_white_wave_client-0.1.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

bradford_white_wave_client-0.1.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file bradford_white_wave_client-0.1.2.tar.gz.

File metadata

File hashes

Hashes for bradford_white_wave_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7b90f83f560b8bc7e1a6d55987c13a4de8436329f480223469070163b9689133
MD5 5e04a6014a40858112df7625b7db73df
BLAKE2b-256 26350f2ab43201daba22a7d168b8527501ee78bcf7bbd973347d7d9041aefb68

See more details on using hashes here.

Provenance

The following attestation bundles were made for bradford_white_wave_client-0.1.2.tar.gz:

Publisher: publish.yml on gclenaghan/bradford-white-wave-client

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

File details

Details for the file bradford_white_wave_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bradford_white_wave_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cf79fd6ceee20f2ee02b5c692420c8776c4e35ef9ff03eca10d09228c8e2b11
MD5 695d835ced53d1404f78dad88dd73797
BLAKE2b-256 a8ee11be0c4daefa630118afdd02ff20af2219bdc98832e9a9f9efecf35dd647

See more details on using hashes here.

Provenance

The following attestation bundles were made for bradford_white_wave_client-0.1.2-py3-none-any.whl:

Publisher: publish.yml on gclenaghan/bradford-white-wave-client

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

Supported by

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