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