Prometheus exporter for Octopus Energy metrics. Works best when coupled with an Octopus Home Mini.
Project description
Octopus Usage Exporter
Prometheus exporter for Octopus Energy metrics. Works best when coupled with an Octopus Home Mini.
Returns:
- Consumption (Gas and Electric)
- Demand (if you have a Smart Meter) (Electric Only)
- Tariff Information (Standard and 'Smart' Half Hourly Tariffs only, 3 rate and day/night rate not currently supported)
- Standing Charge
- Current Unit Rate
- Days till tariff ends
Working Items
- Prometheus Exporter
How To Use
- Make use of the docker compose example below or the example in the repo and customise for your use case
- Set the following environment vars:
PROM_PORT=9120(Prometheus Port)INTERVAL=300(Scraping interval in seconds)API_KEY=abc123(Octopus Energy API key)ACCOUNT_NUMBER=A-ABC12E04(Octopus Energy Account number)GAS=True(Gas stat scraping)ELECTRIC=True(Electric stat scraping)NG_METRICS=False(New for 0.0.24, metrics move to use a proper label format outside of metric names. Defaults to false with existing metric format, setting to True will enable new formatting. This behaviour will change in future major release.)TARIFF_RATES=True(Tariff pricing scraping)TARIFF_REMAINING=True(Tariff agreement time remaining scrape and calculation)
- Ensure the ports exposed in the docker compose match the port referenced under PROM_PORT
Example Metrics
# HELP oe_meter_tariff_unit_rate Unit rate of the tariff in pence per kWh
# TYPE oe_meter_tariff_unit_rate gauge
oe_meter_tariff_unit_rate{device_id="00-12-34-56-78-9A-BC-DE",meter_type="electric"} 22.995
oe_meter_tariff_unit_rate{device_id="00-12-34-56-78-9A-BC-DE",meter_type="gas"} 6.134415
# HELP oe_meter_tariff_standing_charge Standing charge of the tariff in pence per day
# TYPE oe_meter_tariff_standing_charge gauge
oe_meter_tariff_standing_charge{device_id="00-12-34-56-78-9A-BC-DE",meter_type="electric"} 49.98336
oe_meter_tariff_standing_charge{device_id="00-12-34-56-78-9A-BC-DE",meter_type="gas"} 31.381455
# HELP oe_meter_tariff_expiry Expiry date of the tariff in epoch seconds
# TYPE oe_meter_tariff_expiry gauge
oe_meter_tariff_expiry{device_id="00-12-34-56-78-9A-BC-DE",meter_type="electric"} 1.782342e+09
oe_meter_tariff_expiry{device_id="00-12-34-56-78-9A-BC-DE",meter_type="gas"} 1.7750844e+09
# HELP oe_meter_tariff_days_remaining Days remaining until the tariff expires
# TYPE oe_meter_tariff_days_remaining gauge
oe_meter_tariff_days_remaining{device_id="00-12-34-56-78-9A-BC-DE",meter_type="electric"} 349.0
oe_meter_tariff_days_remaining{device_id="00-12-34-56-78-9A-BC-DE",meter_type="gas"} 265.0
# HELP oe_meter_consumption Total consumption in kWh
# TYPE oe_meter_consumption gauge
oe_meter_consumption{device_id="00-12-34-56-78-9A-BC-DE",meter_type="electric"} 5.582643e+06
oe_meter_consumption{device_id="00-12-34-56-78-9A-BC-DE",meter_type="gas"} 1.451495518e+07
# HELP oe_meter_demand Total demand in watts
# TYPE oe_meter_demand gauge
oe_meter_demand{device_id="00-12-34-56-78-9A-BC-DE",meter_type="electric"} 439.6
Docker Compose Example
version: "3.3"
services:
octopus-usage-exporter:
image: ghcr.io/josephrpalmer/octopus-usage-exporter:latest
container_name: octopus-usage-exporter
network_mode: bridge
restart: always
environment:
- PROM_PORT=9120
- INTERVAL=60
- API_KEY=abc123
- ACCOUNT_NUMBER=A-ABC12E04
- GAS=True
- ELECTRIC=True
- NG_METRICS=False
- TARIFF_RATES=True
- TARIFF_REMAINING=True
ports:
- "9120:9120"
Grafana Dashboard Example
An example grafana dashboard can be found in the examples directory. This shows stats relating to current, max, min and average consumption, as well as total consumption.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file octopus_usage_exporter-0.1.5.tar.gz.
File metadata
- Download URL: octopus_usage_exporter-0.1.5.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3ad2f6483d9b06956e635ab50fded80f789b37d0f65b56931313a7d0f2ae23c
|
|
| MD5 |
0a2a41428e1198d447e536de4c27b7a6
|
|
| BLAKE2b-256 |
4b1188ae87f0f071ca4340f7f0a97459c168f6352773afeb1921b24165b3ce5f
|
File details
Details for the file octopus_usage_exporter-0.1.5-py3-none-any.whl.
File metadata
- Download URL: octopus_usage_exporter-0.1.5-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1236a8de73d87000b99d9ab47ff69a69d85640734f455b4557e9d347d8b54855
|
|
| MD5 |
672ab35bbd54490f812dce59e22e56df
|
|
| BLAKE2b-256 |
7b63f2a33e04b327c6c9cc78ad6d5de873e56095e80f9fe205b18012f403784f
|