Octopus Energy UK: Usage

Collect usage data from Octopus Energy UK and persist locally.

Language: DSL

Dependencies:

  • You need to be a customer of Octopus Energy UK!
  • Login to your Octopus account, go to “Personal details” then “API access” and note down your API key, MPAN, MPRN and serial numbers for your meters.
  • Create Items to receive the data and set the units appropriately - for electricity, Wh or kWh and for gas, m³ (SMETS2 meter) or Wh or kWh (SMETS1 meter)

Changelog

Version 1.0

  • Initial release

Resources

octopusenergy-usage.yaml

Do you know if this also works in Germany? I don’t have an API key for example so I guess this is probably limited to the UK?!

This uses the REST API whereas I think countries other than the UK only have the GraphQL API so, no, it won’t work in Germany.

Hi, I can’t get this to work. Trying to use my default persistence as you advise (RRD4j) but the logs just keep returning “There is no modifiable persistence service registered with the id ‘null’”. I have set service to null in the config. My item is not populated with data from Octopus and I get no other warnings.

You misread it. RRD will NOT work. You’re best using a SQL DB via JDBC. Personally I use PostgreSQL with the timescaledb extensions.

Hi, thanks for the efforts with this automation.

Can I confirm that this works with InfluxdB v1? The rule isn’t populating my items and I seem to be getting a warning message:

[WARN] [org.openhab.persistence.influxdb.internal.influx1.InfluxDB1RepositoryImpl] - Removing data is not supported in InfluxDB v1.

Thanks!

I use postgresql/timescaledb myself. Judging by the error message you get you would have to use at least influxdb v2. If you MUST use v1 go to the rule, click the code tab and change Policy.REPLACE to Policy.ADD (REPLACE removes anything in the given timespan and then adds). You may also need to look for the FIXME and, as it says, add a second to avoid fetching the last known value again. I should probably make both of those changes myself - but I’d rather write a proper Octopus binding.

Hi, thanks for the quick response. The reason for me using InfluxDB and that v1 is its the default one included in the openhabian setup. I suspect that v2 may not be an option for me based on my setup.

Thanks for the suggestions, are you going to proceed with a binding at some point? If so, it may make sense to wait as im by no means a developer :slight_smile:

Just a follow up. I’ve made those change (including adding a second) and sadly no response.

I’ve queried the end-point directly using postman and works with no issues.

Any help would be greatly appreciated.

Many thanks! :slight_smile: