no message
This commit is contained in:
+10
-9
@@ -100,16 +100,17 @@ private function RecalculateAndPush(): void
|
|||||||
|
|
||||||
[$tStart, $tEnd] = $this->getRange($range, $date);
|
[$tStart, $tEnd] = $this->getRange($range, $date);
|
||||||
|
|
||||||
// Archiv-Deltas
|
// Debug-Container initialisieren (sonst "Undefined variable")
|
||||||
$prod = $this->readDelta($this->ReadPropertyInteger('VarProduction'), $tStart, $tEnd);
|
$dbgProd = null;
|
||||||
$feed = $this->readDelta($this->ReadPropertyInteger('VarFeedIn'), $tStart, $tEnd);
|
$dbgFeed = null;
|
||||||
$grid = $this->readDelta($this->ReadPropertyInteger('VarGrid'), $tStart, $tEnd);
|
$dbgGrid = null;
|
||||||
|
|
||||||
|
$prod = $this->readDelta($this->ReadPropertyInteger('VarProduction'), $tStart, $tEnd, $dbgProd);
|
||||||
|
$feed = $this->readDelta($this->ReadPropertyInteger('VarFeedIn'), $tStart, $tEnd, $dbgFeed);
|
||||||
|
$grid = $this->readDelta($this->ReadPropertyInteger('VarGrid'), $tStart, $tEnd, $dbgGrid);
|
||||||
|
|
||||||
// Hausverbrauch = Produktion - Einspeisung + Netz
|
|
||||||
$house = $prod - $feed + $grid;
|
$house = $prod - $feed + $grid;
|
||||||
if ($house < 0) {
|
if ($house < 0) $house = 0.0;
|
||||||
$house = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$payload = [
|
$payload = [
|
||||||
'range' => $range,
|
'range' => $range,
|
||||||
@@ -120,7 +121,7 @@ private function RecalculateAndPush(): void
|
|||||||
'Produktion' => (float)$prod,
|
'Produktion' => (float)$prod,
|
||||||
'Einspeisung' => (float)$feed,
|
'Einspeisung' => (float)$feed,
|
||||||
'Netz' => (float)$grid,
|
'Netz' => (float)$grid,
|
||||||
'Hausverbrauch'=> (float)$house
|
'Hausverbrauch' => (float)$house
|
||||||
],
|
],
|
||||||
'debug' => [
|
'debug' => [
|
||||||
'prod' => $dbgProd,
|
'prod' => $dbgProd,
|
||||||
|
|||||||
Reference in New Issue
Block a user