diff --git a/Bat_EV_SDL_V4/module.php b/Bat_EV_SDL_V4/module.php index aec0b06..fce8ad7 100644 --- a/Bat_EV_SDL_V4/module.php +++ b/Bat_EV_SDL_V4/module.php @@ -543,8 +543,8 @@ class Bat_EV_SDL_V4 extends IPSModule $rawSDL = $pSdlW * $factor; } else { // KEIN Sprung mehr auf Soll! - $rawEV = 0.0; - $rawSDL = 0.0; + $rawEV = (float)$this->GetBufferSafe("CUR_EV_VAL"); + $rawSDL = (float)$this->GetBufferSafe("CUR_SDL_VAL"); } $filterAktiv = $this->ReadPropertyBoolean("FilterAktiv"); @@ -629,7 +629,8 @@ class Bat_EV_SDL_V4 extends IPSModule $hits = 0; } } else { - $lastVal = $this->MoveTowards($lastVal, $pending, $maxRampWPerSec * $dt); + // Rohwert passt nicht zum Sollwert: + // NICHT Richtung Soll laufen, sondern alten Wert halten. $hits = 0; } @@ -846,14 +847,16 @@ class Bat_EV_SDL_V4 extends IPSModule } private function MoveTowards(float $current, float $target, float $maxStep): float - { - if (abs($target - $current) <= $maxStep) { - return $target; - } + { + $maxStep = max(0.0, $maxStep); - return $current + (($target > $current) ? $maxStep : -$maxStep); + if (abs($target - $current) <= $maxStep) { + return $target; } + return $current + (($target > $current) ? $maxStep : -$maxStep); + } + private function SetIdentValue(string $ident, $value): void { $id = @$this->GetIDForIdent($ident);