This integration reports your Town of Cary water usage from the Aquastar portal into your Home Assistant installation.
Aquastar provides hourly water usage data (in gallons) going back 13 months.
You need an Aquastar account through the Town of Cary's Paymentus billing portal.
-
Install HACS, then either:
Or:
- Open HACS > Integrations
- Open triple-dot menu > Custom repositories
- Add this repository's URL (
https://github.com/jaysoffian/ha-aquastar), category "Integration"
-
Install this integration and restart Home Assistant
Copy custom_components/toc_aquastar to your Home Assistant custom_components directory and restart.
- Log into the Town of Cary billing portal at https://ipn.paymentus.com/cp/tcnc
- On the landing page, find the Aquastar link (usually at the bottom under "More")
- Right-click the link and copy the URL — it will look like:
https://aquastar.townofcary.org/waterconsumption/run?id=0§oken=YOUR_TOKEN_HERE - The
sectokenvalue is the long hex string aftersectoken=
This token is tied to your account and does not change across logins.
- Go to Settings > Devices & Services > Add Integration
- Search for "Town of Cary Aquastar"
- Enter your sectoken
See docs/development.md.
The integration polls the Aquastar portal for hourly water usage data and imports it as Home Assistant long-term statistics, making it available in the Energy Dashboard.
Data is fetched every 30 minutes. On first setup, up to 13 months of historical data is imported.
The integration also computes estimated utility costs using Town of Cary's single-family residential rates (inside corporate limits, 1" or smaller meter). This includes:
- Tiered water charges ($5.46 / $6.13 / $7.74 per 1,000 gallons)
- Flat sewer charge ($11.69 per 1,000 gallons)
The rate schedule is hard-coded since it rarely changes — typically once per year on July 1.
Tiered rates are applied based on cumulative usage within each billing cycle. By default the billing cycle aligns with calendar months (day 1). If your billing cycle starts on a different day, go to Settings > Devices & Services > Aquastar and configure the Billing cycle start day in the integration options. Note that Town of Cary's actual meter read dates vary by a few days from month to month depending on the read route schedule, so the billing cycle day is an approximation. Check a few recent bills to find the most typical start day.
If the rates in the code are updated after the new rates have already taken effect (e.g. you update in September for rates that changed July 1), previously recorded cost statistics will be based on the old rates. To recalculate:
- Update
rates.pywith the new rate schedule - Restart Home Assistant
- Go to Developer Tools → Statistics
- Find and delete the
toc_aquastar:{meter_number}_water_coststatistic - Within 30 minutes, the integration will automatically rebuild all cost statistics using the corrected rates
Consumption data is not affected by this process.