Skip to main content

Octopus Usage Exporter

Docker Image CI    GitHub Tag   GitHub Release Date     GitHub License

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.

Metadata

Release files for octopus-usage-exporter 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for octopus-usage-exporter 0.1.5
File Size Uploaded Provenance Actions
octopus_usage_exporter-0.1.5.tar.gz 21.9 kB Without provenance Details for octopus_usage_exporter-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for octopus-usage-exporter 0.1.5
File Interpreter ABI Platform Actions
octopus_usage_exporter-0.1.5-py3-none-any.whl Python 3 none any Details for octopus_usage_exporter-0.1.5-py3-none-any.whl

Total release size: 44.3 kB

Release files / octopus_usage_exporter-0.1.5.tar.gz

Download URL octopus_usage_exporter-0.1.5.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d3ad2f6483d9b06956e635ab50fded80f789b37d0f65b56931313a7d0f2ae23c
BLAKE2b-256 checksum
How to use checksums
4b1188ae87f0f071ca4340f7f0a97459c168f6352773afeb1921b24165b3ce5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Release files / octopus_usage_exporter-0.1.5-py3-none-any.whl

Download URL octopus_usage_exporter-0.1.5-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1236a8de73d87000b99d9ab47ff69a69d85640734f455b4557e9d347d8b54855
BLAKE2b-256 checksum
How to use checksums
7b63f2a33e04b327c6c9cc78ad6d5de873e56095e80f9fe205b18012f403784f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Security for octopus-usage-exporter 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page