no message

This commit is contained in:
mh
2026-05-04 13:45:57 +02:00
parent 50ad7deac9
commit 564b7815f2
2 changed files with 26 additions and 3 deletions
+5
View File
@@ -107,6 +107,11 @@
"suffix": "Sekunden",
"minimum": 0,
"maximum": 86400
},
{
"type": "CheckBox",
"name": "FilterAktiv",
"caption": "Aktuelle Leistung filtern"
}
]
}
+21 -3
View File
@@ -11,6 +11,7 @@ class Bat_EV_SDL_V3_Beta extends IPSModule
$this->RegisterPropertyInteger("SDL_Leistung_Laden", 0);
$this->RegisterPropertyInteger("SDL_Leistung_Entladen", 0); // W
$this->RegisterPropertyInteger("UpdateInterval", 5); // Minuten
$this->RegisterPropertyBoolean("FilterAktiv", true);
// Status
$this->RegisterVariableBoolean("State", "Aktiv", "~Switch", 1);
$this->EnableAction("State");
@@ -876,11 +877,28 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array
$tolW_EV = abs($targetEV) * $tolPct;
$tolW_SDL = abs($targetSDL) * $tolPct;
$fEV = $filterCurrent("EV", $rawEV, $targetEV, $tolW_EV, $needHits);
$fSDL = $filterCurrent("SDL", $rawSDL, $targetSDL, $tolW_SDL, $needHits);
$filterAktiv = $this->ReadPropertyBoolean("FilterAktiv");
if ($filterAktiv) {
$fEV = $filterCurrent("EV", $rawEV, $targetEV, $tolW_EV, $needHits);
$fSDL = $filterCurrent("SDL", $rawSDL, $targetSDL, $tolW_SDL, $needHits);
} else {
// Filter deaktiviert: Rohwerte direkt übernehmen
$fEV = $rawEV;
$fSDL = $rawSDL;
// Optional: alte Filter-Buffer zurücksetzen
$this->SetBuffer("CUR_EV_INIT", "");
$this->SetBuffer("CUR_EV_VAL", "");
$this->SetBuffer("CUR_EV_PEND", "");
$this->SetBuffer("CUR_EV_HITS", "");
$this->SetBuffer("CUR_SDL_INIT", "");
$this->SetBuffer("CUR_SDL_VAL", "");
$this->SetBuffer("CUR_SDL_PEND", "");
$this->SetBuffer("CUR_SDL_HITS", "");
}
// Setzen (wichtig: SetIdentValue!)
$this->SetIdentValue("Aktuelle_Leistung_EV", (float)$fEV);
$this->SetIdentValue("Aktuelle_Leistung_SDL", (float)$fSDL);