Skip to content

Python tool for extracting Octopus Energy meter readings to InfluxDB

Notifications You must be signed in to change notification settings

ophintor/octograph

 
 

Repository files navigation

Octograph

Project forked and modified from https://github.com/stevenewey/octograph.

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

In the process, Agile tariff metrics will be generated and stored for unit rates and costs. Suitable for Octopus Agile tariffs.

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 (see cronjob.sh).

docker-compose up -d  # start InfluxDB and Grafana in Docker
python app/octopus_to_infuxdb.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.

About

Python tool for extracting Octopus Energy meter readings to InfluxDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.0%
  • Shell 5.2%
  • Dockerfile 4.8%