diff --git a/Verbraucher_1_Stufig/module.php b/Verbraucher_1_Stufig/module.php index de78b08..5838329 100644 --- a/Verbraucher_1_Stufig/module.php +++ b/Verbraucher_1_Stufig/module.php @@ -89,6 +89,13 @@ class Verbraucher_1_Stufig extends IPSModule $zeitZwischenZustandswechseln = $this->ReadPropertyInteger( "Zeit_Zwischen_Zustandswechseln" ); + + if ($zeitZwischenZustandswechseln <= 0) { + $this->SetTimerInterval("ZustandswechselTimer", 0); + $this->SetValue("IsTimerActive", false); + return; + } + $this->SetTimerInterval( "ZustandswechselTimer", $zeitZwischenZustandswechseln * 60000 @@ -161,16 +168,21 @@ class Verbraucher_1_Stufig extends IPSModule $this->SetValue("IstNacht", $NeuesIstNacht); - if ($Peak) { - $this->SetValue("PowerSteps", json_encode([0])); - return; - } $DailyOnTime = $this->GetValue("DailyOnTime"); $Mindestlaufzeit = $this->ReadPropertyInteger("Mindesttlaufzeit") * 60 * 12; + if ( + $Peak && + $this->ReadPropertyInteger("Mindesttlaufzeit") <= 0 && + $this->ReadPropertyInteger("Zeit_Zwischen_Zustandswechseln") <= 0 + ) { + $this->SetValue("PowerSteps", json_encode([0])); + return; + } + // Überprüfen, ob der Timer aktiv ist if ($this->GetValue("IsTimerActive")) { // Timer ist aktiv, PowerSteps setzen