Fehlerbehebung
This commit is contained in:
@@ -18,6 +18,10 @@ class Verbraucher_1_Stufig extends IPSModule {
|
||||
$this->RegisterVariableFloat("UsedEnergy", "UsedEnergy", "", 0);
|
||||
$this->RegisterVariableString("PowerSteps", "PowerSteps"); // PowerSteps-Variable registrieren
|
||||
|
||||
// Neue Variable für den Timer-Status
|
||||
$this->RegisterVariableBoolean("IsTimerActive", "IsTimerActive", "", 0);
|
||||
$this->SetValue("IsTimerActive", false);
|
||||
|
||||
// Trägheit
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 4);
|
||||
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
||||
@@ -85,6 +89,9 @@ class Verbraucher_1_Stufig extends IPSModule {
|
||||
// Timer setzen, der nach "Zeit_Zwischen_Zustandswechseln" abläuft
|
||||
$zeitZwischenZustandswechseln = $this->ReadPropertyInteger("Zeit_Zwischen_Zustandswechseln");
|
||||
$this->SetTimerInterval("ZustandswechselTimer", $zeitZwischenZustandswechseln * 1000); // Timer in Millisekunden
|
||||
|
||||
// Timer-Status auf true setzen
|
||||
$this->SetValue("IsTimerActive", true);
|
||||
}
|
||||
|
||||
// Methode zum Zurücksetzen von PowerSteps nach Ablauf des Timers
|
||||
@@ -94,6 +101,9 @@ class Verbraucher_1_Stufig extends IPSModule {
|
||||
|
||||
// Timer stoppen
|
||||
$this->SetTimerInterval("ZustandswechselTimer", 0);
|
||||
|
||||
// Timer-Status auf false setzen
|
||||
$this->SetValue("IsTimerActive", false);
|
||||
}
|
||||
|
||||
// Methode zum Abrufen der aktuellen Daten
|
||||
@@ -101,7 +111,7 @@ class Verbraucher_1_Stufig extends IPSModule {
|
||||
$IstNacht = $this->GetValue("IstNacht");
|
||||
$NeuesIstNacht = $this->ist_nachts();
|
||||
|
||||
if($IstNacht==true && $NeuesIstNacht==false){
|
||||
if($IstNacht == true && $NeuesIstNacht == false){
|
||||
$this->SetValue("DailyOnTime", 0);
|
||||
}
|
||||
|
||||
@@ -110,17 +120,24 @@ class Verbraucher_1_Stufig extends IPSModule {
|
||||
$DailyOnTime = $this->GetValue("DailyOnTime");
|
||||
$Mindestlaufzeit = $this->ReadPropertyInteger("Mindesttlaufzeit") * 60 * 12;
|
||||
|
||||
if($NeuesIstNacht && ($DailyOnTime < $Mindestlaufzeit)){
|
||||
if($Peak){
|
||||
// Überprüfen, ob der Timer aktiv ist
|
||||
if($this->GetValue("IsTimerActive")) {
|
||||
// Timer ist aktiv, PowerSteps setzen
|
||||
$this->SetValue("PowerSteps", json_encode([$this->GetValue("CurrentPower")]));
|
||||
}
|
||||
// Wenn Nacht und Mindestlaufzeit nicht erreicht ist
|
||||
else if($NeuesIstNacht && ($DailyOnTime < $Mindestlaufzeit)) {
|
||||
if($Peak) {
|
||||
$this->SetValue("PowerSteps", json_encode([0, $this->ReadPropertyInteger("BoilerLeistung")]));
|
||||
}else{
|
||||
} else {
|
||||
$this->SetValue("PowerSteps", json_encode([$this->ReadPropertyInteger("BoilerLeistung")]));
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($Peak){
|
||||
}
|
||||
// Andernfalls
|
||||
else {
|
||||
if($Peak) {
|
||||
$this->SetValue("PowerSteps", json_encode([0]));
|
||||
}else{
|
||||
} else {
|
||||
$this->SetValue("PowerSteps", json_encode([0, $this->ReadPropertyInteger("BoilerLeistung")]));
|
||||
}
|
||||
}
|
||||
@@ -156,5 +173,6 @@ class Verbraucher_1_Stufig extends IPSModule {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"compatibility": {
|
||||
"version": "7.1"
|
||||
},
|
||||
"version": "0.10",
|
||||
"version": "0.11",
|
||||
"build": 0,
|
||||
"date": 0
|
||||
}
|
||||
Reference in New Issue
Block a user