[Feature] Optimize Solar Charging Based on Dynamic Feed-in Tariffs (Opportunity Cost Optimization) #237
Replies: 13 comments 12 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. |
|
Part of the solution has been dealt with through the question in my topic: #70 An addition here might also be to include the total cost for taking from and injecting into the grid based on a formula used for the calculations. |
|
If this were to be implemented, it would be great if a seperate sensor could be used for the electric rate for exporting to the grid as there are currently electric companies who give you a different export rate, and in the Netherlands next year the energy tax will not be reimbursed for exported electricity (saldering) as is the case currently. |
|
Hi, Will look at this for 1.5.0. Best regards |
|
Hi, I will implement this feature in Omnibattery 1.5.0. The initial scope I am considering is price-aware solar-surplus absorption: delay battery charging when exporting solar is more valuable, absorb the surplus during cheaper export periods, re-evaluate the plan during the day, and respect a deadline for reaching the required energy target. Before implementation, please confirm:
Once these points are confirmed, I can keep the 1.5.0 scope precise and avoid mixing this with predictive discharge. |
|
@ffunes I had a go at this before seeing your comment: PR #355, against
Starting point, not a claim on the feature. If you'd rather write it yourself, the PR at least documents the guard matrix against charge delay, cheap grid slots, negative-price charging and smart pre-discharge. |
|
Thanks for all the work on this — the approach with #269 and the battery cost model described above looks very promising and seems to cover most of what I was looking for. There is just one additional use case I would like to clarify, especially for the Netherlands after net metering (saldering) ends. I am not looking for forced discharge to the grid. I would like the stored-energy cost to also influence normal discharge for self-consumption. For example:
If the current import price is €0.15/kWh, I would want Omnibattery to use the solar-charged energy to supply the house, because avoiding €0.15/kWh grid import with energy worth only €0.04/kWh is profitable. But if the stored energy was charged from the grid at €0.20/kWh, I would want Omnibattery to keep that energy in the battery for a later, more expensive period. So this is not about deliberately exporting battery energy during price peaks (#270), but about using the stored energy cost from #269 as a dynamic threshold for normal self-consumption discharge. Would this eventually fall under the planned predictive discharge logic, or would it need a separate feature request? For Dutch users this will become particularly relevant after saldering ends, because the opportunity cost of storing surplus solar can be much lower than the cost of charging the same battery from the grid. |
|
Thanks for this suggestion! It would be great, however, if the basic logic of charging from solar during cheapest hours would also work without dynamic feed-in tariffs. Additionally I would like to be a "good citizen" and charge my battery at time of maximum production to help the grid as much as possible. Currently I am using Charge Delay with a buffer of several hours. But that is only a rough approximation of what I want. So for me the goal would be "always charge during time of maximum solar production". This is probably very similar to the proposed "charge when most economical" solution. But I don't think there is a free, public feed-in tariff API available for my region so I would have to use spot-market tariffs as a proxy. |
|
Adding a concrete Dutch/Nord Pool use case for this, plus some thoughts on the four open questions above. Problem I ran into Until separate import/export prices land, Omnibattery's dynamic-pricing engine - specifically the negative-price/opportunistic-charging check, but really any price-vs-threshold comparison - works off the raw wholesale price from I looked at repointing On your four questions, from an NL/Nord Pool point of view:
One concrete ask for whoever implements this: please make sure the negative-price/opportunistic-charging feature (and |
|
I have implemented a triggered template sensor off of the nordpool epex integration to calculate Tibber's export price into a sensor that has the exact same format and attributes as the nordpool sensor. I.e. this can be used as the export sensor in Nord pool format by Omnibattery, while still using the original API-based Tibber for the import prices. Edit: I accidentally posted the -not correctly working- import price sensor. Now the above is the correct export price sensor. It includes checks so that starting January 1st, 2027 the prices are shown without salderingsregeling and before that with salderingsregeling. |
|
after installing omnibattery and playing with it im very happy except im missing 2 features. This one, #410 and #270. |
|
Implemented — available in 1.5.0b3. How it works:
Where to find it: the Surplus Price Hold switch, with Predictive Charging in Dynamic Pricing mode (it needs a forward price curve, so real-time price mode is out). If you have configured a separate feed-in price sensor it uses that; without one it falls back to the import curve, which is the right number under net metering. What you'll see: a Surplus Price Hold Status sensor with the current plan and the reason, and the battery status showing Surplus Exporting (Cheaper Window Ahead) while it is holding. Not included: deciding whether to use stored energy based on what it cost to store it — that's #269. Feedback from a sunny day on a dynamic contract would be 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?
First of all, thank you for Omnibattery—it's an incredible integration that manages my battery setup wonderfully.
I’d like to propose an enhancement to the predictive charging feature regarding how solar generation is handled under dynamic energy contracts with quarter-hour-based feed-in tariffs.
Currently, predictive charging smartly optimizes grid charging based on electricity prices. However, solar charging is handled passively: when the sun comes up, surplus solar power immediately fills the battery first (self-consumption priority) before any excess is exported to the grid.
On sunny days, my system produces more than double my daily consumption within the first few hours. Currently, the battery fills up rapidly in the morning, and the rest of the day is exported. However, with a dynamic contract, feed-in tariffs fluctuate heavily throughout the day.
The Core Issue: Opportunity Cost of Solar Energy
Solar energy stored in the morning is not "free". If I export that energy instead of storing it in the battery, I receive a high feed-in tariff at that moment. Storing it means forfeiting that revenue. Conversely, later in the day (e.g., during the midday solar peak), feed-in tariffs often drop significantly or even turn negative.
Therefore, it is much more economically advantageous to:
Export solar power during high morning feed-in tariff hours.
Delay battery charging with solar power until later in the day when feed-in prices are lowest (or negative).
Proposed solution
Can predictive charging (or a dedicated strategy) be extended to optimize solar charging based on dynamic feed-in tariffs?
Ideally, the integration could calculate when it's financially better to export solar production (due to high feed-in rates) and intelligently delay charging the battery until the hours with the lowest/negative feed-in prices, rather than just absorbing all solar power immediately by default.
Additional context
This would maximize revenue for users on dynamic contracts who face fluctuating quarter-hour feed-in prices.
It would require the integration to dynamically block/allow solar charging (e.g., setting max charge power to 0W during high feed-in hours, and releasing it when feed-in prices drop).
I'd love to hear your thoughts on whether this fits within the roadmap of Omnibattery!
Example use case
Users that have a dynamic contract and produce -on a summer day- more solar energy than their nightly battery discharge could increase their economic return on their battery usage, just like the current predictive charging feature does in situations where the solar production is less than the nightly battery usage. I.e. this feature could complement predictive charging.
Who would benefit from this?
Users with a specific installation or workflow
Alternatives or workarounds
I could not find a way to do this using the current integration. I've looked at the delayed charging feature, but as far as I can see this just takes a set time, and does not select its time slot to charge based on the feed-in price in any way.
Additional context
I've run a couple of simulated batteries for almost a year before I bought my actual physical battery last month. That simulated battery integration keeps track of both the costs of charging and the profits of discharging the battery. When I ran the simulations the way omnibattery now charges from solar the net profit was positive, but it was only a few cents per day. This made me initially think a battery wasn't really worth the investment. Only after I realised that I could influence the net profit by delaying solar charging until the feed-in price was low I could actually see the daily profit go up significantly. My method of controlling was very crude: by default I would disable charging at all and I would manually specify how many hours I would let the battery charge. My script would automatically select those hours when the prices were lowest and only enable charging during those hours. Completely disabling charging of course ruins the self-sufficiency, but still it resulted in an far better economical result, which ultimately led to me buying my current battery. If we could have a combination where the battery normally makes sure that as little as possible energy needs to be imported and charging is done at the cheapest hours, I think that would be a great feature for everyone who has a dynamic contract plus (during summer) more solar energy than they use on a daily basis.
Confirmations
All reactions