anpassungen an der pending_zeit, und fertig ausbau des askoheat moduls
This commit is contained in:
@@ -8,9 +8,15 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
parent::Create();
|
||||
|
||||
// Verbraucherspezifische Properties
|
||||
$this->RegisterPropertyInteger("BoilerLeistung", 4000); // Standardwert für Volllast
|
||||
$this->RegisterPropertyString("IP_Adresse", ""); // Standardwert für Volllast
|
||||
$this->RegisterPropertyInteger("ZeitKonstante", 120);
|
||||
$this->RegisterPropertyBoolean("Boilertemperatur_glätten", false);
|
||||
$this->RegisterPropertyInteger("Boilervolumen", 300);
|
||||
$this->RegisterPropertyString("Zeitplan", "");
|
||||
$this->RegisterPropertyInteger("BoilerLeistung", 3500); // Standardwert für Volllast
|
||||
$this->RegisterPropertyInteger("Interval", 5); // Recheninterval
|
||||
$this->RegisterPropertyInteger("Variable_Leistung", 0); // Recheninterval
|
||||
$this->RegisterPropertyInteger("Variable_Temperatur", 0); // Recheninterval
|
||||
$this->RegisterPropertyInteger("Variable_Temperatur_Ist", 0); // Recheninterval
|
||||
|
||||
// Variabeln für Kommunkation mit Manager
|
||||
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
|
||||
@@ -24,6 +30,13 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
$this->RegisterVariableInteger("Leistung_Delta", "Leistung_Delta", "", 0);
|
||||
$this->RegisterVariableFloat("Boilertemperatur", "Boilertemperatur", "", 0);
|
||||
|
||||
// Boiler spezifische Variablen
|
||||
$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);
|
||||
|
||||
// Hilfsvariabeln für Idle zustand
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
||||
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
||||
@@ -55,10 +68,6 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
$this->SetValue("Is_Peak_Shaving", (bool)$Value);
|
||||
break;
|
||||
|
||||
case "ResetPowerSteps":
|
||||
$this->ResetPowerSteps($Value);
|
||||
break;
|
||||
|
||||
case "Do_UserCalc":
|
||||
$this->SetAktuelle_Leistung($this->GetValue("Power"));
|
||||
$this->GetCurrentData($this->GetValue("Is_Peak_Shaving"));
|
||||
@@ -123,20 +132,8 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
// Methode zum Setzen des aktuellen Stromverbrauchs
|
||||
public function SetAktuelle_Leistung(int $power)
|
||||
{
|
||||
// Schalte Kontakt Teillast und Vollast entsprechend der Power-Einstellung
|
||||
if ($power == $this->ReadPropertyInteger("BoilerLeistungVolllast")) {
|
||||
SetValue($this->ReadPropertyInteger("Kontakt_Volllast"), true);
|
||||
SetValue($this->ReadPropertyInteger("Kontakt_Teillast"), false);
|
||||
} elseif (
|
||||
$power == $this->ReadPropertyInteger("BoilerLeistungTeillast")
|
||||
) {
|
||||
SetValue($this->ReadPropertyInteger("Kontakt_Volllast"), false);
|
||||
SetValue($this->ReadPropertyInteger("Kontakt_Teillast"), true);
|
||||
} else {
|
||||
SetValue($this->ReadPropertyInteger("Kontakt_Volllast"), false);
|
||||
SetValue($this->ReadPropertyInteger("Kontakt_Teillast"), false);
|
||||
}
|
||||
|
||||
IPS_RequestAction($this->ReadPropertyInteger("Variable_Leistung"), $power);
|
||||
|
||||
// Prüfe auf Änderung der Power im Vergleich zur letzten Einstellung
|
||||
$lastPower = GetValue($this->GetIDForIdent("Aktuelle_Leistung"));
|
||||
if ($power != $lastPower) {
|
||||
@@ -154,6 +151,20 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
$this->ProcessIdleCounter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function Calc_Seven_Steps(int $power)
|
||||
{
|
||||
$steps = [];
|
||||
$increment = $power / 7;
|
||||
|
||||
for ($i = 0; $i <= 7; $i++) {
|
||||
$steps[] = $i * $increment;
|
||||
}
|
||||
|
||||
return $steps;
|
||||
}
|
||||
|
||||
// Methode zum Abrufen der aktuellen Daten
|
||||
public function GetCurrentData(bool $Peak)
|
||||
{
|
||||
@@ -164,7 +175,7 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
|
||||
if ($boilertemperatur_glätten) {
|
||||
// Wenn Glättung aktiviert ist, führe das Glätten durch
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Variable_Temperatur_Ist");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
@@ -187,7 +198,7 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
$this->SetValue("Boilertemperatur", $newBoilerTemp);
|
||||
} else {
|
||||
// Wenn Glättung nicht aktiviert ist, setze die Boilertemperatur direkt auf den Wert des Boilerfühlers
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Variable_Temperatur_Ist");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
@@ -204,8 +215,7 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
$minTemp = $this->GetValue("Mindesttemperatur");
|
||||
$maxTemp = $this->GetValue("Maximaltemperatur");
|
||||
$LegioTemp = $this->GetValue("Legionellentemperatur");
|
||||
$teilLeistung = $this->ReadPropertyInteger("BoilerLeistungTeillast");
|
||||
$vollLeistung = $this->ReadPropertyInteger("BoilerLeistungVolllast");
|
||||
$vollLeistung = $this->ReadPropertyInteger("BoilerLeistung");
|
||||
|
||||
|
||||
$nextEntry = $this->getNextTimeAndTemperature($this->ReadPropertyString("Zeitplan"));
|
||||
@@ -220,8 +230,9 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
|
||||
|
||||
|
||||
$AktuelleVollast = GetValue(
|
||||
$this->ReadPropertyInteger("Kontakt_Volllast")
|
||||
$boilerIsOn = (GetValue($this->ReadPropertyInteger("Variable_Leistung"))>0);
|
||||
$AktuelleVollast = GetValue(
|
||||
$this->ReadPropertyInteger("Variable_Leistung")
|
||||
);
|
||||
$AktuelleTeillast = GetValue(
|
||||
$this->ReadPropertyInteger("Kontakt_Teillast")
|
||||
@@ -246,14 +257,14 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
|
||||
if ($Peak) {
|
||||
if ($boilerTemp < $minTemp) {
|
||||
$this->SetValue( "PowerSteps", json_encode([0, $teilLeistung, $vollLeistung]) );
|
||||
$this->SetValue( "PowerSteps", json_encode($this->Calc_Seven_Steps($vollLeistung)) );
|
||||
} elseif (
|
||||
$boilerTemp < $minTemp + 5 &&
|
||||
($AktuelleVollast || $AktuelleTeillast)
|
||||
($boilerIsOn)
|
||||
) {
|
||||
$this->SetValue(
|
||||
"PowerSteps",
|
||||
json_encode([0, $teilLeistung, $vollLeistung])
|
||||
json_encode($this->Calc_Seven_Steps($vollLeistung))
|
||||
);
|
||||
} else {
|
||||
$this->SetValue("PowerSteps", json_encode([0]));
|
||||
@@ -263,14 +274,14 @@ class Ansteuerung_Askoheat extends IPSModule
|
||||
$this->SetValue("PowerSteps", json_encode([$vollLeistung]));
|
||||
} elseif (
|
||||
$boilerTemp < $minTemp + 5 &&
|
||||
($AktuelleVollast || $AktuelleTeillast)
|
||||
($boilerIsOn)
|
||||
) {
|
||||
$this->SetValue("PowerSteps", json_encode([$vollLeistung]));
|
||||
} elseif ($boilerTemp < $maxTemp - 5) {
|
||||
$this->SetValue("PowerSteps", json_encode([0, $teilLeistung, $vollLeistung]));
|
||||
} elseif ( $boilerTemp < $maxTemp && ($AktuelleVollast || $AktuelleTeillast)
|
||||
$this->SetValue("PowerSteps", json_encode($this->Calc_Seven_Steps($vollLeistung)));
|
||||
} elseif ( $boilerTemp < $maxTemp && ($boilerIsOn)
|
||||
) {
|
||||
$this->SetValue( "PowerSteps", json_encode([0, $teilLeistung, $vollLeistung]));
|
||||
$this->SetValue( "PowerSteps", json_encode($this->Calc_Seven_Steps($vollLeistung)));
|
||||
} else {
|
||||
$this->SetValue("PowerSteps", json_encode([0]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user