Giter Site home page Giter Site logo

octograph's Introduction

Octograph

Python tool for downloading energy consumption data from the Octopus Energy API and loading it into InfluxDB.

If you think you'd find this useful, but haven't switched to Octopus yet, then you can follow my referrer link https://share.octopus.energy/vivid-emu-468 and you'll receive a £50 bill credit, and so will I :)

In the process, additional metrics will be generated and stored for unit rates and costs as configured by the user. Suitable for two-rate electricity tariffs like Octopus Energy Go. Single rate gas readings are also retrieved and stored.

The secondary unit rate is specified with start and end times, and a timezone which is useful for the Go tariff where the discount rate changes with daylight savings time.

Included is an example Grafana dashboard to visualise the captured data.

An example Docker Compose file is included for easily running InfluxDB and Grafana.

grafana-dashboard.png

Installation

Tested on macOS with Docker for Mac and Python 3.6. A Python virtualenv is recommended.

Install the Python requirements with pip

pip install -r app/requirements.txt

Usage

Create a configuration file octograph.ini customised with your Octopus API key, meter details and energy rate information. This file should be in the working directory where you run the octopus_to_influxdb.py command, or can be passed as an argument.

python app/octopus_to_influxdb.py --help

By default, energy data for the previous day will be collected. Optional from and to ranges may be specified to retrieve larger datasets. It is anticipated that the script will be run daily by a cron job.

docker-compose up -d  # start InfluxDB and Grafana in Docker
python app/octopus_to_influxdb.py --from-date=2018-10-20
open http://localhost:3000

The default login credentials for Grafana are admin/admin, and you will be prompted to set a new password on first login. You should then proceed to add InfluxDB as a datasource with URL http://influxdb:8086 and database energy if using the Docker version provided. The dashboard provided can then be imported to review the data.

octograph's People

Contributors

pascaldulieu avatar stevenewey avatar optiz0r avatar zxdavb 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.