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

Tariff: add dynamic/zones charges #12871

Closed
wants to merge 4 commits into from
Closed

Tariff: add dynamic/zones charges #12871

wants to merge 4 commits into from

Conversation

andig
Copy link
Member

@andig andig commented Mar 11, 2024

Fix #12371

Use zones similar to fixed tariff to add zoned charges.

TODO

  • Entso-E
  • Energinet
  • ...

@andig andig added the enhancement New feature or request label Mar 11, 2024
@github-actions github-actions bot added the stale Outdated and ready to close label Apr 5, 2024
@github-actions github-actions bot closed this Apr 11, 2024
@andig andig deleted the feat/dynamic-charges branch April 21, 2024 19:48
@jirimissbach
Copy link

Hello @andig , I like this feature and would like to do the testing. Is this part of the nightly? Sorry, I'm not GitHub pro ...

@andig
Copy link
Member Author

andig commented May 6, 2024

No, it needs be checked out/ compiled locally.

@jirimissbach
Copy link

No, it needs be checked out/ compiled locally.

ahh, ok. Not sure I have the required knowledge to do so. Will do some reading

@jirimissbach
Copy link

jirimissbach commented May 9, 2024

@andig I have checked out and compiled locally. As a test, I have copied over the configuration I'm using for my "production" evcc (https://github.com/evcc-io/evcc/releases/tag/0.126.2). The ENTSOE tariff works at my production server, however does not work with the test

[main ] INFO 2024/05/09 11:50:39 evcc 0.124.9 (d90ef16)
[main ] INFO 2024/05/09 11:50:39 using config file: /home/jirimissbach/evcc/evcc/evcc.yaml
[main ] INFO 2024/05/09 11:50:39 starting ui and api at :7070
[entsoe] ERROR 2024/05/09 11:50:46 no matching rate
[entsoe] ERROR 2024/05/09 11:50:46 no matching rate
[main ] ERROR 2024/05/09 11:50:46 failed configuring grid tariff: cannot create tariff type 'entsoe': no matching rate

I might have crewed up something somewhere but are there any logs I can provide you to understand whether this error is related to #12871?

tariffs:
#  currency: EUR # three letter ISO-4217 currency code (default EUR)
  grid:
     type: entsoe # Entso-E european market data
     domain: BZN|CZ # https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_areas
     securitytoken: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

@jirimissbach
Copy link

also to add more details (well, still few) - I have chenged the log level to TRACE

jirimissbach@ubuntu-server:~/evcc/evcc$ cat  ./trace.txt | grep entsoe
[entsoe] TRACE 2024/05/13 18:16:35 GET https://web-api.tp.entsoe.eu/api?DocumentType=A44&In_Domain=10YCZ-CEPS-----N&Out_Domain=10YCZ-CEPS-----N&PeriodEnd=202405141800&PeriodStart=202405131800&securityToken=***
[entsoe] TRACE 2024/05/13 18:16:36 <?xml version="1.0" encoding="UTF-8"?>
[entsoe] ERROR 2024/05/13 18:16:36 no matching rate
[entsoe] ERROR 2024/05/13 18:16:36 no matching rate
[main  ] ERROR 2024/05/13 18:16:36 failed configuring grid tariff: cannot create tariff type 'entsoe': no matching rate

@andig
Copy link
Member Author

andig commented May 13, 2024

Sorry, very busy right now…

@andig
Copy link
Member Author

andig commented May 13, 2024

.

@jirimissbach
Copy link

no worries, I'm sorry I can't help more. I have checked the trace in more details and adding the whole part I believe is relevant. Not sure where the "no matching rate" comes from - the api provides position and price.amount. Also, the same config works in later EVCC version so assuming there is some error there.

Whenever you have time, I'm happy to test any changes and provide more logs

[entsoe] TRACE 2024/05/13 18:16:35 GET https://web-api.tp.entsoe.eu/api?DocumentType=A44&In_Domain=10YCZ-CEPS-----N&Out_Domain=10YCZ-CEPS-----N&PeriodEnd=202405141800&PeriodStart=202405131800&securityToken=***
[entsoe] TRACE 2024/05/13 18:16:36 <?xml version="1.0" encoding="UTF-8"?>
<Publication_MarketDocument xmlns="urn:iec62325.351:tc57wg16:451-3:publicationdocument:7:0">
        <mRID>8e09cadcb2fe4dab8a67fbd7357dfaa5</mRID>
        <revisionNumber>1</revisionNumber>
        <type>A44</type>
        <sender_MarketParticipant.mRID codingScheme="A01">10X1001A1001A450</sender_MarketParticipant.mRID>
        <sender_MarketParticipant.marketRole.type>A32</sender_MarketParticipant.marketRole.type>
        <receiver_MarketParticipant.mRID codingScheme="A01">10X1001A1001A450</receiver_MarketParticipant.mRID>
        <receiver_MarketParticipant.marketRole.type>A33</receiver_MarketParticipant.marketRole.type>
        <createdDateTime>2024-05-13T18:16:36Z</createdDateTime>
        <period.timeInterval>
                <start>2024-05-12T22:00Z</start>
                <end>2024-05-14T22:00Z</end>
        </period.timeInterval>
        <TimeSeries>
                <mRID>1</mRID>
                <businessType>A62</businessType>
                <in_Domain.mRID codingScheme="A01">10YCZ-CEPS-----N</in_Domain.mRID>
                <out_Domain.mRID codingScheme="A01">10YCZ-CEPS-----N</out_Domain.mRID>
                <currency_Unit.name>EUR</currency_Unit.name>
                <price_Measure_Unit.name>MWH</price_Measure_Unit.name>
                <curveType>A01</curveType>
                        <Period>
                                <timeInterval>
                                        <start>2024-05-12T22:00Z</start>
                                        <end>2024-05-13T22:00Z</end>
                                </timeInterval>
                                <resolution>PT60M</resolution>
                                        <Point>
                                                <position>1</position>
                                                <price.amount>19.28</price.amount>
                                        </Point>
                                        <Point>
                                                <position>2</position>
                                                <price.amount>19.46</price.amount>
                                        </Point>
                                        <Point>
                                                <position>3</position>
                                                <price.amount>21.45</price.amount>
                                        </Point>
                                        <Point>
                                                <position>4</position>
                                                <price.amount>20.29</price.amount>
                                        </Point>
                                        <Point>
                                                <position>5</position>
                                                <price.amount>20.68</price.amount>
                                        </Point>
                                        <Point>
                                                <position>6</position>
                                                <price.amount>53.53</price.amount>
                                        </Point>
                                        <Point>
                                                <position>7</position>
                                                <price.amount>85.21</price.amount>
                                        </Point>
                                        <Point>
                                                <position>8</position>
                                                <price.amount>106.47</price.amount>
                                        </Point>
                                        <Point>
                                                <position>9</position>
                                                <price.amount>77.25</price.amount>
                                        </Point>
                                        <Point>
                                                <position>10</position>
                                                <price.amount>41.75</price.amount>
                                        </Point>
                                        <Point>
                                                <position>11</position>
                                                <price.amount>10.62</price.amount>
                                        </Point>
                                        <Point>
                                                <position>12</position>
                                                <price.amount>-0.97</price.amount>
                                        </Point>
                                        <Point>
                                                <position>13</position>
                                                <price.amount>-4.05</price.amount>
                                        </Point>
                                        <Point>
                                                <position>14</position>
                                                <price.amount>-1.27</price.amount>
                                        </Point>
                                        <Point>
                                                <position>15</position>
                                                <price.amount>-2.46</price.amount>
                                        </Point>
                                        <Point>
                                                <position>16</position>
                                                <price.amount>-0.10</price.amount>
                                        </Point>
                                        <Point>
                                                <position>17</position>
                                                <price.amount>7.86</price.amount>
                                        </Point>
                                        <Point>
                                                <position>18</position>
                                                <price.amount>70.38</price.amount>
                                        </Point>
                                        <Point>
                                                <position>19</position>
                                                <price.amount>95.37</price.amount>
                                        </Point>
                                        <Point>
                                                <position>20</position>
                                                <price.amount>141.09</price.amount>
                                        </Point>
                                        <Point>
                                                <position>21</position>
                                                <price.amount>129.20</price.amount>
                                        </Point>
                                        <Point>
                                                <position>22</position>
                                                <price.amount>100.52</price.amount>
                                        </Point>
                                        <Point>
                                                <position>23</position>
                                                <price.amount>86.64</price.amount>
                                        </Point>
                                        <Point>
                                                <position>24</position>
                                                <price.amount>74.80</price.amount>
                                        </Point>
                        </Period>
        </TimeSeries>
        <TimeSeries>
                <mRID>2</mRID>
                <businessType>A62</businessType>
                <in_Domain.mRID codingScheme="A01">10YCZ-CEPS-----N</in_Domain.mRID>
                <out_Domain.mRID codingScheme="A01">10YCZ-CEPS-----N</out_Domain.mRID>
                <currency_Unit.name>EUR</currency_Unit.name>
                <price_Measure_Unit.name>MWH</price_Measure_Unit.name>
                <curveType>A01</curveType>
                        <Period>
                                <timeInterval>
                                        <start>2024-05-13T22:00Z</start>
                                        <end>2024-05-14T22:00Z</end>
                                </timeInterval>
                                <resolution>PT60M</resolution>
                                        <Point>
                                                <position>1</position>
                                                <price.amount>59.54</price.amount>
                                        </Point>
                                        <Point>
                                                <position>2</position>
                                                <price.amount>42.15</price.amount>
                                        </Point>
                                        <Point>
                                                <position>3</position>
                                                <price.amount>34.76</price.amount>
                                        </Point>
                                        <Point>
                                                <position>4</position>
                                                <price.amount>30.40</price.amount>
                                        </Point>
                                        <Point>
                                                <position>5</position>
                                                <price.amount>46.72</price.amount>
                                        </Point>
                                        <Point>
                                                <position>6</position>
                                                <price.amount>67.23</price.amount>
                                        </Point>
                                        <Point>
                                                <position>7</position>
                                                <price.amount>85.00</price.amount>
                                        </Point>
                                        <Point>
                                                <position>8</position>
                                                <price.amount>87.15</price.amount>
                                        </Point>
                                        <Point>
                                                <position>9</position>
                                                <price.amount>47.68</price.amount>
                                        </Point>
                                        <Point>
                                                <position>10</position>
                                                <price.amount>8.60</price.amount>
                                        </Point>
                                        <Point>
                                                <position>11</position>
                                                <price.amount>0.41</price.amount>
                                        </Point>
                                        <Point>
                                                <position>12</position>
                                                <price.amount>-11.44</price.amount>
                                        </Point>
                                        <Point>
                                                <position>13</position>
                                                <price.amount>-23.53</price.amount>
                                        </Point>
                                        <Point>
                                                <position>14</position>
                                                <price.amount>-31.93</price.amount>
                                        </Point>
                                        <Point>
                                                <position>15</position>
                                                <price.amount>-28.09</price.amount>
                                        </Point>
                                        <Point>
                                                <position>16</position>
                                                <price.amount>-16.30</price.amount>
                                        </Point>
                                        <Point>
                                                <position>17</position>
                                                <price.amount>0.65</price.amount>
                                        </Point>
                                        <Point>
                                                <position>18</position>
                                                <price.amount>32.98</price.amount>
                                        </Point>
                                        <Point>
                                                <position>19</position>
                                                <price.amount>80.43</price.amount>
                                        </Point>
                                        <Point>
                                                <position>20</position>
                                                <price.amount>98.40</price.amount>
                                        </Point>
                                        <Point>
                                                <position>21</position>
                                                <price.amount>130.87</price.amount>
                                        </Point>
                                        <Point>
                                                <position>22</position>
                                                <price.amount>87.34</price.amount>
                                        </Point>
                                        <Point>
                                                <position>23</position>
                                                <price.amount>62.60</price.amount>
                                        </Point>
                                        <Point>
                                                <position>24</position>
                                                <price.amount>62.27</price.amount>
                                        </Point>
                        </Period>
        </TimeSeries>
</Publication_MarketDocument>
[entsoe] ERROR 2024/05/13 18:16:36 no matching rate
[entsoe] ERROR 2024/05/13 18:16:36 no matching rate
[main  ] ERROR 2024/05/13 18:16:36 failed configuring grid tariff: cannot create tariff type 'entsoe': no matching rate

@bartashevich
Copy link

Hi, can this branch be re-open? I can test and help improve.

@andig
Copy link
Member Author

andig commented Nov 14, 2024

There's nothing to test yet :(

@bartashevich
Copy link

Is it feasible to add time to formula instead of building zones? I use entos-e and following formula to calculate price:

{% set PM = current_price*1000|float -%}
{% set CGS = 4 -%}
{% set GO = 5 -%}
{% set TSE = 2.8930 -%}
{% set k = 10 -%}
{% set FP = 0.16 -%}
{% set TAR_off_peak = 15.7 -%}
{% set TAR_peak = 86.0 -%}
{% set TAR = TAR_off_peak if now().hour < 8 or now().hour > 21 else TAR_peak -%}
{{ ((PM + CGS + TSE + k)*(1 + FP) + TAR + GO)/1000 | round(4) }}

@andig
Copy link
Member Author

andig commented Nov 17, 2024

That should be reasonable. Would ts like timestamp suffice or do we need start and end both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Outdated and ready to close
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tariffs: add time-dependent charges (peak and off-peak)
3 participants