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.0.tar.gz (8.6 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.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bradford_white_wave_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bdc9e5b08a3849ce05674f462040ae164267c3c900f21cc1040afd88dc9fbf5d
MD5 13589f576f2bef1c707d82ef424c4916
BLAKE2b-256 686f58088b48d3ddec1fe9c1cd0029031661735e59de0285da0d74eb19a744c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bradford_white_wave_client-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bradford_white_wave_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf56d5b9c210746cbcd79e9aec70195cfb834cd6a16ca1fae85209ea7902b8af
MD5 5c8d37ad6960076587299bc56568d2ba
BLAKE2b-256 b108521bd8fbc9df5a425a45e69a92c3553526edee0578afdde224e704c00bdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for bradford_white_wave_client-0.1.0-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