Coder Social home page Coder Social logo

diogos88 / pyhydroquebec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from titilambert/pyhydroquebec

0.0 0.0 0.0 112 KB

Get your consumption data from your HydroQuebec account (www.hydroquebec.com)

License: Apache License 2.0

Python 96.61% Makefile 0.68% Dockerfile 0.76% Shell 1.95%

pyhydroquebec's Introduction

PyHydroQuebec

TODO

  • Add automated tests

Installation

pip install pyhydroquebec

Usage

Print your current data

pyhydroquebec -u MYACCOUNT -p MYPASSWORD

List your current contracts

pyhydroquebec -u MYACCOUNT -p MYPASSWORD -l

Print help

usage: pyhydroquebec [-h] [-u USERNAME] [-p PASSWORD] [-j] [-i] [-c CONTRACT]
                    [-l] [-H] [-t TIMEOUT] [-V] [--detailled-energy]
                    [--start-date START_DATE] [--end-date END_DATE]

optional arguments:
    -h, --help                          show this help message and exit
    -u USERNAME, --username USERNAME    Hydro Quebec username
    -p PASSWORD, --password PASSWORD    Password
    -j, --json                          Json output
    -i, --influxdb                      InfluxDb output
    -c CONTRACT, --contract CONTRACT    Contract number
    -l, --list-contracts                List all your contracts
    -H, --hourly                        Show yesterday hourly consumption
    -t TIMEOUT, --timeout TIMEOUT       Request timeout
    -V, --version                       Show version

Detailled-energy raw download option:
    --detailled-energy                  Get raw json output download
    --start-date START_DATE             Start date for detailled-output
    --end-date END_DATE                 End date for detailled-output

MQTT DAEMON

Create configuration file.

mkdir -p /docker/pyhydroquebec
cp config.yaml.sample /docker/pyhydroquebec/config.yaml

Edit configuration parameters [username, password, id].

# THIS YAML CAN CHANGE IN THE FUTURE
timeout: 30
# 6 hours
frequency: 8640
accounts:
- username: USERNAME@EMAIL
  password: PASSWORD
  contracts:
    - id: CONTRACT_ID

Edit docker-compose parameters [MQTT_USERNAME, MQTT_PASSWORD, MQTT_HOST, MQTT_PORT].

nano docker-compose.yaml

Deploy with docker-compose.

docker-compose -f docker-compose.yaml up -d

Docker

Docker image list: https://gitlab.com/ttblt-hass/pyhydroquebec/container_registry

docker run -e PYHQ_USER=*** -e PYHQ_PASSWORD=*** registry.gitlab.com/ttblt-hass/pyhydroquebec/cli:master

Docker variables

PYHQ_USER - Required
-e PYHQ_USER=myusername
PYHQ_PASSWORD - Required
-e PYHQ_PASSWORD=mypassword

PYHQ_OUTPUT

  • -e PYHQ_OUTPUT=TEXT - Default
  • -e PYHQ_OUTPUT=JSON
  • -e PYHQ_OUTPUT=INFLUXDB
  • -e PYHQ_OUTPUT=CONTRACT

PYHQ_CONTRACT

-e PYHQ_CONTRACT=332211223

Dev env

make env

Run test

USERNAME=myhydrousername PASSWORD=myhydropassword tox

pyhydroquebec's People

Contributors

balloob avatar diogos88 avatar kevmegforest avatar ncareau avatar syedair avatar titilambert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.