Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tariffs calculated incorrectly with data source from ENTSOE when currency is other than EUR #17580

Closed
1 task done
Millox opened this issue Dec 4, 2024 · 5 comments · Fixed by #17628
Closed
1 task done
Labels
tariffs Specific tariff support

Comments

@Millox
Copy link
Contributor

Millox commented Dec 4, 2024

Describe the bug

The calculation of the current price for electricity is done incorrectly when using other than EUR for the ENTSOE tariff price source. The api always fetches the price in EUR, but the presentation is in local currency, which in the case of SEK leads to an underestimation of the electricity price by a factor of 10.

Currently (2024-12-04, 08:00-09:00) the price in SE4 is 3.13 SEK/kWh which is 0.27 EUR/kWh

Calculation from EVCC:
image

Expected (with configuration as below):
(3.13 + 0.73744) * 1.25 = 4.8 SEK / kWh

Actual:
(0.270 + 0.73744) * 1.25 = 1.26 SEK / kWh

Steps to reproduce

  1. Configure tariffs with currency other than EUR
  2. Configure price fetching from entso-e

Configuration details

tariffs:
  currency: SEK
  grid:
    type: entsoe
    domain: BZN|SE4
    securitytoken: xxx
    charges: 0.73744
    tax: 0.25

Log details

-

What type of operating system are you running?

Linux

Nightly build

  • I have verified that the issue is reproducible with the latest nightly build

Version

0.137.7

@andig
Copy link
Member

andig commented Dec 4, 2024

The api always fetches the price in EUR

I'm not familiar with it- does it offer anything else? Maybe we could also return local currency.

but the presentation is in local currency

Presentation is as configured by user. If you have EUR data you'll need to configure EUR or convert the currency. evcc does not do any automatic conversion.

Alternative solution: use a formula for currency conversion using #17002

@andig andig added the tariffs Specific tariff support label Dec 4, 2024
@bartashevich
Copy link

I think ENTSO-e only provides EUR Tariff.

Try following to convert to your local currency:

tariffs:
  currency: SEK
  grid:
    type: entsoe
    domain: BZN|SE4
    securitytoken: xxx
    charges: 0
    tax: 0
    formula: (price*11.5765 + 0.73744) * 1.25

@Millox
Copy link
Contributor Author

Millox commented Dec 4, 2024

Yeah, so... Obviously I wasn't very happy with this response, static exchange rate will always be a hack, and apparently ENTSO-E only provides EUR data as stated above. SOOO, I kinda fixed it in another way

./evcc -c evcc.yaml tariff -l debug
[main ] INFO 2024/12/04 21:32:40 evcc 0.131.8 (55d3c8e)
[main ] INFO 2024/12/04 21:32:40 using config file: evcc.yaml
[db ] INFO 2024/12/04 21:32:40 using sqlite database: /home/mattias/.evcc/evcc.db
[mqtt ] INFO 2024/12/04 21:32:40 connecting evcc-586182962 at tcp://localhost:1883
[mqtt ] DEBUG 2024/12/04 21:32:40 tcp://localhost:1883 connected
[nordpool] DEBUG 2024/12/04 21:32:40 downloading price data
grid:
From To Price/Cost
2024-12-04 23:00:00 2024-12-05 00:00:00 0.652
2024-12-05 00:00:00 2024-12-05 01:00:00 0.646
2024-12-05 01:00:00 2024-12-05 02:00:00 0.648
2024-12-05 02:00:00 2024-12-05 03:00:00 0.642
2024-12-05 03:00:00 2024-12-05 04:00:00 0.642
2024-12-05 04:00:00 2024-12-05 05:00:00 0.664
2024-12-05 05:00:00 2024-12-05 06:00:00 1.059
2024-12-05 06:00:00 2024-12-05 07:00:00 1.620
2024-12-05 07:00:00 2024-12-05 08:00:00 1.595
2024-12-05 08:00:00 2024-12-05 09:00:00 1.481
2024-12-05 09:00:00 2024-12-05 10:00:00 1.405
2024-12-05 10:00:00 2024-12-05 11:00:00 1.207
2024-12-05 11:00:00 2024-12-05 12:00:00 0.894
2024-12-05 12:00:00 2024-12-05 13:00:00 0.833
2024-12-05 13:00:00 2024-12-05 14:00:00 0.739
2024-12-05 14:00:00 2024-12-05 15:00:00 0.736
2024-12-05 15:00:00 2024-12-05 16:00:00 0.721
2024-12-05 16:00:00 2024-12-05 17:00:00 0.709
2024-12-05 17:00:00 2024-12-05 18:00:00 0.615
2024-12-05 18:00:00 2024-12-05 19:00:00 0.483
2024-12-05 19:00:00 2024-12-05 20:00:00 0.371
2024-12-05 20:00:00 2024-12-05 21:00:00 0.375
2024-12-05 21:00:00 2024-12-05 22:00:00 0.416
2024-12-05 22:00:00 2024-12-05 23:00:00 0.346

This was based on the energinet tariff source, but uses Nordpool data instead which have SE/NO/DK and other areas as well. Will create pull request as soon as I have figured out how to. And cleaned up the code somewhat.

Maybe close this bug report with a documentation update only and then I will provide the Nordpool tariff source later.

@andig
Copy link
Member

andig commented Dec 4, 2024

Don‘t eneginet and elering also provide Nordpool data? If we can get them from the source that wouldn‘t hurt 👍🏻

@andig andig closed this as completed Dec 4, 2024
@Millox
Copy link
Contributor Author

Millox commented Dec 5, 2024

Nordpool provides data for
["EE","LT","LV","AT","BE","FR","GER","NL","PL","DK1","DK2","FI","NO1","NO2","NO3","NO4","NO5","SE1", "SE2","SE3","SE4","TEL","SYS"]
in currencies
["DKK","EUR","NOK","PLN","RON","SEK"]

Although some combinations do not report any values according to my testing. I just noticed the Nordpool feature request and will attach a patch to that thread when I've cleaned up the code a bit so that more people can test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tariffs Specific tariff support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants