Connecting the data to decide what to buy next

Blog post #79


We have had solar panels since late 2022. I have always known they were a good idea. I could not tell you how good, or what we should buy next.

This week I put the answer on the table. Not with a feeling, but by pulling every electricity invoice and every hour of data I could find into one place, and asking the same question of each possible investment: what does it actually pay back?

What changed since last log

I stopped estimating and started matching.

The first version of my dashboard worked on months. One number per month for what we bought, one for what we sold, one for what the panels produced. When I needed the value of the solar power we used ourselves, I took the month’s average price and multiplied.

That is wrong in two ways.

  • The price was too high. The month’s average is weighted by when we use power, mostly evenings. Solar produces at midday, when power is cheapest.
  • The price was too low. When you use your own solar power you save more than the spot price. You also skip the grid fee, the energy tax and the VAT. I had left all of that out.

The two errors did not cancel. Once I fixed both, the total value of the panels since the start went from about 36,700 kr to about 43,900 kr.

I also found that I was counting some income twice. Tibber’s invoice total is already reduced by what we sell, and the dashboard then added the same sale as a benefit. That is fixed too.

What shipped

  • Everything in one dashboard. Invoices from Tibber and E.ON, monthly production from the Huawei inverter, and hourly consumption, export and prices from the Tibber API. March 2022 to August 2026.
  • Hourly matching. I pulled about 40,000 hours of consumption and 34,000 hours of production. The value of each self-used kWh now comes from the price in the hours the sun was actually shining.
  • A battery simulation on real hours. For every day it finds the best time to charge and discharge, given what we really used and sold that day. Before, it worked on monthly averages with roughly 20% uncertainty.
  • A new look. It now follows the Aelg design, with a small sun in the logo.
  • A git repository. The project was not under version control. It is now, and the invoices and my hourly data stay out of it.

What’s working

Browser use for the boring part. The data lives behind three logins: E.ON, Tibber and Huawei FusionSolar. There is no export button for what I wanted. I logged in myself, and Claude drove the browser: opened the invoice list, read the numbers, downloaded the PDFs. It never types a password. That is my job.

It was not smooth. E.ON logged me out halfway through. A “view invoice” button opened nothing until I realised it was downloading a file in the background. Chrome asked for permission before it allowed more than one download. I had to click “allow” myself. E.ON’s portal only goes six months back, so the invoices from before spring 2023 may simply not exist online.

I would still choose this over copying numbers by hand. I read and checked the results instead of typing them in.

The monthly reports from Huawei. The FusionSolar portal has a plant report by year with a row per month. The old numbers in my spreadsheet were rounded. The portal’s are not.

What’s unclear or broken

How many kWh I use myself. The inverter reports what the panels produce, and the meter reports what we export. Self-consumption is the difference. There is no meter for it, so I cannot see which hours it happened in. I assume it follows the shape of the export. That is close, not exact.

Almost everything about the battery price. I found a Huawei battery of 13.8 kWh at roughly 47,000 kr installed after the 50% green tax deduction. It comes from web searches, not from a quote. I would not decide anything on that number before I have an offer.

A mistake the assistant made, and I caught. I asked it to read up on the latest battery rules and update the dashboard. It added a note that E.ON would introduce a peak-power fee on 1 September, based on search results. It was wrong. The government stopped the requirement in March, and E.ON paused its plan. I knew because I had seen the notice. It is now removed. The lesson: when the source page will not load, the honest answer is “I could not check this”, not the best search hit.

Decisions made

The battery, in numbers. With the price above, a battery of 13.8 kWh would save us about 3,500 kr a year from storing our own solar power and from buying cheap power at night. That is a payback of about 13 years, and it loses around 11,000 kr over ten years. With today’s rules and today’s prices, it is not a good investment on its own.

Two things could change that. Paid flexibility, where you let the grid operator use the battery for balancing, is quoted at 7,000 to 16,000 kr a year by companies that sell it, but the payments have fallen a lot. And if a peak-power fee comes back, I estimate a battery could cut our monthly peaks by three to four kW. What that is worth depends on a price nobody has set.

The battery goes on hold. I will not buy one now. I will re-run the simulation when one of three things happens: I get a real offer, flexibility payments settle, or the regulator lands on a new fee model. The Swedish energy regulator is due to propose one by April 2027.

Reduce what we use before we store it. This is where I have changed my mind. In January we bought about 3,100 kWh. In July, about 150. The difference is winter, and I suspect most of it is heating. Every kWh we do not need is worth the full price we would have paid, somewhere between 1.5 and 2.5 kr. A battery, by comparison, earns something like 350 kr a year for each kWh of storage.

My working view is that the house comes first and the battery second. A smaller load also means a smaller battery is enough, which makes it cheaper.

I cannot prove that yet, and I want to be clear about why. I do not have prices for the alternatives. I have not measured how much of our winter use is heating, and how much is the rest of the house. That is the next piece of work.

Tooling & process

  • Claude in Chrome for pulling data from logged-in sites.
  • The Tibber API, with the token kept in 1Password and never in a file.
  • A small optimiser for the battery: it plans each day with full knowledge of the prices, which gives an upper limit. A real system will do a bit worse.
  • git, with a branch and a merge per change. I should have done that from the start.

The habit I want to keep is asking every investment the same question in the same units. Kronor saved per year, per krona spent. That is what lets a battery and a heat pump sit in the same table.


— Stefan