Monitoring Solar Output via MRTG

Brighton Honey Solar Array


I was successful in porting the solar inverter data to MRTG! This is accomplished with a 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 can “push” a file via FTP to a host at a selected 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 that 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 represent the data accurately, the solar data is an absolute number meaning that it is an actual reading at that moment in time and not cumulative such as a continuous counter. The script first 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, format the RRDTool command, and push it off to the DB.  Finally, I save the raw data file to a backup directory.
Some data are 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 features/functions also.
Let me know if you have any questions!
*This page will auto-refresh every 5 mins to update to the latest graphs

If you are having trouble seeing the graphs request the desktop version

Live Solar Power Generation

Updated: [php_everywhere instance=”1″]

System: Solar Inverter at Brighton Honey
Description: Live Solar Power Generation
Max Output: 6.460 kW
Peak Output today: [php_everywhere instance=”2″]
Generation today: [php_everywhere instance=”3″] kWh
Generation best: [php_everywhere instance=”4″]
Generation YTD: [php_everywhere instance=”5″] kWh
Generation Total: [php_everywhere instance=”6″] kWh