Solar systems have come a long way in recent years, especially with the addition of batteries that enable households to “save up” power generated during the peak of the day and use it later in the evening.
This weekend, I’ve been trying to do some math around the payback period — essentially, whether it makes financial sense to install solar. The problem is that most calculators I find online are generic and, to be honest, a bit thick-headed. They don’t factor in the specific sunlight my house receives and rely on a lot of guestimates to come up with an answer — not the kind of due diligence I want to rely on before dropping tens of thousands of dollars on a system.
Quick conclusion: If you live in your forever home, it is very likely that installing solar is a great idea today financially, because:
- Solar systems are cheaper than ever; For example Trade Depot has their various systems broken down by specs including installation listed transparently on their website (Trade Depot).
- All the major banks offer "green loans" at 0% or 1% interest fixed for 3-5 years which offset the cost of installation as a home loan top-up.
- New Zealand's total power generation isn't increasing anytime soon; therefore, the cost of power is unlikely to reduce.
All this is good to say, but I want some solid data to back this up! So, what do I do? Of-course this is the age of AI, so I spent my Sunday vibe coding a personalized solar payback calculator, that takes into consideration:
- The exact sunlight a property receives on an hourly and daily basis based on NIWA calculations using the typical meteorological table.
- The exact half-hourly usage data that I can export from my power provider for the entire year
- My current and future providers
- Input fields for the specs of any solar system I'm considering
- Compare my current provider who I'd stay with, without solar since they offer the best pricing, vs switching to a new "solar friendly" provider who would be way more expensive to switch now but makes sense with solar, so I can truly understand the "savings", as otherwise the payback period and "expected savings" would be artificially more / faster.
As a reminder, NIWA has mapped out the amount of solar any given location in New Zealand will get at any hour and day of the year. This is incredibly useful as it gives a very accurate hour by hour perspective for the simulation my app runs above.
Before the age of AI and vibe coding, something like this would have taken me weeks having all but forgotten the intricate details of programming. It's incredible how AI and especially coding agents like Co-pilot with Grok Code, can accelerate development and help answers so fast.
Assumptions & Logic
| Category | Assumption/Logic |
|---|---|
| Energy Consumption Priority | 1. Solar power used first (direct consumption) 2. Battery power used second 3. Grid power used last |
| Excess Energy Priority | 1. Charge battery first (if enabled and capacity available) 2. Export remainder to grid at export rate |
| Solar Generation | Based on NIWA TMY "Tilted Irr." data with 80% performance ratio Limited by inverter capacity (kW rating) |
| Battery Efficiency | 90% round-trip efficiency (95% charge × 95% discharge) Power limited by inverter capacity |
| Time-of-Use Rates | Day rate: 7:00 AM - 9:00 PM Night rate: 9:00 PM - 7:00 AM Applied to both grid purchases and usage calculations |
| Provider Comparison | Baseline cost uses current provider rates Solar cost uses future provider rates (allowing provider switch) Savings = Current provider cost - Future provider cost with solar |
| Daily Fixed Charges | Current provider fixed charge applied to baseline scenario Future provider fixed charge applied to solar scenario Both increase annually by inflation rate |
| Price Inflation | Same inflation rate applied to both provider rates and fixed charges Export rate remains constant (no inflation) |
| Usage Data | 30-minute intervals summed to hourly consumption If no usage file: annual estimates divided by time periods |
| Payback Calculation | Cumulative savings start at negative installation cost Payback achieved when cumulative savings become positive |
| Simulation Period | Hourly simulation over 365 days using TMY weather data 10-year financial projection with compounding inflation |