Tracking solar panel output

Since purchasing and installing solar panels on my home I’ve been fascinated with my newfound ability to create free electricity from the sun and wanted to quantify it’s impact.

One thing niggled at me though. Despite opting for an internet-connected inverted (Enasolar 2kW), I’ve been unable to get an understanding of how much of the energy I generate in my home I use vs. send back to the grid. In order to make any sort of accurate predictions about how long it’s going to take me to pay off my solar system or indeed, whether it was worth getting a battery system, I need to combine three pieces of data:

  1. How much solar electricity my system generates
  2. How much solar electricity I send back to the grid
  3. How much energy I purchase from the grid.

With these numbers I can (crudely) work out:

1. How much solar energy I use in my house.

(Energy Purchased from the grid + Solar Generation) - Solar sent back to grid

2. How long it would take to pay off my inverter

Total cost of system / (Average daily amount of solar energy used * average cost of grid power per kWH)

3. How long it would take to pay off a battery

Total solar electricty sent back to the grid * average cost of purchasing this power from the grid

Note: This is a pretty flakey calculation as it should really accomodate the fact that I might not be able to store all the energy my panels generate if it’s over the capacity of the battery (eg. if I make over 7Kwh of energy in a day, I’d fill up a Tesla powerwall and start sending electricy back to the grid).

I use powershop, so the last two numbers are readily available in CSV form and although I can get a 5 minute breakdown of solar generation from my inverter, it doesn’t have an API. It does have a url where the CSV file can be downloaded though, so I could download and parse that into a format I could use. I chose to write a ruby script running (initally on my laptop, later on my raspberry pi).

I managed to get these numbers out - it’ll take me about 6 years to pay off my solar panels which is fantastic.

Along the way I discovered weatherunderground and pvoutput.org. For long term web-based monitoring of the output of my solar panels, these sites are excellent as both have APIs so I was able to adapt my scripts to talk with PVoutput.

With some interruptions due to poor wifi signals I can now see I’m tracking here in almost real-time. Although PVoutput can deal with updates in real time, I discovered my inverter only updates it’s logs once per hour.

PVoutput showing a plot of solar generation combined with temperature via API and Ruby Script.
PVoutput 5 minute solar and temperature data.