Author Topic: Classic Monitoring with a raspberry pi  (Read 2574 times)

welmore

  • Newby
  • *
  • Posts: 15
Re: Classic Monitoring with a raspberry pi
« Reply #15 on: April 22, 2018, 12:16:19 PM »
Here is an updated "Logging.php" file.

   There are some new comments added.
   The issues with the "Solar_Log.dat" file is fixed.  The old version caused multiple entries each day.
   New code to update and display the "history.txt" file was added.

At the bottom of "Solar_Monitoring_Gauges_plus.php" is the code to ready and display the history information.

<?php
//Display history
$HistoryLog = fopen ($dir."history.txt","r");
for ($a = 0; $a <= 6; $a++){
   $History[$a] = fgetcsv($HistoryLog);
}
fclose($HistoryLog);
echo('<br><table><tr><td ALIGN=Center>Date<td ALIGN=Center>S1 Peak<td ALIGN=Center>S1 kWhr<td ALIGN=Center>S2 Peak<td ALIGN=Center>S2 kWhr');
for ($a = 0; $a <= 6; $a++){
   echo('<TR>');
   $HDay=$History[$a];
   echo('<td ALIGN=Center>'.substr($HDay[0],4,2).'/'.substr($HDay[0],6,2));
        echo('<td ALIGN=Center>'.$HDay[1]);
        echo('<td ALIGN=Center>'.number_format($HDay[2],$decimals=1));
        echo('<td ALIGN=Center>'.$HDay[3]);
        echo('<td ALIGN=Center>'.number_format($HDay[4],$decimals=1));
}
echo('</table>');



?>

Feel free to rearrange as you wish.

The "history.txt" file needs to be in your "Data/" folder there the "current.txt" file is.

The existing history data is from my system.  It will rotate out in 7 days.

Each day, around midnight, the "Logging.php" program will update the "history.txt" file, add a daily record to "Solar_log.dat" and reset the daily highs and lows saved in Dlog_Data
  • .


Contact me with questions, comments, or suggestions.

Have a great day

Others interested, I will supply all required files and instructions on request.

binkino

  • Sr. Member
  • ****
  • Posts: 251
    • BinKino's PV
Re: Classic Monitoring with a raspberry pi
« Reply #16 on: April 23, 2018, 02:34:20 PM »
Thanks Wade, that makes it so complete and perfect now,
have added the code to one of my gauges page and to my Lcars page and now waiting for it collects some days data and then I will see, how I can finetune it on my Lcars page.
(see link below)
If someone want to have the code for one of my pages too, let me know in comment / post here
PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Westech Combi 3000 + 3x4x240Wp + 1x4x255Wp + 575 AH EPzS
http://a68k.de:81/Solar/Monitor_LC.php