EntsoE Binding [4.0.0;5.0.0)

Miika, thanks a lot for your contribution.

Could you (or anyone) please provide an entsoe.things file for textual config of the Thing ?
There’s setups where interactive thing creation and autodiscovery ain’t possible.

Also, I wonder how to determine if prices (item states) are up to date … is there any documentation on how this works in operations ?

Please could you add a LastUpdate timestamp channel or some such to make this known in OH ?
A configurable refresh interval maybe, too ?

Thanks again!

1 Like

Hey could you give example of things and items files, and where you can get token and where you need to write it?

But you should read at least the available docs:
items are in the readme, and as Miika wrote you need to apply for the token. You have to search a little on the Entso-E website but will get to iknow that you need to register and email support.
To answer myself, this is a valid .things file:

entsoe:dayAheadPrices:Deutschland "EntsoE Spotmarkt Preise für Deutschland" [
    area="10Y1001A1001A83F", label="Germany (DE)", securityToken="xxx-xxx-xxx"  ]

Just the “label” parameter doesn’t seem to work, the value doesn’t show up in UI but the “area” value does. @gitMiguel please let me know the correct option name.

With items there is everything fine, i understood already get the token, but there was no info about what you should write in things file and where to put that token. Thank you for info!

With the .things definition above (but also if using interactive UI thing creation), I keep getting

Request failed with API response: Code 999, Text No matching data found for Data item Day-ahead Prices [12.1.D] (10Y1001A1001A83F, 10Y1001A1001A83F) and interval 2023-12-16T22:00:00.000Z/2023-12-19T17:00:00.000Z. 

Is there anything I can do about that ?

@gitMiguel could you please have a look what’s wrong with my attempts to retrieve prices for Germany?

I keep getting the above error even when I do the HTTP query from the command line

curl -v 'https://web-api.tp.entsoe.eu/api?securityToken=xxxx-xxxx-xxxx-xxxx-xxxx&documentType=A44&in_domain=10Y1001A1001A83F&out_domain=10Y1001A1001A83F&periodStart=202312302200&periodEnd=202312311400'

According to Entso-E user guide the problem is right that: no matching data.

EDIT
Browsing Entso-E website, I came to think that the area code, although in use elsewhere, is wrong.
If you tick the standard bidding zone for Germany (I think you get something like DE+AT+CZ then), the website does neither provide any chart output.
I tried the DE-LU bidding zone 10Y1001A1001A82H and there I did get a proper chart response.
Unfortunately, your binding does not accept using this area code. Thing config gives an error saying it’s not an allowed ParameterOption.
Can you please fix that and allow for this area code ?
(best allow for free-form codes as I’d guess there’ll be more cases to show up like this one)
Thanks.

For me this binding works as expected with things the same as yours but for different country.

But I have another question - where to configure Entso binding periodic run time? Looks like it starts upon OpenHAB is started and then automatically it runs hourly. Does that mean if I restart OpenHAB at 14:02 then Entso binding will run hourly at :02 minute? If yes, how can I schedule it to run exactly at 00 minute?

EDIT:

I configured hourly EntsoE binding restart via OS crontab. As a reference, I used this post:

What’s the point in doing this ?
AFAIK pricing day-ahead data gets fixed at ~1300 CET and does not change any more after that.
No need to re-fetch.

@gitMiguel have you seen the new 4.1 features TimeSeries and EnergyPrice ?

Worth switching over asap I guess.

Noticed in debugging that prices obtained in €/MWh are output as c/kWh.
Would either need to be divided by 10 and output as ct/kWh, or remain to be labelled €/MWh

@gitMiguel do you read ?

2024-01-17 15:23:05.803 [DEBUG] [org.openhab.binding.entsoe.internal.EntsoEHandler      ] - Hours ahead: 0 - Time: 2024-01-17 15:00 - Price: 125.46 c/kWh
2024-01-17 15:23:05.830 [DEBUG] [org.openhab.binding.entsoe.internal.EntsoEHandler      ] - Hours ahead: 1 - Time: 2024-01-17 16:00 - Price: 128.56 c/kWh
2024-01-17 15:23:05.843 [DEBUG] [org.openhab.binding.entsoe.internal.EntsoEHandler      ] - Hours ahead: 2 - Time: 2024-01-17 17:00 - Price: 140.52 c/kWh
2024-01-17 15:23:05.858 [DEBUG] [org.openhab.binding.entsoe.internal.EntsoEHandler      ] - Hours ahead: 3 - Time: 2024-01-17 18:00 - Price: 123.59 c/kWh
2024-01-17 15:23:05.872 [DEBUG] [org.openhab.binding.entsoe.internal.EntsoEHandler      ] - Hours ahead: 4 - Time: 2024-01-17 19:00 - Price: 114.28 c/kWh
2024-01-17 15:23:05.886 [DEBUG] [org.openhab.binding.entsoe.internal.EntsoEHandler      ] - Hours ahead: 5 - Time: 2024-01-17 20:00 - Price: 109.8 c/kWh

Hi @gitMiguel et al,

I originally developed the aWATTar binding, which provides similar data, but only for the German and Austrian market and from a different data source. I see your binding as a successor to mine, as it supports far more countries. I would like to add two things:

  • From the aWATTar binding: The functionalities to search for cheapest hours and use that to control devices like electric heaters or car chargers.
  • Make use of TimeSeries and EnergyPrice as suggested by @mstormi .

I don’t know when I will have time for this, maybe only in a few months.

Are you interested in some cooperation, or do you prefer completing the binding yourself?

1 Like

From what I see, the items are updated on start and after that every hour but not on the hour. This means that, when the first update (after restart) happens on hh:58, all other updates are done on :58. Therefor all the entsoe based items are 58 minutes behind.

if this is correct, @furieux’ question is legit. Maybe @gitMiguel elaborate on this (if he’s still onboard) ?

Prices are fixed one day ahead and don’t change any more. So it’s irrelevant how often they’re pulled and when which minute that started.

I wasn’t talking about “being pulled”. The first channel (PriceNow)is the price of the Current hour, the next channel of now.plusHours(1), the third channel of now.plusHours(2), …

I dont’ know if the binding “pulls” every hour or once a day. It might, but is - like you said - not relevant to this remark. I only know, just as @furieux, that the binding does not update the items on the hour, but every x minutes after the hour.

Edit 1 : this is what the bindings logs when succesfull (for every item) 2024-04-23 14:15:24.952 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EnergieEntsoEPrijzen03Prijs' changed from 86.67 to 97.91
But the binding should do this ON the hour.

Edit 2 : I think the binding pulls every hour the data from Entsoe, as this error sometimes occures : 2024-04-23 14:15:24.978 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'entsoe:dayAheadPrices:belgium' changed from OFFLINE (COMMUNICATION_ERROR): java.io.IOException: java.util.concurrent.TimeoutException: Total timeout 5000 ms elapsed to ONLINE

I took a litte dive into the binding (this is out of my league) :

        if (!success) {
            refreshJob = scheduler.schedule(this::queryPricesAndUpdateChannels, 60, TimeUnit.SECONDS);
        } else {
            ZonedDateTime now = currentTime();
            ZonedDateTime nextRun = now.truncatedTo(ChronoUnit.HOURS).plusHours(1);
            Duration duration = Duration.between(now, nextRun);
            refreshJob = scheduler.schedule(this::queryPricesAndUpdateChannels, duration.getSeconds(),
                    TimeUnit.SECONDS);
        }

nextRun is “on the hour”. So why does it fire one hour after start ?

Yeah, @GeertClaes , this is exactly what I noticed and @mstormi ignored that (or didn’t understand the issue?). Perhaps he is not using Price Now?

Anyway, I also checked binding code but it is out of my knowledge. That’s why I simply scheduled binding restart every your @ 0 minutes (actually also @ 10 and 15 minutes) until someone finds a better solution. And yeah, periodically timeouts also happens but that could be because of EntsoE API instability maybe?

As far as I can tell, the code does update on the hour, but for some reason de binding does it every hour. Just like you, it’s a bit out of my league to fidle with it. At the same time, there is absence of decent logging.

I already have a PS script that fetches Entsoe, but only daily (for OH 2.5). It does not update hourly to “PriceNow”. If a solution cannot be found (for this otherwise excellent binding), i shall adapt that…

Maybe @gitMiguel can enlighten us ?

Increase loglevel.
log:set debug org.openhab.binding.entsoe
trace level even, eventually

Like I said : absence of decent logging.
In the log only every hour getting the data from Entsoe. Nothing on the hour. If I read the code correctly, the bindig should fire ON the hour, but there is nohting in the logging at those moments.
entsoe.log (69.9 KB)

So, the binding does not fire ON the hour. Why not ? (there is nothing else in other logfiles)

I am working on a solution with PS that feeds OH via the API. But your solution would be even better if we could restart the binding only once on the first hour after the startup (of the binding or the system)