diy solar

diy solar

Grid arbitrage with a soupçon of energy security

rthorntn

New Member
Joined
Feb 13, 2024
Messages
18
Location
Sydney
Hi,

Is anyone doing DIY grid arbitrage with 30 minute (or more frequent) wholesale price windows (I'm with Amber in NSW, Australia)?

I'm interested in automation using node-red and was hoping to get some ideas on the best battery charge/discharge logic. There are so many variables I'm struggling to figure out where to start.

- Energy price
- Battery SoC
- Battery Charge: time left to charge/discharge
- Battery voltage
- PV watts
- House load
- Time of day
- Weather/Solar forecast
- Projected energy price spikes

I guess the question is what's the first logic check I should do to start everything off, SoC ranges, time of day, price? I'm leaning towards SoC at the moment.

With battery, I basically want to:

- Keep my house running off the battery 24/7, so top up in the evening (or early morning) if the SoC is too low for that
- Take advantage of power price spikes
- At the end of the day, if the export price is above Xc then sell any excess that I don't need to get me through the night
- Top up the battery from grid if the weather is bad and power is cheap
- Make sure I'm not exporting during negative pricing

It seems like most Amber customers just charge the battery to full before 14:00 (to take advantage of NSW EA959) and dump battery between sunset and 20:00 everyday and are happy with a 5c "spread" between buy and sell. Most people don't run their house on battery 24/7.

Thanks.
RIchard
 
Dunno Australia but here goes fwiw:
If I were doing energy arbitrage, I'd want to include these to make sure it's worth my while:
  • Cost of battery cycles
  • "Opportunity cost" of investment, vs other options. Both money and your time.
Sorry, this isn't really what you're asking and may make it harder rather than easier. Goal is to ensure you don't go down the rabbit hole without understanding why. Manage your expectations!
 
Last edited:
Thanks

My hardware is working.

I'm already on 30 minute billing.

Currently, I just sell battery manually over modbus on my GoodWe SBP G2.

This question is about the logic of exporting battery.
 
I don't think battery cycles are a big deal with LFP.

One factor to consider is the cost (initial implementation and ongoing maintenance) from a more complex setup.

I set up some home automation controls a few years back. Now, one of the hubs in the critical path is acting up, and I can't be bothered to fix it despite the quality of life impact.

Are you responsible enough to wind down your Node-Red in favor of a luser-tier forced export on a schedule or take the pain of a bug like a grown up? (could be financial, imagine it full send dumping during negative prices after a software aneurysm)
 
Anyway as to your original question, I think the difficulty in how to start is because this is a multi-variable discrete optimization problem. Those are mathematically understood but not taught in CS unless you did a lot of grinding on contest problems. They can probably be perfectly solved with perfect info, but you don't have perfect info (strike 1 on keeping the thinking safe) because you don't know what will happen with weather or power cuts. You also don't know what the real time spot price in the future will be.

In which case, you can relax to targeting optimal solution for a target power reserve / whatever the weather service told you would happen. And maturely accept that reality may not match.

Another approach is to zen out and accept the imperfections of life / inevitability of heuristics, and pick a subset of the problem to work on.

EDIT: So if you want to do reading, maybe look at trading algorithms, or discrete optimization.
 
Also, you're probably unlikely to get much info from the North American members on the forum. Most of the prices are either set well in advance (so static table just needs to be updated every once in a while), and/or the arbitrage opportunity $ is minimal so people aren't super incentivized to mess with it. (*)

In my state, my plan is to just do forced export with a reserve for power outage. I have a generator and a EV that can cover the gap if this means I'm out of power overnight.

With the new solar scheme in my state (which thankfully I'm not under) there is a pre-determined hourly export compensation (it's a big ass table mapping week of year, hour of day -> export compensation in dollars), and what I've tried to advocate for is for local power users to figure out how to make their ESS products automatically find those special hours where the payback is massive (like $2 vs $.10 / kWh). I don't believe anything off the shelf does that yet, despite California being such a large solar market.

EDIT: (*) I know Texas has some ... creative for North America ... plans including more direct exposure to spot market. But the prices are low enough that there's no payoff. And anyway there is a superior/simpler plan to arbitrage around, namely the Free Nights plans. All you do here is charge the battery before dawn and profit. No need for a crazy Node-Red.
 
Thanks, I have LTO batteries (Zenaji Aeon) so I'm not super concerned about cycles, although they were over twice the price of LFP.

Yeah, weather & solar forecasting being part of the logic is probably a bridge too far.

I'm thinking the first check should be for price spikes or a negative power price:

- I don't want to import if there is a spike, I may want to export any capacity I have stopping at 43v though if the $$$ are high enough.
- Negative power price maybe I just charge and get paid for it.

If everything is normal then I move on to SoC ranges (0-24, 25-49, 50-74 & 75-100).

0-24 - if discharging perhaps I want to maintain the current SoC by grid importing to cancel out the discharging, no exporting at this SoC

25-49 - if FiT more than 50c then export

50-74 - if FiT more than 40c then export

75-100 - if FiT nore than 30c then export
 
This sounds like a pretty good starting point. I would recommend thinking about what kind of fail-* safeguards you might want to prioritize. Typical real-time embedded software / live site service sort of thinking.

For instance, guardrails around the pricing data being out of date (you could export during negative power period, maybe it's not a big deal though, it can't be that much real dollars).

Or guardrails around the SoC to make sure the automation doesn't run the battery down to 0 if it turns on export but then crashes before updating.
 
Thanks.

Yeah, I think Australia might be a bit ahead of the curve with arbitrage.

So I'm in NSW on Amber, we currently have a 26.58c/kwh FiT rebate / import penalty (EA959) between 14:00-20:00 every day. So if there isn't much sun in the morning then quite a lot of people top up from the grid just before 14:00 and export all their solar and export battery when the sun starts to set.

Most homes wouldn't care if they empty their battery as their house load is on the grid, my house load is connected to my MPP 5048MG inverters.
 
Most homes wouldn't care if they empty their battery as their house load is on the grid, my house load is connected to my MPP 5048MG inverters.
Not sure what those are capable of, so this idea is a blind proposal:

What if you tied them into a basic ATS that flips back to grid if those inverters hit low SoC or voltage cutoff? In that case they go to 0VAC which would then trigger the ATS flip. Granted this is not the most amazing for your appliances but it keeps the lights on.

Assuming a basic ATS that does not sync'ing (because syncing requires cooperation with the inverter). Growatt sells one that has this level of jankiness yet is grid tie legal in the US.
 
Thanks, my system is super convoluted, on the MPPs if the batteries go below 44v the MPPs switch to grid mode (they have an AC in & AC out connection). I also have a Latronics ACTS transfer switch to protect against the MPPs failing.

My always wanting to be in battery mode has more to do with energy security than anything else, if we have a power cut, I want to have power. Secondary to that is only pulling power from the grid when I tell it to, that makes the system naturally resistant to price spikes as by default I'm never using grid power.

A rough outline of my "Frankenstein" system:

-:Two paralleled MPP 5048MG inverters.
- Growatt 6kw for solar export as the MPPs don't do that. I use Latronics SATS to switch my panels between the MPPs and the Growatt.
- Goodwe SBP for battery export.
 
Got it, so adding the Node-Red layer can be viewed in a couple ways, wrt how it affects the complexity of the system
  1. You are already far off of turnkey logic, adding another layer doesn't really change the equation
  2. You already have a ton of complexity layers, maybe this is the straw that breaks it
 
Thanks, I do have node-red enabled to manage solar export, that's been running flawlessly for over a month.
 
Assuming over-discharge (not respecting your lower SoC limits) is the main worry here.

How is that enforced? Only in NodeRed or also with a config within the export capable inverters?
 
The batteries all have an internal BMS (with no comms interface), they trip on:

Over current : 41A
Over Temperature : 65°C
Under Temperature : -40°C
Over Voltage : 57.5 V
Under Voltage : 41.5 V

Tripping is not ideal but it basically makes it impossible for user error to damage the battery?
 
In Texas we do have plans that pay wholesale market pricing for sellback which could be exploited. The plan I'm on (free nights) is way better for me with the fixed solar credit rates though so I'm not looking at switching.

As for your situation, you can certainly do the arbitrage, the issue is the large amount of unknowns, ie. weather the next day, usage predictions, grid demand and pricing.

You will always have to decide between having the safety of battery vs. maximizing your export for profit. To me it's not entirely clear that the effort is worth the benefit.

Additionally, the surge pricing that you want to really reap the benefits of is likely during a time when you'd want to use or preserve most of your storage in case the grid has troubles, therefore you're trading risk for profit.
 
Thanks, yeah, its a tricky trade off but one thing I can do is sell down to 75% SoC after 14:00 as no matter what that will get me to the next day.

Like yesterday I was fully charged by 14:00, exported solar the rest of the day, woke up to 55% SoC so my batteries are on track to be charged by 13:00 which means I can just curtail or sell for next to nothing (or even worse negative) between 13:00-14:00 when I could have got 30c/kwh yesterday evening. I mean its not a lot of money ($1.50 for 5kw) but its sort of gamifying it and its slightly addictive.

Our neighbours in the state of Victoria had some wild weather a couple of weeks back, pylons fell and power plants tripped, the price surged, one person made $800 in 2 hours, quite a few made ~$150.
 
Additionally, the surge pricing that you want to really reap the benefits of is likely during a time when you'd want to use or preserve most of your storage in case the grid has troubles, therefore you're trading risk for profit.
Agreed. My hedge against this is that I have other storage (EV with V2X) that is not allowed to be exported, but that I can dip into if there is an outage. So the risk of simple forced export at peak is significantly mitigated if not zeroed.

And I only need to suffer 24 hours of this. After 24 hours my state of energy will be very similar to an optimal export control scheme that has a crystal ball and knew the power was going to go out.
 
Back
Top