Skip to content

A node-red flow to fetch and display the Octopus Energy Agile electricity tariff. Running on a Raspberry Pi the current price is shown on a LED dot matrix display, and in addition graphed on a node-red dashboard.

License

swipswaps/octopus-agile-price

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Octopus Agile Price Display

A simple Node-RED flow and Python script to display the current Octopus Energy half hourly dynamic electricity Agile tariff on a RaspberryPi equipped with a Pimoroni Micro Dot pHAT display:

Raspberry Pi display

It also provides a web interface using the Node-RED dashboard:

Dashboard

The main functionality is provided by the Node-RED flow, with the Python script just used to drive the LED display.

The Node-RED flow queries the Octopus Agile tariff API to fetch the half hourly rates once per day and caches the prices in a simple SQLite file based database.

Hardware

The following hardware was used in this project:

  • RaspberryPi Zero W comfortably handles this project. I'd strongly recommend using the W version for WiFi connectivity.
  • LED dot-matrix style display, the Pimoroni Micro Dot pHAT. I found this is quite a nice readable display that looks clearer in real life than my photo above.

Install

Create the empty SQLite database

Create the data basefile file and enter SQLite command prompt:

sqlite3 agile_rates.sqlite

Create the table:

sqlite> create table rates(start_time unsigned integer primary key, cost unsigned smallint);

Install Node-RED

I recommend installing the latest Node-RED directly from the Node-RED website: Node-RED Raspberry Pi install guide

Run

Run Node-RED as a service:

node-red-start

Open the Node-RED editor in a browser at http://<your pi address>:1880.

Load the optional modules

Install the following optional Node-RED nodes from its editor using Menu->Manage palette:

  • node-red-node-sqlite
  • node-red-dashboard

Configure the node-red flow

Load the agile_flows.json into Node-RED from its editor using Menu->Import.

The current version of the flows has some hardcoded parameters which you may wish to change:

  • Path to the SQLite database is by default /home/pi/agile_rates.sqlite
  • Path to the Python script is by default /home/pi/display_driver.py

The energy tariffs are regional, by default the Get rates subflow function Prepare API has its region variable set to region A, which the Eastern Region. The region code is known as the GSP Group ID and can be looked up either via the Octopus API or using the Wikipedia MPAN Distributor ID table

Display driver

The Node-RED flow updates the LED display by calling the Python script display_driver.py, so this could be easily adapted to drive whatever external display you like.

TODO

  • improve the documentation!
  • make the key configuration parameters more easily accessible

About

A node-red flow to fetch and display the Octopus Energy Agile electricity tariff. Running on a Raspberry Pi the current price is shown on a LED dot matrix display, and in addition graphed on a node-red dashboard.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%