victronenergy / dynamic-ess

MIT License
76 stars 5 forks source link

[Feature]: Conditional pricing to account for drop-off of subsidies when prices are negative #145

Open jnsaff opened 3 weeks ago

jnsaff commented 3 weeks ago

Contact Details

Description

In Estonia there are some subsidies that are paid for energy sold to the grid. Those subsidies are however not paid when the prices are negative.

So in the sell formula I can currently either not include the subsidy (in my case 0,537 EUR/kWH) or include the subsidy and run the risk to pay for electricity fed in during negative prices because the subsidy price component will make the net price to be positive incorrectly.

Suggested Solution

Amend the pricing formula with a function that allows to conditional components in the price calculation. For example: p - 0.005 + IF(p < 0, 0.537, 0) IF takes three arguments:

  1. comparison
  2. value returned if conditional is true
  3. value returned if conditional is false

Alternatives

Currently I don't add the subsidy as it is too risky to feed in during negative prices.

Additional Context

No response