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 to ENTSO-e #17417

Closed
wants to merge 1 commit into from

Conversation

bartashevich
Copy link

Fix #12371

Example for BZN|PT domain with feedin and grid:

tariffs:
  feedin:
    type: entsoe
    domain: BZN|PT
    securitytoken: xxxxxx
    charges: 0
    tax: 0
  grid:
    type: entsoe
    domain: BZN|PT
    securitytoken: xxxxxx
    charges: 0
    tax: 0
    formula: (price + 0.004 + 0.0028930 + 0.010)*(1 + 0.16) + 0.005
    zones:
      - days: Sun-Sat
        hours: 0-7
        price: 0.0157
      - days: Sun-Sat
        hours: 8-21
        price: 0.0860
      - days: Sun-Sat
        hours: 22-23
        price: 0.0157

Same code can be added to other tariffs. Once it reaches final version.

@andig andig added the tariffs Specific tariff support label Nov 23, 2024
@andig andig marked this pull request as draft November 23, 2024 21:41
@andig andig self-assigned this Nov 23, 2024
@andig
Copy link
Member

andig commented Nov 24, 2024

@bartashevich thank you for this PR. Unfortunately, we can't implement it this way: your PR largely duplicates the code that we already have in the fixed tariff. Instead, we need to reuse as much as possible, much more if we want to add this to other tariffs.

Also: your example of adding prices for zones is confusing. The price already comes from ENTSO-E, so why would you want to manually define it?

@bartashevich
Copy link
Author

@bartashevich thank you for this PR. Unfortunately, we can't implement it this way: your PR largely duplicates the code that we already have in the fixed tariff. Instead, we need to reuse as much as possible, much more if we want to add this to other tariffs.

Also: your example of adding prices for zones is confusing. The price already comes from ENTSO-E, so why would you want to manually define it?

Fixed zone pricing seems a bit more complex and not easy to adapt for dynamic pricing.

In terms of ENTSO-E, price come in raw and we have a lot of custom taxes to apply. And on top of that, we need to apply zoned pricing.

I wasn't expecting for this PR to be merged right away. I'm happy to keep on working on this until we reach ideal solution.

@andig
Copy link
Member

andig commented Nov 24, 2024

In terms of ENTSO-E, price come in raw and we have a lot of custom taxes to apply. And on top of that, we need to apply zoned pricing.

It still seems your example is not using the Entso price add all?

@andig
Copy link
Member

andig commented Nov 24, 2024

Also note #17414 which could be used instead of zones?

ar := api.Rate{
Start: r.Start,
End: r.End,
Price: t.totalPrice(r.Value),
Price: t.totalPrice(r.Value) + zonePrice,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andig here zone price is added to ENTSO-e price

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Imho that‘s more rigid than necessary.

@bartashevich
Copy link
Author

Also note #17414 which could be used instead of zones?

Can you provide me an example where I can apply both:

  • formula: (price + 0.004 + 0.0028930 + 0.010)*(1 + 0.16) + 0.005
  • "+ (0.0157 if hour < 8 or hour > 23 else 0.0860)"

@bartashevich
Copy link
Author

@andig, What about reusing code from fixed zones by implementing sum of 2 tariffs?

If dynamic tariff have zones, it would create fixed tariff entity and then it would sum to current dynamic tariff.

Do you think that would work?

@andig
Copy link
Member

andig commented Nov 24, 2024

Can you provide me an example where I can apply both:

How about, instead of adding zones:

charges := 0.0860
if hr := ts.Hour(); hr < 8 || hr >= 23 {
    charges = 0.0157
}
(price + 0.004 + 0.0028930 + 0.010) * 1.16 + 0.005 + charges

/cc @VolkerK62 @naltatis bzgl. Doku

@bartashevich
Copy link
Author

dismissed in favor of #17414

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 this pull request may close these issues.

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