Skip to content

Tariff: add time-based grid fees#29766

Merged
andig merged 1 commit into
masterfrom
feat/dynamic_charges
May 16, 2026
Merged

Tariff: add time-based grid fees#29766
andig merged 1 commit into
masterfrom
feat/dynamic_charges

Conversation

@naltatis
Copy link
Copy Markdown
Member

@naltatis naltatis commented May 8, 2026

fixes #26164

Add ability to specify time-based (month, day, time) grid fees (e.g. for §14a Dynamische Netzentgelte). These can be combined with any price tariff.

  • introduce chargesZones to overwrite existing charges for tariffs (advanced)
  • reuse logic/structure/ui from existing zones feature
  • add tariff preset to fixed tariff
  • fixed tariff with chargesZones is treated as a dynamic tariff (preferred by planner, unlock cheap grid charging for lp and battery, show chart preview, ...)

Screenshot

Bildschirmfoto 2026-05-08 um 20 43 51

@naltatis naltatis requested a review from andig May 8, 2026 18:51
@naltatis naltatis added ux User experience/ interface tariffs Specific tariff support labels May 8, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new ZoneSpec type is now shared between price zones and charge zones; consider renaming or separating the structs (e.g. PriceZoneSpec/ChargeZoneSpec) to avoid accidental cross‑use and make the semantics clearer at the call sites.
  • In embed.effectiveCharges, you force timestamps to Local() before resolving zones; if tariffs should respect the original location on ts, it may be safer to rely on ts.Location() or document that all tariff time logic is explicitly local-time based.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `ZoneSpec` type is now shared between price zones and charge zones; consider renaming or separating the structs (e.g. `PriceZoneSpec`/`ChargeZoneSpec`) to avoid accidental cross‑use and make the semantics clearer at the call sites.
- In `embed.effectiveCharges`, you force timestamps to `Local()` before resolving zones; if tariffs should respect the original location on `ts`, it may be safer to rely on `ts.Location()` or document that all tariff time logic is explicitly local-time based.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@andig
Copy link
Copy Markdown
Member

andig commented May 9, 2026

Not sure I undestand. This is basically a UI wrapper for the fixed tariff?

@andig andig added the needs documentation Triggers issue creation in evcc-io/docs label May 9, 2026
@andig
Copy link
Copy Markdown
Member

andig commented May 9, 2026

Whats the scope of these fees: any import/export tariff? Only on on fixed tariff?

@naltatis
Copy link
Copy Markdown
Member Author

naltatis commented May 9, 2026

Not sure I undestand. This is basically a UI wrapper for the fixed tariff?

This is the ability to enter time-based grid fees for "all" price tariffs, import and export context.

In this process the fixed template also received the tariff-base preset so users with a constant energy price and dynamic grid fees dont have to recalculate all slots when the energy tariff changes it's regular price (see issue).
For fixed tariffs you could previously model this by using zones and calculate manually. For complex tariffs (api data) you previously had to use complex formula stuff. See examples in https://docs.evcc.io/en/docs/tariffs#custom-formulas

@andig andig merged commit 908e6cf into master May 16, 2026
19 checks passed
@andig andig deleted the feat/dynamic_charges branch May 16, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs documentation Triggers issue creation in evcc-io/docs tariffs Specific tariff support ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add charges / gridfee to grid type "fixed" / §14 Modul 3

2 participants