no message
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
},
|
||||
{
|
||||
"type":"Select",
|
||||
"name":"Boilertemperatur_glätten",
|
||||
"caption":"Boilertemperatur glätten",
|
||||
"name":"Puffertemperatur_glätten",
|
||||
"caption":"Puffertemperatur glätten",
|
||||
"options":[
|
||||
{
|
||||
"caption":"Ja",
|
||||
@@ -40,7 +40,13 @@
|
||||
{
|
||||
"type": "NumberSpinner",
|
||||
"name": "PufferLeistung",
|
||||
"caption": "Puffer Leistung",
|
||||
"caption": "Puffer Volllast",
|
||||
"suffix": "Watt"
|
||||
},
|
||||
{
|
||||
"type": "NumberSpinner",
|
||||
"name": "PufferTeilLeistung",
|
||||
"caption": "Puffer Teillast",
|
||||
"suffix": "Watt"
|
||||
},
|
||||
{
|
||||
@@ -73,8 +79,8 @@
|
||||
},
|
||||
{
|
||||
"type": "SelectVariable",
|
||||
"name": "Boilerfuehler_PT1",
|
||||
"caption": "Variable für Boilerfühler PT1",
|
||||
"name": "Pufferfuehler_PT1",
|
||||
"caption": "Variable für Pufferfühler PT1",
|
||||
"test": true
|
||||
},
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Puffer extends IPSModule
|
||||
class Pufferspeicher extends IPSModule
|
||||
{
|
||||
public function Create()
|
||||
{
|
||||
@@ -9,22 +9,24 @@ class Puffer extends IPSModule
|
||||
// Boiler spezifische Properties
|
||||
|
||||
$this->RegisterPropertyInteger("PufferLeistung", 6000);
|
||||
$this->RegisterPropertyInteger("PufferTeilLeistung", 3000);
|
||||
$this->RegisterPropertyInteger("ZeitKonstante", 120);
|
||||
$this->RegisterPropertyInteger("Boilerfuehler_PT1", 0);
|
||||
$this->RegisterPropertyInteger("Pufferfuehler_PT1", 0);
|
||||
$this->RegisterPropertyInteger("Heizkontakt_Puffer", 0);
|
||||
$this->RegisterPropertyInteger("Heizkontakt_Puffer_Teillast", 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("Boilertemperatur_glätten", false);
|
||||
$this->RegisterPropertyBoolean("Puffertemperatur_glätten", false);
|
||||
$this->RegisterPropertyString("Zeitplan", "");
|
||||
$this->RegisterPropertyInteger("Interval", 5); // Recheninterval
|
||||
|
||||
// Puffer spezifische Variablen
|
||||
$this->RegisterVariableInteger("Steigung","Steigung","",0);
|
||||
$this->RegisterVariableInteger("Maximaltemperatur"," Berechnete Maximaltemperatur VT","",60);
|
||||
$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 40);
|
||||
$this->RegisterVariableInteger("Puffertemperatur", "Puffertemperatur", "", 40);
|
||||
$this->RegisterVariableInteger("Aussentemperatur", "Aussentemperatur", "", 15);
|
||||
$this->RegisterVariableBoolean("Hysterese", "Hysterese","",false);
|
||||
|
||||
@@ -81,25 +83,24 @@ class Puffer extends IPSModule
|
||||
}
|
||||
}
|
||||
|
||||
// Methode zum Setzen des aktuellen Stromverbrauchs
|
||||
// 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("Heizkontakt_Puffer"), true);
|
||||
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer_Teillast"), false);
|
||||
} elseif (
|
||||
$power == $this->ReadPropertyInteger("PufferTeilLeistung")
|
||||
) {
|
||||
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer"), false);
|
||||
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer_Teillast"), true);
|
||||
} else {
|
||||
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer"), false);
|
||||
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer_Teillast"), 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);
|
||||
@@ -113,11 +114,11 @@ class Puffer extends IPSModule
|
||||
{
|
||||
|
||||
|
||||
$boilertemperatur_glätten = $this->ReadPropertyBoolean("Boilertemperatur_glätten");
|
||||
$boilertemperatur_glätten = $this->ReadPropertyBoolean("Puffertemperatur_glätten");
|
||||
|
||||
if ($boilertemperatur_glätten) {
|
||||
// Wenn Glättung aktiviert ist, führe das Glätten durch
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
|
||||
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Pufferfuehler_PT1");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
@@ -137,10 +138,10 @@ class Puffer extends IPSModule
|
||||
$delta_t = 5; // Zeitdifferenz zwischen den Messungen (30 Sekunden)
|
||||
$alpha = $delta_t / ($time_constant + $delta_t);
|
||||
$newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp);
|
||||
$this->SetValue("Boilertemperatur", $newBoilerTemp);
|
||||
$this->SetValue("Puffertemperatur", $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("Pufferfuehler_PT1");
|
||||
|
||||
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
|
||||
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
|
||||
@@ -148,7 +149,7 @@ class Puffer extends IPSModule
|
||||
$boilerPT1 = 0.0; // Standardwert
|
||||
}
|
||||
// Setze Boilertemperatur direkt auf den Wert des Boilerfühlers
|
||||
$this->SetValue("Boilertemperatur", $boilerPT1);
|
||||
$this->SetValue("Puffertemperatur", $boilerPT1);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,10 +174,10 @@ class Puffer extends IPSModule
|
||||
}
|
||||
$this->SetValue("Maximaltemperatur", $VT );
|
||||
|
||||
$boilerTemp = $this->GetValue("Boilertemperatur");
|
||||
$boilerTemp = $this->GetValue("Puffertemperatur");
|
||||
$pufferLeistung = $this->ReadPropertyInteger("PufferLeistung");
|
||||
|
||||
$hyst = $this->GetValue("Hysterese");
|
||||
$pufferTeilLeistung = $this->ReadPropertyInteger("PufferTeilLeistung");
|
||||
$hyst = $this->GetValue("Hysterese");
|
||||
|
||||
|
||||
if($VT < $boilerTemp){
|
||||
@@ -190,7 +191,7 @@ class Puffer extends IPSModule
|
||||
$this->SetValue( "PowerSteps", json_encode([0]) );
|
||||
} else {
|
||||
if ($boilerTemp < $VT && $hyst== true) {
|
||||
$this->SetValue("PowerSteps", json_encode([$pufferLeistung]));
|
||||
$this->SetValue("PowerSteps", json_encode([0,$pufferTeilLeistung ,$pufferLeistung]));
|
||||
} elseif ($boilerTemp > $VT - 5 && $hyst== false) {
|
||||
$this->SetValue("PowerSteps", json_encode([0]));
|
||||
} else {
|
||||
Reference in New Issue
Block a user