Skip to main content

A wrapper library to access hydro quebec API and more

Project description

HydroQC - Hydro Quebec API wrapper

coverage report pipeline status

This is a library to use if you want to build your own solution. If you want a user-friendly implementation for your home automation system please use hydroqc2mqtt which provide a MQTT publisher, docker image and HASS addon.

This is a package to access some functionalities of Hydro Quebec API that are not documented.

We started a discord server for the project where you can come to discuss and find help with the project on our #development channel

Donations

We put a lot of heart and effort in this project, any contribution is greatly appreciated!

Donate

Tested Rates

Each account, contracts and rates are different and we do our best to integrate all available options. Currently the account combinations listed below are supported and tested automaticaly by our CI/CD pipeline. If your account scenario is not currently tested and listed as Needed feel free to reach out to us on our discord #development channel if you want to volunter for testing. We provide a way to setup CI/CD tests in your own account in a way that keep your account info private to you (more details here). Keep in mind that this process is a bit involved technicaly so it is best if you have some working knowledge with Gitlab.

Rate D

Base Rate Rate Option Tester Test result Last run Comment
D - @weimdall Test Result Timestamp
D - @mdallaire1 Test Result Timestamp
D - @devzwf Test Result Timestamp Hilo
D CPC @titilambert Test Result Timestamp

Flex D (DPC)

Base Rate Rate Option Tester Test result Last run Comment
DPC - @mdallaire1 Test Result Timestamp

Dual Energy (DT)

Base Rate Rate Option Tester Test result Last run Comment
DT - @mdallaire1 Test Result Timestamp

Rate M

Base Rate Rate Option Tester Test result Last run Comment
M - @hdenergy Test Result Timestamp HD Énergie
M GDP @hdenergy Test Result Timestamp HD Énergie

Thanks to HD Énergie for sponsoring developpement of the Rate M support.

Other plans

We don't have anyone to test with. Please reach out to us if you have this plan and want to help!

Documentation

Code documentation

https://hydroqc.readthedocs.io/

Architecture / concepts

If you need more information about the usage and current integrations of the library please see our website https://hydroqc.ca

Goal

Make it easy to fetch and manipulate data from Hydro-Quebec, especially the winter credit periods

Example folder

An example script that extracts the data available from Hydro-Quebec is available in the examples folder.

Basic setup

This uses python 3.10

  1. Clone the repo

    git clone https://gitlab.com/hydroqc/hydroqc.git
    
  2. Create a virtual-env

    python -m venv env
    . env/bin/activate
    pip install --editable .
    
  3. Enter your hydro account credentials in the examples/hydro.py file (line 6)

  4. Run

    examples/hydro.py
    

TODO

https://gitlab.com/groups/hydroqc/-/issues

Targeted architecture (might change in the future)

classDiagram
    WebUser <-- Customer
    WebUser <-- HydroClient

    Customer <-- Account

    Account <-- Contract

    Contract <-- HydroClient
    Contract <-- Period
    Contract <-- Event
    Contract <-- WinterCreditHelper

    WinterCreditHelper <-- HydroClient


    HydroClient <-- Authenticator

    class HydroClient{

    }
    class WinterCreditHelper{
    }

    class WebUser{
        -HydroClient _hydro_client
        +List~Customer~ customers
        +get_contracts()
    }

    class Customer{
        -HydroClient _hydro_client
        +List~Account~ accounts
    }

    class Account{
        -HydroClient _hydro_client
        +List~Contract~ contracts
    }

    class Config{
        -string config_file_path
    }

    class Contract{
        -HydroClient _hydro_client
        -int customer_id
        -int webuser_id
        +string subscription_type
        +float balance
        +list~Period~ periods
        +list~Event~ events
        +get_winter_credit()
        +fetch_periods()
        +fetch_summary()
    }

    class Period{
    }

    class Event{
    }

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

hydro_quebec_api_wrapper-3.2.0.tar.gz (391.1 kB view details)

Uploaded Source

Built Distribution

Hydro_Quebec_API_Wrapper-3.2.0-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file hydro_quebec_api_wrapper-3.2.0.tar.gz.

File metadata

File hashes

Hashes for hydro_quebec_api_wrapper-3.2.0.tar.gz
Algorithm Hash digest
SHA256 37f542a6c5b8df96fb7c04a96862d876492512e2c9d133aceb449578f109fe1c
MD5 f6d08fd0e939c33aa43bb37405477aa9
BLAKE2b-256 1168427918ea0f35138e16d318019071d7003a5149030e5c1541430ce6de41f7

See more details on using hashes here.

File details

Details for the file Hydro_Quebec_API_Wrapper-3.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for Hydro_Quebec_API_Wrapper-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 296f1430752d1ee8cbe020aefb3d5e1183d84e37d5604607c4733e1211dccf53
MD5 57912576c934855872417f4aa6abaa44
BLAKE2b-256 b7d83e509c7f48e015ce8702386564c75b1d53183b636c1b5ed8630c9e0eabd0

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