We're moving onto Octopus Energy.
They expose an API allowing retrieval of tariff information as well as consumption.
Last night I started writing a plugin to collect pricing information for any meters under a specific octopus account.
This issue is being raised to track further development of that.
Activity
05-Jul-23 07:55
assigned to @btasker
05-Jul-23 07:57
The plugin (as currently written) requires two environment variables be set
OCTOPUS_KEY
: the account's API Key (can be found here)OCTOPUS_ACCOUNT
: the Octopus account numberWith those details it will
At the moment we just build a big JSON blob - there's no line protocol being generated yet.
05-Jul-23 07:58
As well as Octopus' API docs, I used the excellent post by Guy Lipman to figure out which API endpoints needed calling.
05-Jul-23 08:10
One of the things we need to decide is how we want to handle the pricing info.
What we get back from the API looks like this
(dodgy formatting is because I've pasted the resulting python dict in rather than the raw json)
I've cut it short, but it goes back to whenever the tariff was created. For Agile there will obviously be many more entries because the pricing is every half hour.
The question is: how do we want to handle exposing this pricing information?
valid_from
andvalid_to
and generate a line of LP for that?I don't think I like option
1)
at all.Option
2)
is OK, but means that we'll likely - in effect - be doing Option3)
at query time instead (the majority of the time, pricing information is going to be JOINed to consumption so that costs can be calculated)I think the answer probably is to generate the iterations. The API supports provision of a
period_from=
argument in the request, so that can be used to ensure we don't end up doing this work for months at a time.05-Jul-23 16:55
mentioned in commit github-mirror/telegraf-plugins@2cb04d2132b81a40e69cf155060da22666674058
Message
Fetch property and tariff details from Octopus' API (utilities/telegraf-plugins#14)
This is going to need a tidy - I started it late last night shortly before I ran out of Southern Comfort.
But, it does work and fetch the details. The next stage will be build some logic to turn it into Line Protocol
05-Jul-23 16:55
mentioned in commit github-mirror/telegraf-plugins@b3621e66c2db047660a27e10d9b829492ca8a105
Message
Limit tariff data to that which applies in the last 24h (utilities/telegraf-plugins#14)
05-Jul-23 16:55
mentioned in commit github-mirror/telegraf-plugins@c0010267fae08a827e7dec071a55549e0aaa1800
Message
Start generating pricing LP (utilities/telegraf-plugins#14)
05-Jul-23 16:55
mentioned in commit github-mirror/telegraf-plugins@6f985b67cb90ffd815deda0eb4d1e8201c5fafc8
Message
Generate a line of line protocol for each 30m of a tariff price (utilities/telegraf-plugins#14)
05-Jul-23 16:55
mentioned in commit github-mirror/telegraf-plugins@3dbc85dd71c871dbb10cfbc55f059fa9d5e981f1
Message
Add support for standing charge utilities/telegraf-plugins#14
05-Jul-23 16:58
Although the main aim had been to collect tariff details, given the work involved in pulling out MPANs anyway, it's probably worth going a step further and grabbing consumption data too.
06-Jul-23 11:08
I've added support for consumption.
Given we're also collecting consumption, it's probably worth renaming the plugin from
octopus-tariffs
tooctopus-energy
(easier to do now than later, and the old name's no longer representative).06-Jul-23 12:01
mentioned in commit github-mirror/telegraf-plugins@c705b5ee07b90688e6b66b2520d1730e8f3775c1
Message
Rename to
octopus-energy
(utilities/telegraf-plugins#14)Now that we're collecting more than just tariff data, the old name isn't really appropriate. Renaming as it'll be harder to do after release
06-Jul-23 12:01
mentioned in commit github-mirror/telegraf-plugins@fc2d2236aa600d54a409dc7067ead58afe247b0e
Message
Add consumption handling utilities/telegraf-plugins#14
06-Jul-23 18:42
I think I'm more or less at the stage where I should be ready to release
README
has been created (commits inbound)However, Guy Lipman's post notes that
I'm actually ready to move onto Agile - I was expecting it to take a couple of weeks but they emailed me earlier (only brief hold up is I can't sign the terms + conditions because their server throws an error)
I can't see what the difference that Guy alludes to is - I think it might just be in the params that you can include in the URL, the path format and the response bodies look to be the same.
I think the answer to that, though, is to go ahead and merge and then raise a followup ticket once we're on Agile (if there's an issue).
06-Jul-23 18:44
Merged: https://github.com/bentasker/telegraf-plugins/pull/3
06-Jul-23 19:00
mentioned in commit github-mirror/telegraf-plugins@f3113b8504f655520a0a0505b9e31ef7b5187122
Message
Link back to the design issue
Design on this plugin was a bit haphazard, so seems worth linking back to utilities/telegraf-plugins#14 to help rationalise some of it
06-Jul-23 19:00
mentioned in commit github-mirror/telegraf-plugins@119767a293db03362c5354706625eb6a85627086
Message
Merge pull request #3 from bentasker/octopus-tariffs
Add Octopus Energy Plugin (utilities/telegraf-plugins#14)