Energi Data Service Binding [3.4.0.0;4.0.0.0)

logo

This binding integrates the Danish service Energi Data Service, making data available as:

  • Channels with current prices.
  • An advanced channel with future prices in JSON format.
  • Thing action for importing the prices directly into rules.

In this initial version, electricity prices are in focus, specifically the datasets Elspotprices and DatahubPricelist.

The binding is mainly targeting Denmark because of the tariffs and taxes provided which are specific to the Danish market and in currency DKK. However, spot prices can also be retrieved for other regions, for example Norway and Sweden.

Features

  • Optimized service calls: Spot prices are retrieved once per day and tariffs only upon expiry (usually months/years).
  • Error handing: Policies for retry strategies are in place to make sure data will be retrieved as soon as possible after failed calls. This includes exponential back-off with jitter.
  • Channel configuration for adding VAT to prices based on openHAB regional settings.
  • Grid company is selectable in configuration.
  • Pre-configured filters are included for all known grid companies.
  • Filters can be overridden by channel configuration.
  • Spot prices and all tariffs are supported.
  • Properties shows number of remaining calls as well as timestamp of last/next call.
  • Actions for getting prices and performing calculations.

Changelog

Version 0.1

  • Initial release

Version 0.2

Version 0.3

  • Rename all channels again
  • VAT support has been removed
  • Add grid company Midtfyns Elforsyning

Resources

org.openhab.binding.energidataservice-3.4.2-SNAPSHOT.jar

Source code

README

4 Likes

I’m using this bindingon my OH 3.4.5 system, here in DK and beginning to setup the thing actions for price calculations, and I think there is something wrong with either my understanding of the time settings, or the way the time calculations are done.

I’m trying to use the calculateCheapestPeriod action to show me the cheapest hour within the next XX hours. I’m doing this using the example from the docs:

val actions = getActions("energidataservice", "energidataservice:service:e729711749")

var java.util.Map<String, Object> result = actions.calculateCheapestPeriod(now.toInstant(), now.plusHours(24).toInstant(), java.time.Duration.ofMinutes(60))

logInfo("Cheapest start", (result.get("CheapestStart") as Instant).toString)

Result: 2024-01-13T04:00:00Z

However when reading the Hourly Prices item JSON the cheapest hour is actually 05:00:00Z

{"hourStart":"2024-01-13T04:00:00Z","spotPrice":0.51251001,...
{"hourStart":"2024-01-13T05:00:00Z","spotPrice":0.486040009,

I’ve checked spot prices in a browser and the Hourly Prices JSON shows the correct prices for zulu time - and the price for 05:00Z is within the plusHours I am checking for.

If I run now.toString() I get my correct local DK time with an offset of +01:00:

2024-01-12T23:21:43.724386+01:00[Europe/Berlin]

There is probably something obvious I am missing, that you can spot?

Cheers
Mark

Most likely the issue is related to the part of the XML you have cut out from your example. :wink: calculateCheapestPeriod will not only consider spot prices, but all price components. 2024-01-13T04:00:00Z is the hour 05:00-06:00 CET, and this is probably the cheapest. With tariff model 3.0 you will most likely run into higher tariffs at 06:00, although I don’t know your configured grid company.

Please be aware that the hourly-prices channel is planned for removal in openHAB 4.2. In openHAB 4.1 you can use in-memory persistence for accessing future prices published as time series. And you can already in 3.4 use thing action getPrices to get all prices into your rules.

You are absolutely right. And indeed all price components rightly should be considered, obviously! :crazy_face:

I just never considered that the tariffs changed, and I never ever heard about tariff model 3.0, so I figured the spotprices were the only variable. Good thing this came up and you made me aware.

Now I know I need to take different factors into account (or rather your binding does all the work for me).

But thanks for taking me to school! :stuck_out_tongue_closed_eyes: :grin:

Much appreciated and happy new year! :partying_face: