Articles/Battery Systems

Sigenergy NEM Arbitrage Agent: What It Does and What a Fleet Needs

AI ArchitectureTool Spotlight
By Vanya SmytheOctober 16, 20264 min readVerified Oct 16, 2026
sigenergy-nem-arb(primary)
battery-arbitragenemaemohome-assistantsigenergyai-agentshard-limits

Read what the repository holds

sigenergy-nem-arb is an agent that plans when a home battery should charge and discharge. It works in the National Electricity Market (NEM), the wholesale market for eastern and southern Australia. Immanuel Lam wrote it for the "Built with Opus 4.7" hackathon and publishes it under the MIT licence. The repository was created on 22 April 2026 and took its last commit two days later. It carries 19 commits co-authored by Claude Opus 4.7, and it had no stars and no forks on 17 October 2026.

The README is candid about its scope. It runs on "exactly one house", a Sydney home with a 64 kWh Sigenergy pack, two inverters and 24 kWp of solar, and it ends with "Owner: Immanuel. Sole user, sole house." It is a Python 3.12 backend with a Next.js dashboard. The README reports 146 passing tests, which I did not run.

The pipeline is short. Two functions in arb/ingest/aemo.py pull NEMweb zip files for five-minute predispatch and for dispatch prices, for NSW1 only. A third module calls Amber's price API when the owner has a key. A greedy scheduler pairs cheap intervals with dear ones. It scores each pair by spread times round-trip efficiency, less a 2 c/kWh cycle penalty, and fills the plan from the top. Opus 4.7 then writes a two-sentence rationale and never touches the schedule. That is the right division of work.

Correct three easy assumptions

The first assumption is about the weather data. It comes from Open-Meteo, not the Bureau of Meteorology, even though the file is named bom.py. The solar forecast is a clear-sky curve derated by cloud cover, with a fixed factor of 0.75 and a fixed 24 kWp array. It is not a commercial irradiance product.

The second is about the number 30 in the code. It is how often the loop wakes, not a price resolution. The repository fetches no 30-minute prices. Five-minute settlement began on 1 October 2021, so the five-minute dispatch price is the one a battery is paid. The NEMweb paths still answer. At 7.40 am on 17 October 2026 the dispatch file gave NSW1 a regional price of $69.90/MWh, while the predispatch run of the same minute forecast $6.06 for 8.20 am.

The third is about the backtest, and it needs the most care. Over seven days in April 2026 the agent cost $0.17 against $41.52 for Amber's own SmartShift. But the author ran it with perfect foresight, and says real forecasting error "would reduce the headline numbers somewhat". The agent's row is also identical to plain self-consumption, to the cent and the kilowatt-hour. The export price sat at or below zero all week, so the agent declined to trade. The saving came from not trading.

Fix the kill switch first

The actuator, arb/actuator/ha_control.py, writes to the inverter through Home Assistant, using the community Sigenergy-Local-Modbus integration. Its limits are real. It refuses to discharge within one point of the 10% floor or to charge within one point of the 95% ceiling. It caps writes at ten an hour, honours ARB_KILL=1, defaults to dry-run and logs every attempt.

There are two faults. In each of the three write functions, the dry-run branch returns success before the code reads the kill switch. A dry-run log therefore cannot show whether the switch would have held. The write counter also lives in process memory, so every run started with --once begins with a clean slate.

None of this has met a live inverter yet. The README says no live writes happened during the hackathon.

Add what a fleet needs

The solution I would build on this keeps the agent's shape and adds the parts an installer is answerable for. The Modbus map already defines registers for cell temperature and state of health, and nothing reads them. The design checks both before every write, so a hot or ageing pack stops trading before the optimiser asks.

The design makes three more changes. It counts cycles against the warranty, where the original prices each cycle at 2 cents and takes no further account of it. It moves the kill-switch check ahead of the dry-run branch. And it keeps the write counter on disk, where a restart cannot clear it.

Keep the owner at the gate

Go-live comes in three stages. The first is a fortnight or more of dry-run against live prices, with a person reading the audit log. The second is supervised writes that the owner confirms one at a time. The third is unattended writes inside the limits. The owner or installer approves each step, and the agent approves none of them. Nobody skips a stage.

See the design, its diagram and the demo at the solution. In the backtest week, the scheduler's whole saving came from declining to trade.

Subscribe to engineering insights

Get notified when we publish new technical articles.

Topics

Unsubscribe anytime. View our Privacy Policy.