Library built for Home Assistant to integrate with the City of Toronto MyWaterToronto service
Project description
🌤️ Python Wrapper for MyWaterToronto REST API
This module communicates with the City of Toronto MyWaterToronto service.
The module is primarily written for the purpose of being used in Home Assistant for the Custom Integration called mywatertoronto
.
This API will read the account information and obtain a list of address(es) and meter(s).
Consumption data incude
Unfortunately, the City of Toronto only appears to be pulling meter data every 1-2 days.
Install
pymywatertoronto
is available on PyPi:
pip install pymywatertoronto
Consumption Buckets
This library will provide the following consumption buckets
Total usage
Today usage
Week-to-date usage
Month-to-date usage
Year-to-date usage
Usage
This library is primarily designed to be used in Home Assistant.
The main interface for the library is the pymywatertoronto.MyWaterToronto
. This interface takes 6 options:
session
: (required) An existing aiohttp.ClientSession.account_number
: (required) Enter your Account No. found on the utility bill.client_number
: (required) Enter your Client No. found on the utility bill.last_name
: (required) Enter your Last Name - must match the first last name on the utility bill.postal_code
: (required) Enter your Postal Code - must match the postal code on the utility bill.last_payment_method
: (required) use the enumerations from const.LastPaymentMethod.
Copy the tests/template.env to tests/.env file and update the account information with your your City of Toronto account information:
ACCOUNT_NUMBER="000000000"
CLIENT_NUMBER="000000000-00"
LAST_NAME="lastname"
POSTAL_CODE="A1A 1A1"
LAST_PAYMENT_METHOD="4"
Use the enumerations from const.LastPaymentMethod.
Run the test file: python tests/test_mywatertoronto.py [-h or --dump]
--dump paramater will create two files containing data that is leveraged in the Home Assistant integration:
- data_account_details.json
- data_consumption.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pymywatertoronto-1.4.1.tar.gz
.
File metadata
- Download URL: pymywatertoronto-1.4.1.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd22bb2c548160d15cb48af80c45d258dc61e5622d7c33fd41eb2d5db77c1fb |
|
MD5 | 87c7aeaefe9392965331448b3a857e73 |
|
BLAKE2b-256 | 728810b427af8fdde970de76818f7621a67f0adc21ee824f99da065a91ec81f3 |
File details
Details for the file pymywatertoronto-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: pymywatertoronto-1.4.1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c3f37ca8b38e71d0f8f46e53789fce7de73a0c496113f8dac81320f32a715f0 |
|
MD5 | 37e651b64bfb5d143100255365bb78aa |
|
BLAKE2b-256 | cf1699d20ff86e4cce980c8ea579a421078b1eb18efe68ec42d4a16cfdd773f9 |