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: add formulas #17002

Merged
merged 3 commits into from
Nov 6, 2024
Merged

Tariffs: add formulas #17002

merged 3 commits into from
Nov 6, 2024

Conversation

andig
Copy link
Member

@andig andig commented Oct 31, 2024

Fix #16977

Available Variables: price, charges, tax, math (go package)

Examples: Raw spot price with 0ct lower cap and 50ct upper cap

  grid:
    type: template
    template: energy-charts-api
    bzn: DE-LU
    formula: Math.Min(math.Max(price, 0), 0.5)

TODO

  • add to templates

@andig andig requested a review from naltatis October 31, 2024 09:54
@andig andig added the tariffs Specific tariff support label Oct 31, 2024
@naltatis naltatis added the needs documentation Triggers issue creation in evcc-io/docs label Nov 5, 2024
Copy link
Member

@naltatis naltatis left a comment

Choose a reason for hiding this comment

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

Hab das gerade getestet. Sieht gut aus.

@andig andig merged commit bb8bf49 into master Nov 6, 2024
8 checks passed
@andig andig deleted the feat/tariff-formulas branch November 6, 2024 14:17
@andi0b
Copy link
Contributor

andi0b commented Nov 8, 2024

@andig Großartig, danke!

charges und tax scheinen jedoch nicht übergeben zu werden und sind immer 0.0.

evcc/tariff/embed.go

Lines 42 to 45 in 1de1548

t.calc = func(price float64) (float64, error) {
if _, err := vm.Eval(fmt.Sprintf("price = %f", price)); err != nil {
return 0, err
}

@andig
Copy link
Member Author

andig commented Nov 8, 2024

Fixed in master

@timpetersson81
Copy link

@andig does this allow me to add zone based tariffs to the dynamic electricity prices?

@andig
Copy link
Member Author

andig commented Nov 10, 2024

No :(

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tariffs: improve flexibility
4 participants