added more debug output in pvoutput.php

This commit is contained in:
2012-12-02 13:19:11 +01:00
parent aa8d7d641f
commit 95a81d8430

View File

@@ -62,7 +62,7 @@ if (isset($aFields[FIELD])) {
foreach ($aData as $sRow) {
$aRow = explode(' ', $sRow);
$iDate = substr($aRow[0], 0, -1);
$iInterval = $bFirst ? (($bFirst = false) || RESOLUTION) : $iDate - $iLast;
$iInterval = $bFirst ? (($bFirst = false) || RESOLUTION) : $iDate - $iLast; // s
if (($fValue = floatval($aRow[$iField])) > 0) { // W
$fEnergy += $iInterval * $fValue; // Ws
}
@@ -96,7 +96,7 @@ if (isset($fTemperature)) {
}
/* Store debug data */
file_put_contents('pvoutput.debug', json_encode(array($argv, $aData)) . "\n", FILE_APPEND);
file_put_contents('pvoutput.debug', json_encode(array($argv, $fEnergy, $aToday, $aData)) . "\n", FILE_APPEND);
/* Send data to PVOutput */
if (isset($aSystems[$sSerial])) {
@@ -109,4 +109,4 @@ if (isset($aSystems[$sSerial])) {
CURLOPT_POSTFIELDS => http_build_query($aData),
CURLOPT_RETURNTRANSFER => true));
$sResult = curl_exec($rCurl);
}
}