diff --git a/Pufferspeicher/form.json b/Pufferspeicher/form.json index efe2bcb..b310cd1 100644 --- a/Pufferspeicher/form.json +++ b/Pufferspeicher/form.json @@ -1,106 +1,6 @@ { "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/Pufferspeicher/module.php b/Pufferspeicher/module.php index 0b820d6..4466af4 100644 --- a/Pufferspeicher/module.php +++ b/Pufferspeicher/module.php @@ -2,66 +2,19 @@ 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); - $this->RegisterPropertyInteger("IdleCounterMax", 2); + } - // 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", "", 0); - - $this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio"); - $this->RegisterVariableInteger("PV_Prio", "PV_Prio"); - $this->RegisterVariableBoolean("Idle", "Idle", "", 1); - $this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0); - $this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0); - $this->RegisterVariableString("PowerSteps", "PowerSteps"); - $this->RegisterVariableInteger("Power", "Power", "", 0); - $this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving", "", 2); - $this->RegisterVariableInteger("Leistung_Delta", "Leistung_Delta", "", 0); - $this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0); - - // Timer - $this->RegisterTimer( - "Timer_Do_UserCalc_Boiler", - 0, - 'IPS_RequestAction($_IPS["TARGET"], "Do_UserCalc", "");' - ); -} - -public function ApplyChanges() -{ - parent::ApplyChanges(); - - // Defaultwerte erst hier setzen! - $this->SetValue("IdleCounter", 0); - $this->SetValue("Idle", true); - - // Timer-Intervall aus Property übernehmen - $this->SetTimerInterval( - "Timer_Do_UserCalc_Boiler", - $this->ReadPropertyInteger("Interval") * 1000 - ); -} + public function ApplyChanges() + { + parent::ApplyChanges(); + $this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000); + } public function RequestAction($Ident, $Value) { @@ -99,7 +52,7 @@ public function ApplyChanges() SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), false); } - // Prüfe auf Änderung der Power im Vergleich zur letzten Einstellung + // Prüfe auf Änderung der Power im Vergleich zur letzten Einstellung $lastPower = GetValue($this->GetIDForIdent("Aktuelle_Leistung")); if ($power != $lastPower) { $this->SetValue("Idle", false);