Skip to content

Add Octopus Energy Germany Dynamic Tariff Provider - #4040

Open
Bankaifan wants to merge 60 commits into
OpenEMS:developfrom
Bankaifan:feature/octopus-dynamic-de
Open

Bankaifan wants to merge 60 commits into
OpenEMS:developfrom
Bankaifan:feature/octopus-dynamic-de

Conversation

@Bankaifan

Copy link
Copy Markdown

This pull request adds native support for Octopus Energy Germany Dynamic tariffs to OpenEMS Edge.

The new TimeOfUseTariff.OctopusDynamicDE component retrieves account-specific, quarter-hourly electricity prices directly from the Octopus Energy Germany API and exposes them through the existing OpenEMS TimeOfUseTariff interface.

This enables OpenEMS users with an Octopus Energy Germany dynamic electricity contract to use their individual tariff data for energy optimization.

@sebastianasen

Copy link
Copy Markdown
Contributor

Hi @Bankaifan
could you check my internal version:
sebastianasen@f381f1e
https://github.com/sebastianasen/openems/tree/feature/gridBuyTariffOctopusDynamic

It seems we had the same idea, although I agree that it makes sense to publish it at some point. My main concern with this version was that it requires storing user credentials locally.

In the meantime, I came across some information suggesting that Octopus also offers an OAuth flow. However, this requires a client ID from the manufacturer, along with additional security checks and implementation work to integrate the OAuth details properly.

For non-commercial use cases in particular, I think this version is more than sufficient and could be extended by a config decision e.g enum AuthenticationFlow USER_CREDENTIALS, OAUTH, ...

Since my code has already been reviewed internally, I’d appreciate it if you could incorporate a few changes into your PR based on the feedback I received during that review.

In particular:

  • More specific factory ID: The factory ID should be more precise, as Octopus supports multiple tariffs. GridBuy and GridSell should be treated separately, so the ID should be something like Tariff.Octopus.Dynamic.GridBuy.
  • Use HttpBridge instead of OkHttpClient (not merged into github, on my side forn now)
  • Im not sure if this is really specific to DE as the URL is not specific. If so it could be extended by other countries within the Impl using different URLs or authentication flows depending on a config field but not with a whole copy for other coutries.

As the OAuth flow is more time taking than expecting, my plan was also to publish my version (with password) in the upcomming weeks. Lets discuss how to continue.

@Bankaifan

Copy link
Copy Markdown
Author

Hi @sebastianasen,

I will check your version. I'm pretty new in using github... I hope I'm doing the stuff the right way.

I checked the OAuth part... I'd say thats something for a future work.

Maybe we can somehow merge our PRs.
I took the time this morning to do some research regarding the API.
The api-endpoint differs for each country.

GB api.octopus.energy/v1/graphql/ API-Documentation API docs
GER api.oeg-kraken.energy/v1/graphql/ API-Documentation API docs
FR api.oefr-kraken.energy/v1/graphql/ API-Documentation API docs
IT api.oeit-kraken.energy/v1/graphql/ API-Documentation API docs
ES api.oees-kraken.energy/v1/graphql/ API-Documentation API docs
JP api.oejp-kraken.energy/v1/graphql/ API-Sample in GitHub-Repo GitHub
USA api.oeus-kraken.energy/v1/graphql/ API-Documentation API docs

And the auth-servers I found so far are
GB https://auth.octopus.energy
GER https://auth.oeg-kraken.energy
FR https://auth.oefr-kraken.energy
IT https://auth.oeit-kraken.energy
USA https://auth.oeus-kraken.energy

Right now I have only tested Germany. I dont have an account for the others to try out - and haven't checked if the APIs differ from the german one.
But I think we'd need a select-option for atleast the countrys listed above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants