profil entfernt
glättung wahl eingfügt
This commit is contained in:
@@ -15,16 +15,13 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
|
||||
|
||||
// Boiler spezifische Variablen
|
||||
$this->RegisterVariableProfile("Boiler.Temperature", 1, "°C");
|
||||
$this->RegisterVariableInteger("Mindesttemperatur","Mindesttemperatur","Boiler.Temperature",45);
|
||||
$this->EnableAction("Mindesttemperatur");
|
||||
$this->RegisterVariableInteger("Maximaltemperatur","Maximaltemperatur","Boiler.Temperature",60);
|
||||
$this->EnableAction("Maximaltemperatur");
|
||||
$this->RegisterVariableInteger("Legionellentemperatur","Legionellentemperatur","Boiler.Temperature",65);
|
||||
$this->EnableAction("Legionellentemperatur");
|
||||
|
||||
$this->RegisterVariableInteger("Mindesttemperatur","Mindesttemperatur","",45);
|
||||
$this->RegisterVariableInteger("Maximaltemperatur","Maximaltemperatur","",60);
|
||||
$this->RegisterVariableInteger("Legionellentemperatur","Legionellentemperatur","",65);
|
||||
$this->RegisterVariableInteger("LegioCounter", "LegioCounter", "", 0);
|
||||
//$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0);
|
||||
$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "Boiler.Temperature", 0);
|
||||
$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0);
|
||||
|
||||
|
||||
// Variabeln für Kommunkation mit Manager
|
||||
@@ -47,6 +44,7 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
public function ApplyChanges()
|
||||
{
|
||||
parent::ApplyChanges();
|
||||
$boilertemperatur_glätten = $this->ReadPropertyBoolean("Boilertemperatur_glätten");
|
||||
}
|
||||
|
||||
public function RequestAction($Ident, $Value)
|
||||
@@ -54,14 +52,7 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
IPS_LogMessage("Boiler Debug", "RequestAction triggered: $Ident = $Value");
|
||||
|
||||
switch ($Ident) {
|
||||
case "Mindesttemperatur":
|
||||
case "Maximaltemperatur":
|
||||
case "Legionellentemperatur":
|
||||
|
||||
$this->SetValue($Ident, $Value);
|
||||
IPS_LogMessage("Boiler Debug", "$Ident updated to $Value");
|
||||
break;
|
||||
|
||||
|
||||
case "SetAktuelle_Leistung":
|
||||
|
||||
$this->SetAktuelle_Leistung($Value);
|
||||
@@ -77,14 +68,6 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
}
|
||||
}
|
||||
|
||||
private function RegisterVariableProfile(string $name, int $type, string $suffix)
|
||||
{
|
||||
if (!IPS_VariableProfileExists($name)) {
|
||||
IPS_CreateVariableProfile($name, $type);
|
||||
IPS_SetVariableProfileText($name, "", $suffix);
|
||||
}
|
||||
}
|
||||
|
||||
// Methode zum Setzen des aktuellen Stromverbrauchs
|
||||
public function SetAktuelle_Leistung(int $power)
|
||||
{
|
||||
@@ -125,27 +108,45 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
$LegioCounter = $this->GetValue("LegioCounter");
|
||||
|
||||
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
|
||||
$boilertemperatur_glätten = $this->ReadPropertyBoolean("Boilertemperatur_glätten");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
if ($boilertemperatur_glätten) {
|
||||
// Wenn Glättung aktiviert ist, führe das Glätten durch
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
} else {
|
||||
$boilerPT1 = 0.0; // Standardwert
|
||||
}
|
||||
|
||||
$boilerTempID = $this->GetIDForIdent("Boilertemperatur");
|
||||
if (IPS_VariableExists($boilerTempID)) {
|
||||
$boilerTemp = $this->GetValue("Boilertemperatur");
|
||||
} else {
|
||||
$boilerTemp = 0.0; // Standardwert
|
||||
}
|
||||
|
||||
// PT
|
||||
$time_constant = 120; // Zeitkonstante in Sekunden (1 Minute)
|
||||
$delta_t = 30; // Zeitdifferenz zwischen den Messungen (30 Sekunden)
|
||||
$alpha = $delta_t / ($time_constant + $delta_t);
|
||||
$newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp);
|
||||
$this->SetValue("Boilertemperatur", $newBoilerTemp);
|
||||
} else {
|
||||
$boilerPT1 = 0.0; // Standardwert
|
||||
// Wenn Glättung nicht aktiviert ist, setze die Boilertemperatur direkt auf den Wert des Boilerfühlers
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
} else {
|
||||
$boilerPT1 = 0.0; // Standardwert
|
||||
}
|
||||
|
||||
// Setze Boilertemperatur direkt auf den Wert des Boilerfühlers
|
||||
$this->SetValue("Boilertemperatur", $boilerPT1);
|
||||
}
|
||||
|
||||
$boilerTempID = $this->GetIDForIdent("Boilertemperatur");
|
||||
if (IPS_VariableExists($boilerTempID)) {
|
||||
$boilerTemp = $this->GetValue("Boilertemperatur");
|
||||
} else {
|
||||
$boilerTemp = 0.0; // Standardwert
|
||||
}
|
||||
|
||||
// PT
|
||||
$time_constant = 120; // Zeitkonstante in Sekunden (1 Minute)
|
||||
$delta_t = 30; // Zeitdifferenz zwischen den Messungen (30 Sekunden)
|
||||
$alpha = $delta_t / ($time_constant + $delta_t);
|
||||
$newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp);
|
||||
$this->SetValue("Boilertemperatur", $newBoilerTemp);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user