no message

This commit is contained in:
belevo\mh
2025-12-17 08:36:43 +01:00
parent 26fd4a4159
commit 38f450b00e
+13 -12
View File
@@ -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,