evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Integrate with ENTSO-E Day ahead pricing

Open bsmout opened this issue 3 years ago • 12 comments

Lots of dynamic tarifs are based on day ahead pricing for the specific region (country). It would be great if tariffs could be based on those day ahead prices. For example ENTSO-E is an Europe funded service that provides a free API.

Clients for the API are available on Github.

More info: https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html

bsmout avatar Nov 27 '22 22:11 bsmout

Why would you want to do that?

andig avatar Nov 28 '22 09:11 andig

To charge when electricity prices are the lowest ? If you have a dynamic rate tarif that changes every hour you want to charge your EV as cheap as possible.

bsmout avatar Nov 28 '22 19:11 bsmout

Sure. But then you would integrate that tariff as we‘re already doing, not Entso.

andig avatar Nov 28 '22 19:11 andig

When https://github.com/evcc-io/evcc/pull/5445 is finished, we can add additional plan data for target charging. Same approach as discussed in https://github.com/evcc-io/evcc/pull/5445#issuecomment-1346809709.

andig avatar Dec 12 '22 16:12 andig

OK, after more consideration looks like ENTSO-E Day ahead pricing would be the best one to use, and pricing matches my local market pricing data exactly, using mac/safari (For some reason it showed wrong pricing when I used iphone to browse it) So Nordpool data api is not needed.

RTTTC avatar Dec 12 '22 22:12 RTTTC

Could we reopen this?

RTTTC avatar Dec 13 '22 20:12 RTTTC

Now that we have a planner it would be nice to add minimal-CO2 planning. I'm not so keen on ENTSO prices as that's not what the user pays anyway, but would prefer CO2 load. Would appreciate suggestions for finding the relevant ENTSO reports and example data interpretation.

andig avatar Dec 27 '22 17:12 andig

/cc @thorstenwagner

andig avatar Dec 27 '22 17:12 andig

"Smart rate" is supposedly most popular utility option in Scandinavia, where customers have smart meters and electricity price is different every hour, as per Nordpool (ENTSO) local area day ahead pricing (plus margin and any taxes)

RTTTC avatar Dec 27 '22 20:12 RTTTC

Now that we have a planner it would be nice to add minimal-CO2 planning. I'm not so keen on ENTSO prices as that's not what the user pays anyway, but would prefer CO2 load. Would appreciate suggestions for finding the relevant ENTSO reports and example data interpretation.

Based on what are you stating that ? I'm paying ENTSO pricing (with a very small margin and taxes).

bsmout avatar Dec 27 '22 20:12 bsmout

At least not in Germany. I‘m interested in co2 minimization.

andig avatar Dec 27 '22 21:12 andig

More info: https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html

4.2.10. Day Ahead Prices [12.1.D] for day-ahead pricing API

RTTTC avatar Jan 12 '23 08:01 RTTTC

This integration would be such a great evolution of evcc!

RTTTC avatar Feb 11 '23 17:02 RTTTC

There is missing a lot of tariffs providers. Maybe look at this https://github.com/MTrab/energidataservice and convert it? or just pull the data form homeassistant?

Scholdan avatar Mar 20 '23 14:03 Scholdan

@duckfullstop if you want to take a stab? Entso prices would be nice but the API is a complex.

andig avatar Sep 03 '23 09:09 andig

4.2.10. Day Ahead Prices [12.1.D] for day-ahead pricing API

This looks quite achievable (even if it does mean working with XML), I can take a bit more of a look into it in the coming week hopefully?

I'm not sure about CO2 forecasting, I don't think specific data on that is provided by ENTSO-E and we'd probably have to calculate estimates ourselves, which is a pretty big task, arguably out of scope for evcc, and unfortunately probably done best at the continent level by services like electricitymaps, etc. (Someone feel free to correct me but I couldn't find anything relevant in the documentation from a quick look)

duckfullstop avatar Sep 03 '23 14:09 duckfullstop

Year, CO2 means mangling production and consumption plus specific CO2 per production type. I wouldn't try that honestly.

andig avatar Sep 03 '23 14:09 andig

Spent a little time reading the documentation for ENTSO-E in more detail, and section 2. has some specific requirements for requesting an API key:

To request access to the Restful API, please register on the Transparency Platform (link) and send an email to [email protected] with “Restful API access” in the subject line. Indicate the email address you entered during registration in the email body. The ENTSO-E Helpdesk will make their best efforts to respond to your request within 3 working days.

https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_authentication_and_authorisation

This feels like they don't intend this API for use by end users - I'm still happy to request a key and implement it, but it will substantially limit user friendliness if you have to register an account and then wait 3 days before you can request an API key.

duckfullstop avatar Sep 03 '23 19:09 duckfullstop

Maybe we could all use one key ? evcc as an organisation?

RTTTC avatar Sep 03 '23 19:09 RTTTC

Maybe we could all use one key ? evcc as an organisation?

Doesn't seem to be the case, these keys seem to be private use only:

If you suspect that the token has been compromised, you must reset the token by yourself. If the token is missing or invalid (including suspended account), the system will respond with Http 401 Unauthorized.

I'm pretty sure some of these calls could be quite heavy (like repeatedly calling for decades of complex data at once), so it's not a surprise this restriction exists.

Handling this in evcc cloud is an option (maybe with some heavy caching), but feels like possibly the wrong route to take, as it creates a single point of failure under our control.

duckfullstop avatar Sep 03 '23 19:09 duckfullstop

The Home Assistant ENTSO-E plugin has just come to my attention, and that seems to be popular enough even with the API key restriction, so I'll go ahead and request a key and look into implementing this. @andig reopen this issue?

duckfullstop avatar Sep 05 '23 13:09 duckfullstop

I have received an API key, starting work on implementing this now. Should have something rudimentary by next week at the latest (my health's a bit up and down!).

duckfullstop avatar Sep 06 '23 21:09 duckfullstop

@bsmout @RTTTC @djfanatix Hey there! I'm busy implementing this for you now in #9794, but as someone that's never really dealt with european tariffs, it would be beneficial to know how you would expect this to work once it's finished.

Does your provider give you a specific ENTSO-E domain code (i.e 10YDE-ENBW-----N for DETransnetW, for example), or would you expect to just define something like DETransnetW or NL for example?

And when it comes to how you get charged based on these rates, is it a simple multiplier (say 115% of the ENTSO-E cost), or would more advanced math be needed (say (rate * 1.15) + 0.02)?

Many thanks in advance!

duckfullstop avatar Sep 08 '23 17:09 duckfullstop

Hi,

Speaking for Belgium, but I think for the netherlands, germany and some other countries it is the same. We have only 1 spot price, so BE,NL,DE,.. will be sufficient.

The different providers use a calculation which is complicated:

(((Entsoespot* 1.15) + 0.02)*tax) + government costs)

djfanatix avatar Sep 08 '23 17:09 djfanatix

Tbo, we don‘t necessarily need the exact costs. I‘d prefer to keep an identical model across tariffs, currently in embed.go.

andig avatar Sep 08 '23 17:09 andig

I would expect to use country code (LT) There are a couple of countries in EU that have few regions per country, such as Sweden, UK, Norway. In such case there is NO1, NO2 etc. (As per ENTSO-E)

For me price = (rate + fixed addon fees)*1,21 (VAT) https://github.com/evcc-io/evcc/pull/7437 integration works perfectly for me (may be helpful to check out it's implementation?)

  planner:
    # planner tariff can be used for target charging if no grid tariff is specified
    type: elering
    region: lt
    charges: 0.07825 # EUR/kWh
    tax: 0.21 # This would be 21% VAT

This way I get exact cost, and I love it! ❤️

RTTTC avatar Sep 08 '23 17:09 RTTTC

Think that is https://github.com/evcc-io/evcc/blob/master/tariff/embed.go

andig avatar Sep 08 '23 18:09 andig