Sourceful Energy
Grid connectionPlatformServicesAboutBlog
Insights and analysis·10 min read
Back to Journal
Insights and analysis

Why planning a home's energy is hard, and how we measure it

Six reasons why planning a real home's energy on a small computer takes years of work, and how we test Energyplan against HiGHS, SCIP, physics and real homes.

By Sourceful Team·November 16, 2026·10 min read
Why planning a home's energy is hard, and how we measure it

Part 2 of 3 in our series on building the best home energy planner in the world. Part 1 tells how we built it.

"Charge when it's cheap, use it when it's expensive." How hard can that be?

Answering that question well, for a real home and every few minutes, is one of the more demanding optimisation jobs a small computer can be given. This post explains why, in six challenges, and then how we measure whether we have solved them.

Challenge 1: the decision is huge

A planner looks ahead a day or two, in time slots of fifteen minutes to an hour. For every slot it decides:

  • how much the battery charges or discharges;
  • whether the car charges, and at what current;
  • how much power to buy, and how much to sell;
  • whether to hold solar back when exporting doesn't pay.

All of this has to hold together:

  • Physics. The battery can't hold more than its capacity, and charging loses a little energy.
  • Limits. The main fuse, the hourly import cap, the inverter's rating.
  • Goals. "The car at 80 % by 07:00", "keep a reserve for a power cut".

With 96 slots and a handful of devices, that is hundreds to thousands of linked decisions.

Challenge 2: some decisions are yes or no

If every decision were a smooth dial, say "charge at 2.3 kW", this would be a well-understood problem called a linear programme, and computers solve those very fast.

But real homes have switches:

  • A car charger is either off, or on at 6 A or more. There is nothing in between.
  • A battery shouldn't charge and discharge in the same slot.
  • Tariffs have thresholds: cross one and a different price applies.

These yes-or-no decisions turn the problem into a mixed-integer programme. With 100 on/off decisions there are 2¹⁰⁰ combinations, which is more than the number of atoms in a person. You can't try them all.

How solvers cope: branch and bound. Pretend the switches are dials. Solving that relaxed problem is fast, and it gives a lower bound: the true plan can't be cheaper than it. Then pick a switch and split the problem in two: "on" and "off". Keep splitting. Whenever a branch's lower bound is already worse than the best real plan found so far, throw that whole branch away, along with every combination inside it.

When the best plan found meets the lowest bound still open, you have a proof: no better plan exists. That is what we mean when we say a plan is proven optimal.

Challenge 3: one hour can cost you a month

Peak-power tariffs charge you for your highest hour, per day or per month. That ties every hour of the plan to every other hour. Saving 2 öre at 18:00 is pointless if it makes 18:00 your new monthly peak.

It gets subtle in practice. What about the hour you are already in, half used? Energyplan 0.7.0 fixed exactly this. The planner now plans with the hour in progress, so each day's peak counts once and only once.

Challenge 4: a Raspberry Pi and a stopwatch

A data-centre solver can think for minutes on a 64-core server. Energyplan runs on the home's own box, often a Raspberry Pi 4, next to everything else the home system does. It replans every few minutes and whenever something changes: a cloud covers the panels, or someone plugs in a car. Each answer has a budget of well under a second up to a few seconds, depending on the call.

So the planner must:

  • have a good valid plan early, and keep improving it until time runs out;
  • never overrun its budget, because a late plan is a useless plan;
  • stay small in memory. 0.7.0 cut peak memory on our test set from 223 MiB to 64 MiB.

Challenge 5: a plan must never be wrong

A plan that is 0.1 % cheaper but breaks a fuse limit is worse than useless. Solvers work in floating-point arithmetic, where 0.1 + 0.2 isn't exactly 0.3. Over thousands of steps, tiny errors can add up into a plan that is almost feasible. "Almost" isn't good enough when real hardware follows the plan.

So we defend in layers:

  • the planner checks its own answers carefully;
  • FTW's Core replays every plan against the home's physics before using it;
  • if Core rejects a plan, its own simpler planner takes over.

In 0.7.0's test gates, FTW rejected zero Energyplan plans.

Challenge 6: the future is a guess

Prices are known a day ahead. Solar production and household consumption are forecasts, and forecasts are wrong. The planner copes by replanning often, by keeping plans that hold up when the forecast misses, and by recovering when a forecast is clearly off.

This also makes measuring the planner hard. Is a change better, or did you just test it on a lucky day? That is why we test on fixed benchmark sets and on hundreds of real recorded requests, and why every change is compared with the version that has already shipped.

Putting it together

Every few minutes, on a small computer, the planner:

  1. reads prices, forecasts, devices and goals;
  2. builds a mixed-integer model of the home for the next day or two;
  3. finds a valid plan quickly, then searches for better ones;
  4. ideally proves it found the best, within a fraction of a second;
  5. hands the plan to FTW, which checks it against physics before acting.

Each of the six challenges is hard on its own. A planner has to meet all of them at once, in homes it has never seen. A prompt can give you a model that solves the textbook case. Getting peak hours, fuses, cars, rounding errors and forecast misses right together has taken us years of research and months of measured releases on real homes.

How we measure it

A planner that only measures itself can report anything it likes. So we hold Energyplan to references it does not control: state-of-the-art solvers, the physics of the home, and real planning requests from a live home.

We test against HiGHS and SCIP, two leading open-source optimisation solvers with years of research behind them. We write an independent model of the same home, pass the same numbers to the reference solver, and give it far more time than Energyplan gets.

Three questions decide each case:

  1. Is the plan valid? Every plan, from any solver, gets replayed against the physics of the home. A plan that breaks a limit does not count, however cheap it looks.
  2. Is the cost right? When a reference solver proves the cheapest possible plan, Energyplan's "optimal" answer has to match it.
  3. Is the proof honest? Energyplan reports a lower bound, a promise that no plan can be cheaper. That bound must never sit above the true optimum. A false proof tells the system to stop looking, and it is the worst fault a planner can have.

What we measured

TestResult
300 requests built the way FTW's Core builds them, checked against HiGHSNo false proofs and no invalid bounds. Battery cases matched HiGHS exactly.
456 battery replans recorded on a live homeAll proven optimal in 2 to 8 ms. Every plan was 1 to 15 öre cheaper than the simpler planner in FTW's Core.
44 car replans recorded on a live homeInside the 1.5 s budget on a Raspberry Pi 4, the plans cost 30 öre more in total than a fifteen-second run on a laptop.
A sunny two-day home case on a Pi's 1.5 s budget, 0.5.2 against the version before77 kr instead of 100 kr, where the best possible plan costs 77 kr.
0.7.0 against 0.6.0 on our gate setsFTW's validator rejected 0 plans, against 5.

The live-home numbers come from one home between 29 October and 3 November, running Energyplan 0.6.0.

Where general solvers still lead

We publish this part too. In tests in September, on a four-core Intel N150 with one run per configuration, HiGHS proved the optimum for sites with eight and sixteen cars in under a second. A September version of Energyplan had not closed the gap when its two-second budget ran out. On a 24-hour case with four cars the two were level, at about 100 ms each.

Sites with sixteen cars are far larger than a home, but they show where the work is. Proving more plans faster is the goal of 0.8.0 "FAST".

The research track

In October a separate research track ran beside the releases, with a research solver in Rust built for the structure of home energy problems. It is part of the same effort, and it was large:

Research track, 3 to 14 October
Tokens processedat least 8.9 billion
Tokens writtenabout 36 million
Tool actionsabout 65,000
ModelsGPT-6 Astra, GPT-6 Luna and GPT-6.1 Sol through Codex, with Claude Opus 5.5
Commits338
Codeabout 47,000 lines of Rust, and 29,000 lines of Rust tests
Research notes and checkpoints365
Benchmark outputabout 63 GB

A result only counted if an independent check confirmed that the plan was valid and the claimed bound was true, using exact arithmetic where it mattered. Ideas that survive become candidates for Energyplan and go through the same gates as everything else.

What we learned

  1. Structure is the edge. A general solver must be ready for any problem. Energyplan has to be very good at one family of problems, the one it sees every few minutes in a home.
  2. Count whole solves. A clever step that speeds up one phase can make the whole solve slower. We judge by total time to a verified answer.
  3. Verification is not optional. Many apparent wins disappear under an independent check. We keep only the ones that survive.
  4. Research feeds the product. Each idea has to show a measured gain on real planning requests before it ships.

What state of the art means here

We believe Energyplan is state of the art for home energy planning. We mean four things by that, and each one can be checked:

  • on battery plans it reaches the same proven optimum as a leading open-source solver;
  • it made no false claims of optimality in our test sweep;
  • it finishes inside its budget on a Raspberry Pi 4, on real requests;
  • every plan passes an independent physical replay before hardware sees it.

The goal is still the best home energy planner in the world, and these measurements are how we will know when we get there. They did not come quickly. They rest on years of research, benchmark sets we built ourselves and real homes that run the planner every day.

Next and last in this round: how we ship a planner you can trust.

Energyplan is Sourceful's proprietary planner. It ships with FTW, whose Core, clients and drivers are open code under AGPLv3. Energyplan itself has its own licence: free for your own private household with FTW, and under a written Sourceful licence for commercial use or for bundling with other products. HiGHS and SCIP are independent open-source projects and are not affiliated with Sourceful.

Share this article
XLinkedIn
Explore related topics
C&I Batteries & OptimisationEnergy Management & ControlCommercial EV Charging
03 · RelatedMore Articles
View All
How we built Energyplan
Insights and analysis

How we built Energyplan

Sourceful Team · Nov 8, 2026
Europe’s Energy Future Starts on the Rooftop
Insights and analysis

Europe’s Energy Future Starts on the Rooftop

Viktor Rosén · Apr 15, 2025
How we build an open-source energy management system with data
Insights and analysis

How we build an open-source energy management system with data

Fredrik Ahlgren · Aug 31, 2026
Sourceful Energy

Sourceful is the Grid Connection Platform. We create value from the electrical capacity already available at commercial and industrial sites.

The Source

Monthly notes on grid connections, local capacity, energy markets and the systems that create value from them.

Product
  • Grid connection
  • Platform
  • Services
  • Zap tools
Company
  • About
  • Master Plan
  • Open source
  • Blog
  • Press Kit
Support
  • Get in Touch
  • Support
© 2026 Sourceful Labs AB · Sourceful Energy
Privacy PolicyTerms of Service
EN|SV
Made in Kalmar, Sweden

All savings, costs, and financial figures shown are estimates for illustrative purposes only. Actual results depend on your specific setup, energy consumption patterns, electricity prices, and local regulations. This content is provided for informational purposes only and does not constitute financial, investment, or legal advice.