diff --git a/Verbraucher_1_Stufig/module.php b/Verbraucher_1_Stufig/module.php index c58e1bb..06cd2c0 100644 --- a/Verbraucher_1_Stufig/module.php +++ b/Verbraucher_1_Stufig/module.php @@ -59,6 +59,9 @@ class Verbraucher_1_Stufig extends IPSModule { // Methode zum Setzen des aktuellen Stromverbrauchs public function SetCurrentPower(float $power) { $this->CheckIdle($power); + if($this->GetValue("CurrentPower")!=$power){ + $this->SetTimerOn(); + } $this->SetValue("CurrentPower", $power); $boilerLeistung = $this->ReadPropertyInteger("BoilerLeistung"); $schaltkontaktID = $this->ReadPropertyInteger("Schaltkontakt1"); @@ -83,13 +86,7 @@ class Verbraucher_1_Stufig extends IPSModule { } // Methode zum Setzen der PowerSteps und Timer starten - public function SetPowerSteps($powerSteps) { - $currentPowerSteps = $this->GetValue("PowerSteps"); - - // Prüfen, ob sich PowerSteps geändert haben - if ($currentPowerSteps !== json_encode($powerSteps)) { - // PowerSteps haben sich geändert, neue Werte setzen - $this->SetValue("PowerSteps", json_encode($powerSteps)); + public function SetTimerOn($powerSteps) { // Timer setzen, der nach "Zeit_Zwischen_Zustandswechseln" abläuft $zeitZwischenZustandswechseln = $this->ReadPropertyInteger("Zeit_Zwischen_Zustandswechseln"); @@ -97,7 +94,7 @@ class Verbraucher_1_Stufig extends IPSModule { // Timer-Status auf true setzen $this->SetValue("IsTimerActive", true); - } + } // Methode zum Zurücksetzen von PowerSteps nach Ablauf des Timers diff --git a/library.json b/library.json index b12e995..c51d527 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "0.12", + "version": "0.13", "build": 0, "date": 0 } \ No newline at end of file