diff --git a/Puffer/form.json b/Puffer/form.json deleted file mode 100644 index b2db0fe..0000000 --- a/Puffer/form.json +++ /dev/null @@ -1,21 +0,0 @@ - -{ - "elements": [ - { - "type": "Label", - "caption": "Konfiguration der nötigen Schaltkontakte und Nennleistungen" - }, - { - "type": "NumberSpinner", - "name": "Interval", - "caption": "Intervall Neuberechnung der Werte Erst für spätere Versionen, aktuell auf 5 lassen!", - "suffix": "Sekunden" - }, - { - "type": "NumberSpinner", - "name": "IdleCounterMax", - "caption": "Zyklen zwischen zwei Leistungsänderungen (Multipliziert sich mit Interval)", - "suffix": "" - } - ] -} diff --git a/Puffer/README.md b/Puffer_2/README.md similarity index 100% rename from Puffer/README.md rename to Puffer_2/README.md diff --git a/Puffer_2/form.json b/Puffer_2/form.json new file mode 100644 index 0000000..efe2bcb --- /dev/null +++ b/Puffer_2/form.json @@ -0,0 +1,106 @@ + +{ + "elements": [ + { + "type": "Label", + "caption": "Konfiguration der nötigen Schaltkontakte und Nennleistungen" + }, + { + "type":"Select", + "name":"Puffertemperatur_glätten", + "caption":"Puffertemperatur glätten", + "options":[ + { + "caption":"Ja", + "value":true + }, + { + "caption":"Nein", + "value":false + } + ] + }, + { + "type": "NumberSpinner", + "name": "ZeitKonstante", + "caption": "Zeit Konstante", + "suffix": "" + }, + { + "type": "NumberSpinner", + "name": "Interval", + "caption": "Intervall Neuberechnung der Werte Erst für spätere Versionen, aktuell auf 5 lassen!", + "suffix": "Sekunden" + }, + { + "type": "NumberSpinner", + "name": "IdleCounterMax", + "caption": "Zyklen zwischen zwei Leistungsänderungen (Multipliziert sich mit Interval)", + "suffix": "" + }, + { + "type": "NumberSpinner", + "name": "PufferLeistung", + "caption": "Puffer Volllast", + "suffix": "Watt" + }, + { + "type": "NumberSpinner", + "name": "PufferTeilLeistung", + "caption": "Puffer Teillast", + "suffix": "Watt" + }, + { + "type": "Label", + "caption": "Endpunkte der Pufferfunktion bestimmen: VT = f(AT)" + }, + { + "type": "NumberSpinner", + "name": "MaxVT_Temp", + "caption": "Max Temperatur VT", + "suffix": "°C" + }, + { + "type": "NumberSpinner", + "name": "MinVT_Temp", + "caption": "Min Temperatur VT", + "suffix": "°C" + }, + { + "type": "NumberSpinner", + "name": "MaxAT_Temp", + "caption": "Max Temperatur AT", + "suffix": "°C" + }, + { + "type": "NumberSpinner", + "name": "MinAT_Temp", + "caption": "Min Temperatur AT", + "suffix": "°C" + }, + { + "type": "SelectVariable", + "name": "Pufferfuehler_PT1", + "caption": "Variable für Pufferfühler PT1", + "test": true + }, + { + "type": "SelectVariable", + "name": "Heizkontakt1_Puffer", + "caption": "Heizkontakt Puffer 1.Stufe", + "test": true + }, + { + "type": "SelectVariable", + "name": "Heizkontakt2_Puffer", + "caption": "Heizkontakt Puffer 2.Stufe", + "test": true + }, + { + "type": "SelectVariable", + "name": "Aussentemp", + "caption": "Aussentemperatur", + "suffix": "°C" + } + ] +} diff --git a/Puffer/module.json b/Puffer_2/module.json similarity index 70% rename from Puffer/module.json rename to Puffer_2/module.json index 80e73b7..9b9a809 100644 --- a/Puffer/module.json +++ b/Puffer_2/module.json @@ -1,6 +1,6 @@ { - "id": "{225BCE4B-2498-C994-6F15-E36D0C8BD8EA}", - "name": "Puffer", + "id": "{188C1729-C340-58D6-A617-62284739D3FA}", + "name": "Puffer_2", "type": 3, "vendor": "Belevo AG", "aliases": [], diff --git a/Puffer/module.php b/Puffer_2/module.php similarity index 74% rename from Puffer/module.php rename to Puffer_2/module.php index 00f2617..94a9588 100644 --- a/Puffer/module.php +++ b/Puffer_2/module.php @@ -1,6 +1,6 @@ RegisterPropertyInteger("PufferLeistung", 6000); - - + $this->RegisterPropertyInteger("PufferTeilLeistung", 3000); + $this->RegisterPropertyInteger("ZeitKonstante", 120); + $this->RegisterPropertyInteger("Pufferfuehler_PT1", 0); + $this->RegisterPropertyInteger("Heizkontakt2_Puffer", 0); + $this->RegisterPropertyInteger("Heizkontakt1_Puffer", 0); + $this->RegisterPropertyInteger("Aussentemp", 20); + $this->RegisterPropertyInteger("MinVT_Temp", 20); + $this->RegisterPropertyInteger("MaxVT_Temp", 80); + $this->RegisterPropertyInteger("MaxAT_Temp", 20); + $this->RegisterPropertyInteger("MinAT_Temp", 0); + $this->RegisterPropertyBoolean("Puffertemperatur_glätten", false); + $this->RegisterPropertyInteger("Interval", 5); // Recheninterval + + // Puffer spezifische Variablen + $this->RegisterVariableInteger("Steigung","Steigung","",0); + $this->RegisterVariableInteger("Maximaltemperatur"," Berechnete Maximaltemperatur VT","",60); + $this->RegisterVariableInteger("Puffertemperatur", "Puffertemperatur", "", 40); + $this->RegisterVariableInteger("Aussentemperatur", "Aussentemperatur", "", 15); + $this->RegisterVariableBoolean("Hysterese", "Hysterese","",false); // Variabeln für Kommunkation mit Manager $this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio"); @@ -33,9 +50,9 @@ class Puffer extends IPSModule public function ApplyChanges() { parent::ApplyChanges(); - + $this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000); } - + public function RequestAction($Ident, $Value) { switch ($Ident) { @@ -58,7 +75,29 @@ class Puffer 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("PufferLeistung")) { + SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), true); + SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), false); + } elseif ( + $power == $this->ReadPropertyInteger("PufferTeilLeistung") + ) { + SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), false); + SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), true); + } else { + SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), false); + SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), false); + } + + // Prüfe auf Änderung der Power im Vergleich zur letzten Einstellung + $lastPower = GetValue($this->GetIDForIdent("Aktuelle_Leistung")); + if ($power != $lastPower) { + $this->SetValue("Idle", false); + $this->SetValue( + "IdleCounter", + $this->ReadPropertyInteger("IdleCounterMax") + ); + } // Setze die neue Aktuelle_Leistung $this->SetValue("Aktuelle_Leistung", $power); $this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600)))); diff --git a/Pufferspeicher/form.json b/Pufferspeicher/form.json index 979eedf..efe2bcb 100644 --- a/Pufferspeicher/form.json +++ b/Pufferspeicher/form.json @@ -86,7 +86,7 @@ }, { "type": "SelectVariable", - "name": "Heizkontakt1_Puffer", + "name": "Heizkontakt1_Puffer", "caption": "Heizkontakt Puffer 1.Stufe", "test": true }, diff --git a/Pufferspeicher/module.php b/Pufferspeicher/module.php index 89851d8..f6fbd62 100644 --- a/Pufferspeicher/module.php +++ b/Pufferspeicher/module.php @@ -52,7 +52,7 @@ class Pufferspeicher extends IPSModule parent::ApplyChanges(); $this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000); } - + public function RequestAction($Ident, $Value) { switch ($Ident) {