Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Daniel15/a81978c072efebab023fbf555338d10f to your computer and use it in GitHub Desktop.

Select an option

Save Daniel15/a81978c072efebab023fbf555338d10f to your computer and use it in GitHub Desktop.
Bradford White water heater details (BWConnect)

Basic script to get details about Bradford White water heaters, via bradford_white_connect_client.

Usage:

python3 -m venv .venv
source .venv/bin/activate 
pip install bradford_white_connect_client pytz tenacity

[email protected] BW_PASSWORD=hunter2 python list_heaters.py
import asyncio
import os
import sys
from bradford_white_connect_client import BradfordWhiteConnectClient
async def main():
email = os.environ.get("BW_EMAIL")
password = os.environ.get("BW_PASSWORD")
if not email or not password:
print("Set BW_EMAIL and BW_PASSWORD environment variables.")
sys.exit(1)
client = BradfordWhiteConnectClient(email=email, password=password)
try:
devices = await client.get_devices()
print(f"Found {len(devices)} water heater(s)\n")
for device in devices:
print(f"=== {device.product_name} ===")
print(f" Model: {device.model}")
print(f" OEM Model: {device.oem_model}")
print(f" DSN: {device.dsn}")
print(f" MAC: {device.mac}")
print(f" LAN IP: {device.lan_ip}")
print(f" SW Version: {device.sw_version}")
print(f" Template ID: {device.template_id}")
print(f" Device Type: {device.device_type}")
print(f" Connection: {device.connection_status}")
print(f" Connected At: {device.connected_at}")
print(f" Location: {device.locality}")
print(f" Coordinates: ({device.lat}, {device.lng})")
print(f" Dealer: {device.dealer}")
print(f" LAN Enabled: {device.lan_enabled}")
print(f" Has Properties: {device.has_properties}")
print()
if device.has_properties:
properties = await client.get_device_properties(device)
print(f" Properties ({len(properties)}):")
for pw in properties:
p = pw.property
print(f" {p.display_name:30s} ({p.name}) = {p.value}")
print()
finally:
await client.session.close()
asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment