Skip to main content

Prometheus exporter for Octopus Energy metrics. Works best when coupled with an Octopus Home Mini.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

octopus_usage_exporter-0.1.4.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

octopus_usage_exporter-0.1.4-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file octopus_usage_exporter-0.1.4.tar.gz.

File metadata

File hashes

Hashes for octopus_usage_exporter-0.1.4.tar.gz
Algorithm Hash digest
SHA256 fc9ddc2dacce15c2eab6b24be461eccb9063b59a043fd842957bdd01099fd2ef
MD5 395ad07bb3dff6c1287f45f0a6b884bf
BLAKE2b-256 e2dd39d582a82e09816e3a7528c21b2ff8dff96bd3e89483c60645bc13b8cd9b

See more details on using hashes here.

File details

Details for the file octopus_usage_exporter-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for octopus_usage_exporter-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3046582f5ed0423db7a0212c2ede17279ccfa1c360df62cec971e8942d007e32
MD5 99692e5fd9ca008a8f1136da45d4e69e
BLAKE2b-256 f8b50d1c59c137ce855e7486b481864cf37568474191ce9fd496bee1c7a883fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page