← Back to blog

The real cost of your energy: what it costs to produce one kWh at home with a LiFePO4 battery

When you open the fridge, you don't think about how many cents each minute of the compressor costs. You pay a monthly bill and that's it. But two prices of electricity coexist in your home, and if you want to make a good decision about self-consumption, you need to understand both.

The first is the price you pay the utility: what appears on your bill, made up of generation cost + grid fees + taxes + VAT. In Spain, with the 2.0TD tariff, it ranges between €0.12 and €0.28 per kWh depending on the time of day. That's the visible price.

The second is the price it costs you to produce it yourself: the price of the kWh that comes out of your panels or your battery. This one doesn't appear anywhere, nobody charges it, but it's the key figure to know whether an installation makes economic sense. That's the invisible price — and the technical name for it is LCOE: Levelized Cost of Energy.

What LCOE means: cost per kWh like the cost per kilometre of your car

LCOE is the universal metric the entire energy industry uses to compare generation technologies. The basic formula is simple:

LCOE = (Total lifetime cost) ÷ (Total lifetime energy produced)

The clearest analogy is the cost per kilometre of your car. When you calculate what each kilometre actually costs you, you don't just add up petrol. You also include the purchase price spread across the years you'll own it, maintenance, MOT, insurance, tyres. All lifetime costs, divided by the kilometres you'll drive.

With a solar installation it's the same. Costs include panels, inverter, battery, installation, maintenance and possible replacements. The energy produced is the sum of all useful kWh you'll actually consume over the lifetime of the system (typically 30-40 years for panels, 25-40 for the battery).

The Spanish 2.0TD tariff: why the grid has three prices a day

Since 2021, all Spanish households with up to 15 kW contracted are on the 2.0TD tariff, which divides the day into three periods at three different prices:

Spanish 2.0TD tariff — 3 periods, 3 prices Approximate PVPC prices (2026), all included (energy + grid fees + taxes + VAT) P1 — Peak ~28 c€/kWh Weekdays 10h-14h and 18h-22h → Consume from battery or direct solar P2 — Mid ~17 c€/kWh 8h-10h, 14h-18h, 22h-24h → Evaluate based on available solar P3 — Off-peak ~12 c€/kWh Nights, weekends, holidays → Charge battery from the grid if needed Difference Peak vs Off-peak: 16 c€/kWh This is what makes hourly arbitrage profitable.
The Spanish 2.0TD tariff defines three price periods. A battery that charges off-peak and discharges at peak times captures the 16 c€/kWh spread each cycle.

For a typical home consuming 5,000-7,000 kWh/year, the weighted average grid price sits around €0.17-0.20/kWh all included. This is the figure to keep in mind when comparing against the cost of producing your own energy.

Solar production: catalogue figures vs reality on the roof

When you buy a 650 Wp solar panel, that's the maximum power under ideal laboratory conditions (1,000 W/m² irradiance, 25°C cell temperature, AM1.5 spectrum). Those conditions are rare in real life. On the roof, production is noticeably lower than the catalogue says.

The European standard tool to estimate real production is PVGIS (the official European Commission tool, based on satellite weather data). It applies a Performance Ratio (PR) typically between 75% and 85% for a well-sized installation in southern Europe.

Concrete example with the case we'll use throughout this article: 8 Longi 650 Wp panels (5.2 kWp total) facing south, 30° tilt, on the Catalan coast:

  • STC theoretical maximum production: 9,205 kWh/year
  • PVGIS estimated production at the meter: 7,449 kWh/year
  • Performance Ratio: ~81%

This 19% gap isn't a defect. They're normal and unavoidable losses: summer heat (modules lose ~0.3-0.4% per °C above 25°C), dirt, mismatching, incidence angle, wiring, annual degradation (~0.5%/year).

Warning: if someone sells you an installation promising "catalogue maximum" output, they're selling smoke. The realistic figure is always PVGIS with PR applied.

The journey of a kWh from the sun to the lightbulb

To understand LCOE you first need to understand the path energy takes from the panel to the lightbulb. Not everything the panels generate reaches your consumption: each conversion has losses.

Three flows in a panels + inverter + battery installation:

  • Flow A — Direct consumption (during the day, same moment as generation): Panels (DC) → Inverter (AC) → Home. Efficiency: 95.3%
  • Flow B — Via battery (stored and consumed later): Panels (DC) → Inverter 1 (AC) → Inverter 2 (DC, charge) → Battery → Inverter 2 (AC, discharge) → Home. Total efficiency: ~88%
  • Flow C — Surplus injected to the grid: Panels → Inverter → Grid. You get paid 3-8 c€/kWh (OMIE pool average ~5 c€).

The critical difference between flows is the number of energy conversions. Direct consumption goes through 1 inverter pass (DC panels → AC home). Going via battery makes 3 passes: AC bus → battery (charge) → round-trip storage → AC home (discharge). Each inverter pass loses 4-5% (95.3% efficiency), and the battery adds ~3% round-trip loss.

Case study: 5.2 kWp + 30 kWh LiFePO4 battery

Let's plug real numbers into the LCOE formula for a typical Catalan household installation:

  • Panels: 5.2 kWp Longi LR7-72HVH-650M, €3,500 turn-key
  • Inverter: Sungrow SH5.0RS hybrid 5 kW, €1,500 (one replacement assumed at year 15: +€1,500)
  • Battery: SolarBox SB30 30 kWh LiFePO4, €11,500 turn-key
  • Installation + permits + miscellaneous: €3,500
  • Total CAPEX: ~€19,000 (panels + inverter + battery + install), plus €1,500 inverter replacement year 15.
  • OPEX: minimal (no moving parts), assume €100/year inspection.
  • Lifetime: 30 years panels, 25-30 years battery (LiFePO4 grade-A at 1 cycle/day reaches 80% SoH around year 20-25).

Useful energy over 30 years (after Performance Ratio, battery losses, ~10% surplus that gets cheaply sold to grid):

  • Direct consumption (Flow A): ~110,000 kWh lifetime
  • Via battery (Flow B): ~85,000 kWh lifetime
  • Surplus to grid (Flow C): ~25,000 kWh lifetime (low value, ignored from LCOE)

Applying the formula:

  • LCOE direct solar = (panel + inverter + install share) ÷ direct kWh ≈ 2.3 c€/kWh
  • LCOE via battery = (panel + inverter + battery + install share) ÷ battery kWh ≈ 2.7 c€/kWh

That's 10-12× cheaper than buying the same kWh from the grid at peak hours (28 c€), and 6-8× cheaper than the weighted average grid price.

When does the battery pay back?

The honest answer depends on how you count it. Three methods give three different numbers:

Method A — Marginal cost: only the battery part. Cost €11,500. Annual savings from arbitrage + extra self-consumption: ~€1,800. Payback: ~6.4 years. This is the seller's number — it ignores that the panels also have a cost.

Method B — Full system, optimistic: assumes 100% self-consumption with no surplus. Cost €19,000. Annual savings vs grid: ~€2,400. Payback: ~8 years. Realistic only if your consumption perfectly matches generation, which rarely happens.

Method C — Full system, realistic: full system cost, real consumption pattern, surplus paid at market pool. Cost €19,000. Annual savings: ~€1,700. Payback: ~11 years. This is the conservative number — the one we recommend planning around.

After payback, the system continues producing essentially free energy for another 15-20 years. Over the full 30-year lifespan, the system saves the household €40,000-50,000 net of all costs.

Why your LCOE will be different

Three honest reasons the number in this article won't exactly match yours:

1. Your location. PVGIS production in Catalonia is ~1,432 kWh/kWp; in Germany it's ~950; in Andalusia ~1,600. The same hardware produces different amounts.

2. Your consumption pattern. A family at home during the day (retirees, remote workers) uses much more direct solar; a working family that's out 9-18h depends more on the battery. The split between Flow A and Flow B changes the LCOE.

3. Your installer's pricing. Quality varies. Quotes for the same kit can differ ±30%. Always demand: PVGIS report, real efficiency figures (not catalogue), and clarity on what's included (often electrical work, scaffolding, paperwork are extras).

Sodium-ion: what's coming

Sodium-ion cells (SIB) are reaching commercial maturity in 2026-2027. They promise: lower material cost (sodium is abundant, no lithium needed), better behaviour at low temperatures, and similar cycle life to LFP. The catch in 2026 is lower energy density (~30% bulkier than LFP for the same kWh) and still-limited grade-A supply.

At SolarBox we're closely monitoring sodium-ion. We've covered it in depth in our Catalan article on sodium-ion cells democratising storage. The short version: when grade-A SIB is widely available at €100/kWh, the LCOE numbers above will drop another 15-20%, and the case for storage becomes essentially undeniable.

Conclusion

The real cost of one kWh of self-produced solar+stored energy in 2026 is somewhere between 2.3 and 2.7 c€/kWh for a typical southern-European household. That's an order of magnitude cheaper than the grid at peak times, and 6-8× cheaper than the weighted average.

What separates a profitable installation from a so-so one isn't the headline price — it's how well the system is dimensioned for your actual consumption pattern, and how transparent your installer is about real (not catalogue) production figures.

Want the same LCOE calculation for your home, with your actual consumption and your roof? Request a free analysis. We compute it transparently — formulas, PVGIS data, real efficiency, no commercial promises. The full Catalan version of this article with day-by-day flow charts is here.