It is working brilliantly for a year now, native integrated into HASS as a custom component, but I feel a bit overwhelmed how to add it into the official repo.
I know that there are different other solutions but none are as easy to use and deeply integrated into the Home Assistant world as what we have built.
The premise is that it is just a planner. From the Solar production integration entity it gets the forecast, from Epex Spot the price forecast, plus an entity for battery storage level.
The first difference is, the linear optimization logic is triggered whenever a sensor provides a new value and its calculation takes a few milliseconds only. So it does not plan once, but incorporates the reality constantly.
The output are two sensor values - the min kW to load into the battery and the max kW to discharge the battery right now.
These values can then be used by an automation to actually control the PV Inverter. In my case the Fronius inverter is controlled via ModBus over TCP, setting the battery limits.
Most of the time, the battery charging and discharging limit is 100%, meaning the inverter does whatever it wants.
But it could set the discharge to 0%, meaning it should not use the battery now because the power will be needed later during peak price times.
It could force charging the battery because buying power now is cheaper and the cost of using the battery makes it financially viable.
Because it does just the planning, it can work with any inverter and you can add custom rules, e.g. when the car is charged, the battery should not be used ever.