Auf stand Von testign gebracht
This commit is contained in:
@@ -6,37 +6,33 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
{
|
||||
parent::Create();
|
||||
|
||||
// Prioritäten
|
||||
$this->RegisterVariableInteger("LockPrio", "LockPrio");
|
||||
$this->RegisterVariableInteger("UserPrio", "UserPrio");
|
||||
|
||||
// Energiehandling
|
||||
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
|
||||
$this->RegisterVariableInteger("CurrentPower", "CurrentPower", "", 0);
|
||||
$this->RegisterVariableFloat("UsedEnergy", "UsedEnergy", "", 0);
|
||||
$this->RegisterVariableString("PowerSteps", "PowerSteps"); // PowerSteps-Variable registrieren
|
||||
|
||||
// Trägheit system
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
||||
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
||||
$this->SetValue("IdleCounter", 0);
|
||||
|
||||
// Boiler spezifische Properties
|
||||
$this->RegisterPropertyInteger("BoilerLeistungTeillast", 3000);
|
||||
$this->RegisterPropertyInteger("BoilerLeistungVolllast", 6000);
|
||||
$this->RegisterPropertyInteger("Boilertemperatur", 0);
|
||||
|
||||
// Boiler spezifische Variablen
|
||||
$this->RegisterVariableInteger("Boilermintemp","Boilermintemp","",45);
|
||||
$this->RegisterVariableInteger("Boilermaxtemp","Boilermaxtemp","",60);
|
||||
$this->RegisterVariableInteger("Boilerlegiotemp","Boilerlegiotemp","",65);
|
||||
$this->RegisterVariableInteger("LegioCounter", "LegioCounter", "", 0);
|
||||
|
||||
// Schaltkontakte
|
||||
$this->RegisterPropertyInteger("Kontakt_Teillast", 0);
|
||||
$this->RegisterPropertyInteger("Kontakt_Volllast", 0);
|
||||
|
||||
// Initialisieren
|
||||
// Boiler spezifische Variablen
|
||||
$this->RegisterVariableInteger("Mindesttemperatur","Mindesttemperatur","",45);
|
||||
$this->RegisterVariableInteger("Maximaltemperatur","Maximaltemperatur","",60);
|
||||
$this->RegisterVariableInteger("Legionellentemperatur","Legionellentemperatur","",65);
|
||||
$this->RegisterVariableInteger("LegioCounter", "LegioCounter", "", 0);
|
||||
|
||||
// Variabeln für Kommunkation mit Manager
|
||||
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
|
||||
$this->RegisterVariableInteger("PV_Prio", "PV_Prio");
|
||||
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
|
||||
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
|
||||
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
|
||||
$this->RegisterVariableString("PowerSteps", "PowerSteps");
|
||||
|
||||
// Hilfsvariabeln für Idle zustand
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
||||
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
||||
$this->SetValue("IdleCounter", 0);
|
||||
|
||||
// Initialisiere Idle
|
||||
$this->SetValue("Idle", true);
|
||||
}
|
||||
|
||||
@@ -49,8 +45,8 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
public function RequestAction($Ident, $Value)
|
||||
{
|
||||
switch ($Ident) {
|
||||
case "SetCurrentPower":
|
||||
$this->SetCurrentPower($Value);
|
||||
case "SetAktuelle_Leistung":
|
||||
$this->SetAktuelle_Leistung($Value);
|
||||
break;
|
||||
case "GetCurrentData":
|
||||
return $this->GetCurrentData($Value);
|
||||
@@ -60,7 +56,7 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
}
|
||||
|
||||
// Methode zum Setzen des aktuellen Stromverbrauchs
|
||||
public function SetCurrentPower(int $power)
|
||||
public function SetAktuelle_Leistung(int $power)
|
||||
{
|
||||
// Schalte Kontakt Teillast und Vollast entsprechend der Power-Einstellung
|
||||
if ($power == $this->ReadPropertyInteger("BoilerLeistungVolllast")) {
|
||||
@@ -77,7 +73,7 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
}
|
||||
|
||||
// Prüfe auf Änderung der Power im Vergleich zur letzten Einstellung
|
||||
$lastPower = GetValue($this->GetIDForIdent("CurrentPower"));
|
||||
$lastPower = GetValue($this->GetIDForIdent("Aktuelle_Leistung"));
|
||||
if ($power != $lastPower) {
|
||||
$this->SetValue("Idle", false);
|
||||
$this->SetValue(
|
||||
@@ -86,8 +82,8 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
);
|
||||
}
|
||||
|
||||
// Setze die neue CurrentPower
|
||||
$this->SetValue("CurrentPower", $power);
|
||||
// Setze die neue Aktuelle_Leistung
|
||||
$this->SetValue("Aktuelle_Leistung", $power);
|
||||
|
||||
// IdleCounter verarbeiten
|
||||
$this->ProcessIdleCounter();
|
||||
@@ -99,9 +95,9 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
$LegioCounter = $this->GetValue("LegioCounter");
|
||||
|
||||
$boilerTemp = GetValue($this->ReadPropertyInteger("Boilertemperatur"));
|
||||
$minTemp = $this->GetValue("Boilermintemp");
|
||||
$maxTemp = $this->GetValue("Boilermaxtemp");
|
||||
$LegioTemp = $this->GetValue("Boilerlegiotemp");
|
||||
$minTemp = $this->GetValue("Mindesttemperatur");
|
||||
$maxTemp = $this->GetValue("Maximaltemperatur");
|
||||
$LegioTemp = $this->GetValue("Legionellentemperatur");
|
||||
$teilLeistung = $this->ReadPropertyInteger("BoilerLeistungTeillast");
|
||||
$vollLeistung = $this->ReadPropertyInteger("BoilerLeistungVolllast");
|
||||
|
||||
@@ -184,8 +180,8 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
|
||||
private function CheckIdle($power)
|
||||
{
|
||||
$lastpower = GetValue("CurrentPower");
|
||||
if ($lastpower != GetValue("CurrentPower")) {
|
||||
$lastpower = GetValue("Aktuelle_Leistung");
|
||||
if ($lastpower != GetValue("Aktuelle_Leistung")) {
|
||||
$this->SetValue("Idle", false);
|
||||
$this->SetValue(
|
||||
"IdleCounter",
|
||||
|
||||
Reference in New Issue
Block a user