Skip to main content

Library built for Home Assistant to integrate with the City of Toronto MyWaterToronto service

Project description

🌤️ Python Wrapper for MyWaterToronto REST API

Latest PyPI version Supported Python

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymywatertoronto-1.3.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

pymywatertoronto-1.3.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file pymywatertoronto-1.3.0.tar.gz.

File metadata

  • Download URL: pymywatertoronto-1.3.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for pymywatertoronto-1.3.0.tar.gz
Algorithm Hash digest
SHA256 59ba2d0404ad2a264c92b772b622b4f7d4e50d902b2a577c7394c719dfe8f046
MD5 4db167b965d84ba77902365064e48000
BLAKE2b-256 f4bd1866a33f32a47eaf07e0b4cf7ec68b1063652ec275a17915e0209b563c36

See more details on using hashes here.

File details

Details for the file pymywatertoronto-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: pymywatertoronto-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for pymywatertoronto-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b180a053197349f9f10f144565b0eb64d6a59ca6fe6d1d248a51e125b4cf08ec
MD5 25db32b4e6abf3f54a91cfb61cef1c24
BLAKE2b-256 63b75e52c0e81e70019ff5e64bc5033d50c6c9bc590591e84053349dc166dc37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page