Monitoring Solar Output via MRTG

Brighton Honey Solar Array

I was successful in porting the solar inverter data to MRTG! This is accomplished with program called RRDTool developed by the author of the original MRTG. A script was needed to import the raw solar data into a database using a handy language called python. RRDTool uses a database called Round Robin Database thus the RRD.

The solar inverter has the ability to “push” a file via FTP to a host at a selective time interval. Currently I have it pushing every minute to a server. A cron job calls a script every 5 mins which then imports the data to the round robin database. The graphs are generated on the fly with a CGI script which calls to RRDTool to generate the graphs.

Since MRTG was developed to read data network interface statistics I had to work with different options to accurately represent the data. The solar data is an absolute number meaning that it is an actual reading a that moment in time and not cumulative such as a continuous counter. The script fist looks for the database file and if it does not exist it will create an empty file with the proper layout for the data.   In this case the actual generation in real-time in watts.  If the file exists it looks for the raw data files and creates a list for import. The first file in the list is opened the time stamp found, reformatted then saved to a variable.  Next I get the actual data into a variable then format the RRDTool command and push it off to the DB.  Finally I save the raw data file to a backup directory.

There is some data missing as I was not logging for a while and I have a gap in the data as I lost some while developing the script. For a little extra fun I enabled mod_proxy in Apache so the graphs, database and logging are on another server of mine “hidden” behind this one. This was a learning experiment for me to integrate feature/function also.
Let me know if you have any questions!

*This page will auto-refresh every 5 mins to update to the latest graphs

Live Solar Power Generation

Updated:Tue Dec 11 15:07:00 2018

System:Solar Inverter at Brighton Honey
Description:Live Solar Power Generation
Max Output:5.100 kW
Peak Output today:0.000 kW @ 00:00:00
Generation today:0.000 kWh
Generation best:31.558 kWh @ 2018-04-30
Generation YTD:4097.392 kWh
Generation Total:7240.542kWh

‘Daily’ graph

Brighton Honey Solar daily-graph

‘Weekly’ graph (30 Minute Average)

Brighton Honey Solar weekly-graph

‘Monthly’ graph (2 Hour Average)

Brighton Honey Solar monthly-graph

‘Yearly’ graph (1 Day Average)

Brighton Honey Solar yearly-graph

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.