Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pymydcwater

pymydcwater is a small Python client for pulling daily meter data from a mydcwater.com account.

It uses the live flow exposed by the portal today:

  1. Log in to https://www.mydcwater.com/DCWSSP/index.aspx?Logout=true
  2. Load AccountSummary.aspx
  3. Extract the signed Huna AMR link from the account summary page
  4. Load the Huna monthly usage page
  5. Fetch structured daily usage JSON from https://huna.dcwater.com/WaterUsage/GetChartDataforDailyUsage

Install

python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'

Quick start

from pymydcwater import MyDCWaterClient

client = MyDCWaterClient(login="your_user_id", password="your_password")

months = client.get_available_months()
print(months[-1].key, months[-1].reading_date)

report = client.get_daily_usage(months[-1].key)
for row in report.records[:3]:
    print(row.reading_datetime, row.usage, row.units)

Get the latest meter reading:

from pymydcwater import MyDCWaterClient

client = MyDCWaterClient(login="your_user_id", password="your_password")

latest_month = client.get_available_months()[-1]
latest = client.get_daily_usage(latest_month.key).records[-1]

print(latest.reading_datetime)
print(latest.reading_value)
print(latest.usage)

Fetch all available daily data:

from pymydcwater import MyDCWaterClient

client = MyDCWaterClient(login="your_user_id", password="your_password")
records = client.get_all_daily_usage()
print(len(records))

CLI

The CLI reads credentials from --login / --password or from MYDCWATER_LOGIN / MYDCWATER_PASSWORD.

Pass credentials directly:

pymydcwater --login your_user_id --password your_password --month Mar

Or use .env / environment variables:

pymydcwater --month Mar
pymydcwater --latest-reading
pymydcwater --all-months --unit Gal

Notes

  • The portal login field is labeled User ID, not email. If login fails, verify you are using the portal user ID.
  • The library currently targets the Huna AMR-backed daily history surfaced from the account summary page.
  • If DC Water changes the signed Huna link format or Huna endpoints, the account-summary discovery step may need to be updated.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages