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.1.tar.gz (8.7 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.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bradford_white_wave_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f9b71e10c78ada0e6caabd2c86f2bdc5c084c6884b6b765ae78a0f25a710727b
MD5 fbc2f3f7c2224045895f15ec6cbf7b5a
BLAKE2b-256 c1c80dde6846caf6276f50bb25a6290a6c20c18cc295f2e6c9bc7345e5e1657d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bradford_white_wave_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c20ded05a5f6849d66e743b539032d18bb0e2c5b17d91fe0be20804909ac81e8
MD5 8e49ef4f51df28760ecbe603e6c19e95
BLAKE2b-256 e16c2dff8afe183d73df3b40e8b68f3dcd13d37d27c2acd9923ea748a20f51b7

See more details on using hashes here.

Provenance

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