effizienter gemacht

This commit is contained in:
belevo\mh
2025-01-21 09:28:53 +01:00
parent 18ecef6a70
commit 75eef3411d
2 changed files with 9 additions and 24 deletions

View File

@@ -113,39 +113,24 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
if ($boilertemperatur_glätten) { if ($boilertemperatur_glätten) {
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1"); $boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
if (IPS_VariableExists($boilerFuehlerPT1ID)) { $boilerPT1 = IPS_VariableExists($boilerFuehlerPT1ID) ? GetValue($boilerFuehlerPT1ID) : 0.0;
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
} else {
$boilerPT1 = 0.0;
}
$boilerTemp_test = $this->GetIDForIdent("Boilertemperatur");
if (IPS_VariableExists($boilerTemp_test)) {
$boilerTemp_test = $this->GetValue("Boilertemperatur");
} else {
$boilerTemp_test = 0.0;
}
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
$boilerTemp_test = $this->GetValue("Boilertemperatur"); $boilerTemp_test = $this->GetValue("Boilertemperatur");
$time_constant= $this->ReadPropertyInteger("ZeitKonstante");
$delta_t = 30; $time_constant = $this->ReadPropertyInteger("ZeitKonstante");
$delta_t = 30;
$alpha = $delta_t / ($time_constant + $delta_t); $alpha = $delta_t / ($time_constant + $delta_t);
$newBoilerTemp = $boilerTemp_test + $alpha * ($boilerPT1 - $boilerTemp_test); $newBoilerTemp = $boilerTemp_test + $alpha * ($boilerPT1 - $boilerTemp_test);
$this->SetValue("Boilertemperatur", $newBoilerTemp); $this->SetValue("Boilertemperatur", $newBoilerTemp);
} else { } else {
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1"); $boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
if (IPS_VariableExists($boilerFuehlerPT1ID)) { $boilerPT1 = IPS_VariableExists($boilerFuehlerPT1ID) ? GetValue($boilerFuehlerPT1ID) : 0.0;
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
} else {
$boilerPT1 = 0.0;
}
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
$this->SetValue("Boilertemperatur", $boilerPT1); $this->SetValue("Boilertemperatur", $boilerPT1);
} }
$boilerTemp = $this->GetValue("Boilertemperatur"); $boilerTemp = $this->GetValue("Boilertemperatur");
$minTemp = $this->GetValue("Mindesttemperatur"); $minTemp = $this->GetValue("Mindesttemperatur");

View File

@@ -6,7 +6,7 @@
"compatibility": { "compatibility": {
"version": "7.1" "version": "7.1"
}, },
"version": "0.281", "version": "0.282",
"build": 0, "build": 0,
"date": 0 "date": 0