Guys,
This previous thread details a little of the background - with some significant changes now.
Our power gird in Australia (NEM) is run on a 5min bidding window. I am with a wholesaler (so i get exposed to variable wholesale rates (for good and bad !)
I have a LOT of solar panels (23Kw) and a lot of Battery 40Kwh - both of which were purchased based on the ability to arbitrage the wholesale rates (which has been working well)
I want to optimise my system for maximum return now.
The way the market works is that every 5m there is a computerised bidding system that sets the price and this is published about 30sec into the interval - i have access to this in the same timeframe and can perform actions based on this price (through current automations - such as charge and discharge the battery)
Our provider publishes estimated pricing for approx 24 hours ahead for each 5 min window - the further out they are the more it is based on estimated load and supply - but obviously can not take into account any issues (power station going offline, downed power cables etc)
Typically most evenings (starting from abut 4:30PM through to about 9PM) will be the evening peak when prices are generally higher. I have a punitive demand tarriff applied to my account that means it is very expensive to pull any power from the grid between 3PM and 9PM. (take whatever my max power draw is during a 1/2 hour window in that 3-9 slot, double it and then multiply by the number of days in the month and then charge at 33c Kwh)
I currently read the current big and future forecasts into a Global Context array - there are some obvious "spikes" on a fairly frequent (every couple of days) basis and these are easily addressed.
Where i have an issue is in the edge cases and how to address them.
Lets say i need 10Kwh from my batteries to get through the night with our standard base load. This means i have approximately 30Kwh to be able to dispatch into the evening peak - however Lets say i can discharge into the grid at a 30c/Kwh return - i need to look forward through the prices and decide if there are any future forecasts that look like a better return than that 30c and also whether if i did take the 30c now - is there a cheaper opportunity after 9PM to recharge the battery to take advantage of those higher prices later (i.e. discharge, charge and then discharge again) - noting that the farther out the forecast is (in time) the less accurate it is.
My batteries has a round trip cost of approx 8c per Kwh (based on purchase price and warranty period) and this also has to be added to the charge/discharge cycle costs (i.e. it is no good chasing a 5c delta)
Does anyone have a good mathematical approach to solving this - i note that in the Home Assistant platform someone has written a Linear optimisation tool that is mean to do this and also take into account (discretionary loads and expected solar input)
Any ideas on the mathematical approach for this in NR ?
Craig