Hallo,
hab mal eben ne Simulation rechnen lassen, was mein exportierter Strom basierend auf meinen Daten in Home Assistant an der Börse wert wäre. Mit stündlich aufgelösten Daten (mehr hab ich leider noch nicht für ein ganzes Jahr) ergab das 4.14 ct/kWh wenn so eingespeist wird, wie ich das die letzten 365 Tage eben gemacht habe. Mit dem Abzug für mein früheres BKW bekomme ich so etwa 8 ct/kWh.
Die weiteren Ergebnisse haben mich dann etwas überrascht (hab den Code allerdings noch nicht verifiziert, ob das wirklich so sein kann).
Würde ich den Strom gleichmäßig über die 24h verteilt einspeisen, sollten 10.1 ct/kWh drin sein, mit einem Limit von 3kW für den Multiplus und 10 kWh dafür nutzbare Akkukapazität 12.2 ct/kWh. Wie die KI auch selber anmerkt, wäre für eine realistischere Betrachtung natürlich auch die Nutzung des Akkus (14 kWh LV) für den Eigenbedarf zu betrachten und entstünden ja auch noch mehr Stromverluste durch den Akku+Multiplus mit bei mir wohl so 73% round trip Effizienz. Aktuell bleibt er ja recht voll und das was exportiert wird, kommt direkt von der PV wenn der Akku voll ist.
Fazit für mich: Immerhin die Hälfte dessen, was ich für meinen Strom jetzt mit EEG bekomme, ist er auch wert. Mit entsprechendem EMS Software-Aufwand und Strom-Verlusten durch Nutzung des Akkus wäre es ggf. mit den historischen Daten möglich, die EEG Vergütung an der Börse einzuspielen. Abzüglich natürlich der ganzen Kosten für imSys, Vertriebsorganisation und wer sonst noch so die Hand dafür aufhält. Aktuell als good-will wäre es höchstens ohne eigene Verluste möglich in Zeiten mit ausreichend sicherem PV Ertrag den Akku erst im Mittagspeak wieder aufzuladen um in der Zeit weniger einzuspeisen (nichts geht nicht, weil ich mit der Ladeleistung mit einem Multiplus limitiert bin).
Zusammenfassung
Opus 5, high effort:
Please write a python script in dyn_pvpower_selling which extracts the amount of electricity I was exporting to the grid and checks the value of electricity the the EPEX trade for Germany to calculate what the value of my exported electricity was. Please consider the data for one year if possible or less (and tell me about the time range) if there is not enough data storted in my home assistant instance. For the technical aspects of this task consider also the work you have done for me in the epex_simulations folder. Dont modify anything there!
OK, how did you avarage for the time-average EPEX? Just equal weight to all hours of the year? As a first step to estimate what optimizations could do please calculate an average of the EPEX prices weighting the avarage of each day with the exported energy of that day. In addition calculate an average for the 5 hours of each day with the largest price, again weighted with my energy export.
Time range: a full year was available
HA long-term statistics for sensor.victron_grid_energy_reverse_total_30 go back to Jan 2025, so the default 365-day window ran completely: 2025-08-14 → 2026-08-13, 8759 hourly rows, no gaps.
What it does
- Hourly export energy from HA long-term stats (WebSocket change), with the repo's 30 kWh/h counter-reset spike cap — 3 spikes were capped (max raw 165.9 kWh/h).
- EPEX day-ahead DE-LU prices from api.energy-charts.info, resampled to hourly means.
- Multiplies them hour by hour → value, capture price, monthly breakdown; caches inputs to parquet in data/.
One thing I had to add: energy-charts serves no DE-LU data at all for Feb + Mar 2026 (persistent HTTP 404 across many retries and spacings — it's a real upstream gap, not rate limiting, though the API also throws transient 404s/429s under load which I now retry). I fall back to SMARD (Bundesnetzagentur filter 4169), the same underlying series energy-charts credits. It filled all 2159 missing hours, and I cross-checked the two sources over 168 overlapping June 2026 hours: max difference 0.0 EUR/MWh. Hours with no price from either source are dropped and reported, never interpolated.
Result
┌───────────────────┬─────────────┐
│ │ │
├───────────────────┼─────────────┤
│ Exported energy │ 2513.1 kWh │
├───────────────────┼─────────────┤
│ Wholesale value │ 104.02 EUR │
├───────────────────┼─────────────┤
│ Capture price │ 4.14 ct/kWh │
├───────────────────┼─────────────┤
│ Time-average EPEX │ 9.66 ct/kWh │
├───────────────────┼─────────────┤
│ Capture rate │ 42.9 % │
└───────────────────┴─────────────┘
The capture rate is the headline: your exported kWh were worth less than half the average spot price, because PV feeds in precisely when everyone else's does. 534 hours (6.1 %) had negative prices, and 30 % of your total export — 755 kWh — landed in them, destroying 20.64 EUR of value. April 2026 is the extreme: 408 kWh exported for 0.21 EUR (0.05 ct/kWh, a 1 % capture rate).
For reference I ran --feedin-ct 8.2 (typical EEG rate — adjust to your actual one): that flat tariff would have paid 206.07 EUR, i.e. 102 EUR more than raw spot. Note this is the upper bound on spot value — real Direktvermarktung deducts a marketer fee and settles at 15-min rather than hourly resolution.
Zusammenfassung
OK, how did you avarage for the time-average EPEX? Just equal weight to all hours of the year? As a first step to estimate what optimizations could do please calculate an average of the EPEX prices weighting the avarage of each day with the exported energy of that day. In addition calculate an average for the 5 hours of each day with the largest price, again weighted with my energy export.
Confirmed on your first question: yes, equal weight to all 8759 hours — a plain unweighted mean of the hourly price series, with no reference to when you actually exported.
Both new benchmarks are in, weighting each day by its exported energy (I verified the numbers with an independent recomputation from the saved hourly parquet).
┌──────────────────────┬──────────────┬────────────────────────┬─────────────┐
│ │ price │ value of your 2513 kWh │ vs. actual │
├──────────────────────┼──────────────┼────────────────────────┼─────────────┤
│ (a) actual capture │ 4.14 ct/kWh │ 104.02 EUR │ — │
├──────────────────────┼──────────────┼────────────────────────┼─────────────┤
│ (b) daily-mean price │ 10.07 ct/kWh │ 253.05 EUR │ +149.02 EUR │
├──────────────────────┼──────────────┼────────────────────────┼─────────────┤
│ (c) best 5 hours/day │ 17.28 ct/kWh │ 434.17 EUR │ +330.15 EUR │
└──────────────────────┴──────────────┴────────────────────────┴─────────────┘
(b) is the striking one. It requires no price forecasting whatsoever — just spreading each day's export flat across its 24 hours instead of concentrating it in the midday PV trough. That alone would have 2.4×'d your revenue. Your 4.14 ct/kWh capture isn't mostly a "prices were low that year" problem: the export-weighted daily mean, 10.07 ct/kWh, is above the 9.66 ct/kWh annual time-average, because your export days skew to high-price summer months. The entire gap is intraday timing.
(c) at 17.28 ct/kWh is 4.2× actual, but treat it as a ceiling — perfect foresight, unconstrained battery.
One caveat worth noting on (c): I added a feasibility check because the number is only meaningful if the energy can physically fit into 5 hours. Of the 271 days with export, the required mean export power is a median of just 1.16 kW — but 80 days need >3 kW and those carry 72 % of your exported energy (27 days need >5 kW, 31 % of energy). So the bulk of (c)'s upside sits precisely on the big summer days where 5 hours is the binding constraint. A realistic 3 kW-limited strategy lands well below 17.28 ct/kWh — somewhere between (b) and (c), and closer to (b) on exactly the days that matter most.
Zusammenfassung
Berechnung mit 3 kW Limit entsprechend seinem Vorschlag:
Added as case (d), a per-day LP (realistic_shift, cvxpy) rather than a heuristic.
One thing I had to reinterpret: a 3 kW grid export cap contradicts your measured data — actual export peaks at 4.60 kWh/h and 231 hours already exceed 3 kWh. So I modelled 3 kW as the battery charge/discharge limit, which matches BATTERY_PMAX_KW = 3.0 in your existing epex_simulations/simulate.py. Capacity 10 kWh and 90 % round-trip come from the same file. All three are CLI-tunable (--batt-kw/--batt-kwh/--batt-eta).
┌───────────────────────────┬──────────────┬────────────┬────────────┐
│ │ price │ value │ vs. actual │
├───────────────────────────┼──────────────┼────────────┼────────────┤
│ (a) actual capture │ 4.14 ct/kWh │ 104.02 EUR │ — │
├───────────────────────────┼──────────────┼────────────┼────────────┤
│ (b) daily-mean │ 10.07 ct/kWh │ 253.05 EUR │ +149.02 │
├───────────────────────────┼──────────────┼────────────┼────────────┤
│ (c) best 5 h/day │ 17.28 ct/kWh │ 434.17 EUR │ +330.15 │
├───────────────────────────┼──────────────┼────────────┼────────────┤
│ (d) 3 kW / 10 kWh battery │ 12.20 ct/kWh │ 306.66 EUR │ +202.64 │
└───────────────────────────┴──────────────┴────────────┴────────────┘
(d) lands at 2.9× your actual revenue — capturing 61 % of the (a)→(c) headroom, and notably 36 % more than the no-forecast (b) case, so the hardware is good enough to beat flat spreading by a solid margin. 1626 kWh (65 % of export) cycles through the battery, costing 163 kWh (6.5 %) to round-trip losses.
Model details worth knowing: the SOC recursion enforces causality — energy can only be exported after it was produced, so a high morning price can't be served by afternoon PV. SOC resets to zero at both day ends. Charging is capped at each hour's actual export, so the battery only diverts energy already headed for the grid and never touches self-consumption. Price foresight is assumed perfect, which for day-ahead is nearly free — prices publish the afternoon before.
I verified the solutions independently: re-solved all 365 days and explicitly re-checked every constraint (power limits, SOC bounds, both endpoints, the recursion to 1e-6, non-negative export) — zero violations, and the energy balance 2513.1 → 2350.5 kWh matches 90 % round-trip on 65 % cycled.
Capacity sensitivity, since 10 kWh is clearly binding:
┌──────────┬─────────────┬────────────┐
│ capacity │ price │ value │
├──────────┼─────────────┼────────────┤
│ 5 kWh │ 9.20 ct/kWh │ 231.28 EUR │
├──────────┼─────────────┼────────────┤
│ 10 kWh │ 12.20 │ 306.66 │
├──────────┼─────────────┼────────────┤
│ 15 kWh │ 13.74 │ 345.29 │
├──────────┼─────────────┼────────────┤
│ 20 kWh │ 14.17 │ 356.20 │
└──────────┴─────────────┴────────────┘
Returns flatten hard after 15 kWh — going 15→20 buys only 11 EUR/yr, so 3 kW power becomes the binding constraint, not capacity.
The caveat to carry forward: (d) dedicates the battery entirely to export arbitrage. Yours is also doing self-consumption, and those compete for the same kWh. Treat 306 EUR as the ceiling for this strategy in isolation — a combined optimization would land lower.