Force battery discharge during high-price peak spikes #270
Replies: 13 comments 35 replies
|
Thanks for the suggestion! 🙌 Here's how this works:
If your idea is very specific to your setup, it may not make it into the core integration — I'll try to suggest a workaround in that case. Feel free to discuss details or alternatives below. |
|
Sorry, I removed my previous comment as it did not match the feature request. |
Hi fellow dutchie :) If I understand your proposal correctly I see a problem: Let's say prices are 51 cents for every kWh for 2 hours. Your battery discharges as much as possible. You now need to buy electricity for the remainder of the night. That might not cost you money in 2026, but in 2027 that's definitely costly (if I understand your proposal correctly). My proposal for this would be:
Unless I understood your proposal incorrectly, 'natuurlijk' ;) |
|
Hi, Thank you for the valuable discussion; it’s key to getting the feature design right. Once you have reached a final agreement, please provide a single, unified set of requirements so I can move forward with implementation. Best regards |
|
Hi, I will implement this feature, but I cannot assign it to a specific release yet. The discussion currently combines several related outcomes: covering household consumption during expensive periods, deliberately exporting stored energy, and predictive discharge based on future prices and solar availability. Before implementation, I need one unified specification. Please confirm:
Once these requirements are consolidated, I can implement it safely without creating an uneconomical discharge-and-recharge cycle. |
|
I fed everything into gemini, to get a unified list of requirements: I pasted the outcome below. Can you agree @rrozema and @sincze, that this is the way @ffunes could move forward, or didn't Gemini and I interpret your feedback / comments / requirements correctly? Core ObjectiveProvide an automated, economic strategy for dynamic electricity contracts that optimizes battery charging and discharging. The system prioritizes covering household consumption, then intelligently exports calculated solar surplus during the highest-value dynamic price slots while protecting nighttime home energy needs and accounting for net taxes, fees, and round-trip efficiency (RTE). Key Requirements & Definitions1. "Force Discharge" Operational Scope
2. Discharge Triggers & Operational ModesThe feature should support two main discharge triggers:
3. Constraints, Limits & Stopping Criteria
4. Cost Model & Price Sensitivity Integration
5. Relationship with Predictive Energy Management
Concrete Example ScenarioHardware & Settings Setup
Day Profile & System Behavior (an example, times and behavior isn't hard coded, but dynamically calculated and executed.
|
|
@rrozema no hard feelings. I believe we are making progress ;-) to that is good for Omnibattery as a product. Hopefully @ffunes agrees ;-0 At the moment te template provides me. |
|
One remark, maybe not entirely related to forced discharging but more to
the "idle" periods in between charging and discharging. I see in Gemini's
summary that the battery is said to sit idle in some situations. I don't
think that is correct in many of those situations: if the battery sits
idle, that means we're using part of the energy produced by the solar
(provided there is solar production of course). If the battery price is
below the export price (which happens a lot every day if we charge at the
right time), we will want to run our home of the battery and export **all**
of the solar energy pretty much all of the time when we're not charging the
battery: to achieve this the battery will have to discharge just enough to
cover our home use: no more no less. This can easily be done by
manipulating omnibattery's PD target. If we set it equal to the negative
solar output the battery will discharge exactly our home usage, "pushing
out" all solar production at the higher export price. The battery should
therefore only be fully idle when it is at minimum SOC and it's not time to
charge yet, or when it is at max SOC and the battery price is still higher
than the export price.
Op ma 31 aug 2026, 10:54 schreef onlineous ***@***.***>:
… I fed everything into gemini, to get a unified list of requirements:
I pasted the outcome below. Can you agree @rrozema
<https://github.com/rrozema> and @sincze <https://github.com/sincze>,
that this is the way @ffunes <https://github.com/ffunes> could move
forward, or didn't Gemini and I interpret your feedback / comments /
requirements correctly?
Core Objective
Provide an automated, economic strategy for dynamic electricity contracts
that optimizes battery charging and discharging. The system prioritizes
covering household consumption, then intelligently exports calculated *solar
surplus* during the highest-value dynamic price slots while protecting
nighttime home energy needs and accounting for net taxes, fees, and
round-trip efficiency (RTE).
Key Requirements & Definitions1. "Force Discharge" Operational Scope
-
*Primary Function:* Deliberate grid export of *calculated solar
surplus energy* (or extreme price-spike energy) at maximum configured
battery discharge power (wattage).
-
*Secondary Function:* Automatic grid feed-in suppression during
negative/low price export periods, prioritizing direct solar export to grid
early in the day while prices are favorable before switching to battery
solar-charging.
2. Discharge Triggers & Operational Modes
The feature should support two main discharge triggers:
-
*Trigger 1: Solar Surplus Export (Primary Daily Strategy)*
-
*Logic:* Calculates predicted daily solar generation vs. predicted
household load. If available battery energy exceeds what is needed to cover
the home until the next low-price/solar cycle (plus a configurable safety
reserve/margin in kWh), the remaining energy is flagged as *Surplus*
.
-
*Timing Selection:* Automatically ranks the day's export price
slots and selects the $N$ highest-priced time slots required to
discharge the total surplus volume at max output power.
-
*Trigger 2: Extreme Price Spike Dump (Opportunistic Strategy)*
-
*Logic:* Triggered regardless of normal night-coverage calculations
when the dynamic export price exceeds a strict spread threshold.
-
*Threshold Formula:* Triggers when (Export Price + Configured
Margin) $\ge$ Highest Night Import Price.
-
*Note:* The configurable margin accounts for energy taxes, fixed
utility per-kWh fees, round-trip efficiency losses (~80–85%), and optional
battery degradation costs. (In the Dutch market context, this spread
typically requires a $\sim 0.18–0.22\text{ \euro}/kWh$ differential
to break even).
3. Constraints, Limits & Stopping Criteria
-
*Battery Discharge Power:* Maximum normal battery output power by
default, configurable by the user (e.g., 1500 W limit).
-
*Reserve Energy Protection:*
-
For *Trigger 1 (Surplus):* Must preserve predicted home consumption
for the night/overnight window + user-defined emergency backup SoC.
-
For *Trigger 2 (Spike):* Must respect at least the hard minimum
emergency backup SoC/kWh reserve setting.
-
*Stop Conditions:* Discharging stops immediately when:
1.
Calculated surplus kWh for the window has been fully exported.
2.
The dynamic export price drops below the cost-effectiveness
threshold.
3.
Battery SoC reaches the protected reserve threshold.
4. Cost Model & Price Sensitivity Integration
-
*Net-Price Basis:* All price comparisons (import and export) must
factor in full net costs: base spot price + energy taxes + utility markup
fees + round-trip efficiency (RTE) losses.
-
*Stored Energy Cost Tracking:* A stored energy cost sensor (from #269
<#269> / #326
<#326>) should be
integrated to ensure energy bought from the grid is *never sold at a
loss*.
-
*Off-Grid / Direct-Grid Charging Priority:* Due to tax structures
(e.g., post-2026 tax rule changes), charging from solar is significantly
cheaper than charging from grid. Charging algorithms must evaluate solar
first before grid import.
5. Relationship with Predictive Energy Management
-
The feature should be integrated under a unified *Dynamic Predictive
Energy Strategy* framework alongside Predictive Charging.
-
*Shared Math:* Both rely on the same underlying predictive engine
(Forecasted Solar - Forecasted Home Load = Deficit or Surplus).
-
If *Deficit* $\rightarrow$ Triggers Predictive Charging logic
(select cheapest slots to import).
-
If *Surplus* $\rightarrow$ Triggers Predictive Discharging logic
(select highest slots to export).
-
*User Toggles:* Provide independent enable/disable toggles for *Predictive
Charging* and *Predictive Discharging* so users with small capacities
or high night loads can disable surplus exporting if desired.
Concrete Example ScenarioHardware & Settings Setup
-
*Battery:* 6 kWh capacity, 1500 W max discharge rate, 85% Round-Trip
Efficiency (RTE).
-
*Emergency Reserve:* 1.0 kWh (Hard SoC minimum).
-
*Predicted Night Load (20:00 - 07:00):* 2.0 kWh.
-
*Total Protected Reserve Needed:* $1.0\text{ kWh} + 2.0\text{ kWh} =
3.0\text{ kWh}$.
-
*Fixed Tax & Utility Delta Threshold:* $0.20\text{ \euro}/kWh$ spread
required for arbitrage.
Day Profile & System Behavior (an example, times and behavior isn't hard
coded, but dynamically calculated and executed. Image: Example behavior
(view on web)
<https://github.com/user-attachments/assets/6eae9854-8a19-418d-ba76-34edf25a2e85>
—
Reply to this email directly, view it on GitHub
<#270?email_source=notifications&email_token=AANKYDWIPLWHF5I3NLAQUFT5MU4JVA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBSGE2TONBQUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-18215740>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANKYDUDMXY53YGDZ257FOT5MU4JVAVCNFSNUABJKJSXA33TNF2G64TZHMYTEOBTGEYDQNBXGU5UI2LTMN2XG43JN5XDWMJQGYYDINBYGGQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AANKYDQXFOZ2BPGQHJDYWFL5MU4JVA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBSGE2TONBQUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/AANKYDXNZ5E6OUKQTQ5ER735MU4JVA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBSGE2TONBQUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I now have: |
|
First of all, I agree that it's way better to combine all this in omnibattery than building everything yourself. Very interested in this as well, since its actually what I find one of the biggest advantages of a home battery. |
|
after installing omnibattery and playing with it im very happy except im missing 2 features. This one, #410 and #237. |
|
Implemented — available in 1.5.0b3. How it works:
Where to find it: the High-Price Discharge switch, with Predictive Charging in Dynamic Pricing mode (it needs a forward price curve). If you have configured a separate feed-in price sensor it uses that; without one it falls back to the import curve, which is correct under net metering. What you'll see: a High-Price Discharge Status sensor — Disabled / Invalid configuration / No data / Blocked / Waiting / Active — with the plan and the reason behind the current state. Related but separate: holding solar surplus back for the cheapest feed-in hours is #237 (also in 1.5.0b3), and pricing stored energy by what it cost to store it is #269. Reports from a real price peak are very welcome. |




Uh oh!
There was an error while loading. Please reload this page.
Area of the proposal
Energy management or control strategy
What problem would this solve?
Currently my battery management strategy focus on smooth charging/discharging cycles based on average daily rates or standard consumption. However, dynamic energy tariffs frequently experience extreme, short-duration price spikes (e.g., brief evening peaks). Without an explicit trigger or rule to respond to these sharp spikes, the battery may miss high-value export or self-consumption opportunities that could significantly improve overall ROI over the course of a year.
Proposed solution
Add a feature or automation trigger that allows for forced battery discharging when dynamic energy prices exceed a configurable upper threshold (or during detected peak spike intervals).
Example use case
Taking yesterday evening's price curve as an example:
Dynamic prices hovered around 0.30 EUR/kWh during the day and dropped near 0.12 EUR/kWh around midday.
At 19:45, the price spiked sharply to 0.70 EUR/kWh—nearly triple the daily baseline.
Action: Detecting this sudden peak above the baseline threshold would trigger a forced discharge period, maximizing grid export earnings (or offsetting expensive grid imports) during that exact window before prices normalize again.
Who would benefit from this?
Most Omnibattery users
Alternatives or workarounds
Create a Forced Discharge Automation ?
Via Settings > Automations & Scenes > Create Automation > Edit in YAML
Something like ?
Additional context
Confirmations
All reactions