From f6afc892d3761717f9c5cbd4341283e454458cbc Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Tue, 12 May 2026 10:06:58 +0200 Subject: [PATCH] no message --- Bat_EV_SDL_V4/module.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Bat_EV_SDL_V4/module.php b/Bat_EV_SDL_V4/module.php index bc89f65..38b7708 100644 --- a/Bat_EV_SDL_V4/module.php +++ b/Bat_EV_SDL_V4/module.php @@ -66,10 +66,16 @@ class Bat_EV_SDL_V4 extends IPSModule ($intervalSec > 0) ? $intervalSec * 1000 : 0 ); - $this->BuildBatteryPlan(true); - $this->InitVirtualAccountsIfNeeded(); + $this->BuildBatteryPlan(true); - $this->Update(); + // Kein automatischer Reset der virtuellen Konten bei ApplyChanges. + // Nur Initialisierung von Zeitstempel/Init-Flag, falls noch nie vorhanden. + if ($this->GetBufferSafe("Int_Init") !== "1") { + $this->SetBuffer("Int_LastTs", (string)microtime(true)); + $this->SetBuffer("Int_Init", "1"); + } + + $this->Update(); } public function RequestAction($Ident, $Value) @@ -345,10 +351,10 @@ class Bat_EV_SDL_V4 extends IPSModule private function InitVirtualAccountsIfNeeded(): void { - if ($this->GetBufferSafe("Int_Init") === "1") { - return; + if ($this->GetBufferSafe("Int_Init") !== "1") { + $this->SetBuffer("Int_LastTs", (string)microtime(true)); + $this->SetBuffer("Int_Init", "1"); } - $this->ResetVirtualAccounts(); } public function ResetVirtualAccounts(): void