no message

This commit is contained in:
mh
2025-09-26 08:38:40 +02:00
parent b2cd04ad42
commit d47960120d
4 changed files with 36 additions and 29 deletions
+11 -5
View File
@@ -6,8 +6,8 @@
}, },
{ {
"type":"Select", "type":"Select",
"name":"Boilertemperatur_glätten", "name":"Puffertemperatur_glätten",
"caption":"Boilertemperatur glätten", "caption":"Puffertemperatur glätten",
"options":[ "options":[
{ {
"caption":"Ja", "caption":"Ja",
@@ -40,7 +40,13 @@
{ {
"type": "NumberSpinner", "type": "NumberSpinner",
"name": "PufferLeistung", "name": "PufferLeistung",
"caption": "Puffer Leistung", "caption": "Puffer Volllast",
"suffix": "Watt"
},
{
"type": "NumberSpinner",
"name": "PufferTeilLeistung",
"caption": "Puffer Teillast",
"suffix": "Watt" "suffix": "Watt"
}, },
{ {
@@ -73,8 +79,8 @@
}, },
{ {
"type": "SelectVariable", "type": "SelectVariable",
"name": "Boilerfuehler_PT1", "name": "Pufferfuehler_PT1",
"caption": "Variable für Boilerfühler PT1", "caption": "Variable für Pufferfühler PT1",
"test": true "test": true
}, },
{ {
+23 -22
View File
@@ -1,6 +1,6 @@
<?php <?php
class Puffer extends IPSModule class Pufferspeicher extends IPSModule
{ {
public function Create() public function Create()
{ {
@@ -9,22 +9,24 @@ class Puffer extends IPSModule
// Boiler spezifische Properties // Boiler spezifische Properties
$this->RegisterPropertyInteger("PufferLeistung", 6000); $this->RegisterPropertyInteger("PufferLeistung", 6000);
$this->RegisterPropertyInteger("PufferTeilLeistung", 3000);
$this->RegisterPropertyInteger("ZeitKonstante", 120); $this->RegisterPropertyInteger("ZeitKonstante", 120);
$this->RegisterPropertyInteger("Boilerfuehler_PT1", 0); $this->RegisterPropertyInteger("Pufferfuehler_PT1", 0);
$this->RegisterPropertyInteger("Heizkontakt_Puffer", 0); $this->RegisterPropertyInteger("Heizkontakt_Puffer", 0);
$this->RegisterPropertyInteger("Heizkontakt_Puffer_Teillast", 0);
$this->RegisterPropertyInteger("Aussentemp", 20); $this->RegisterPropertyInteger("Aussentemp", 20);
$this->RegisterPropertyInteger("MinVT_Temp", 20); $this->RegisterPropertyInteger("MinVT_Temp", 20);
$this->RegisterPropertyInteger("MaxVT_Temp", 80); $this->RegisterPropertyInteger("MaxVT_Temp", 80);
$this->RegisterPropertyInteger("MaxAT_Temp", 20); $this->RegisterPropertyInteger("MaxAT_Temp", 20);
$this->RegisterPropertyInteger("MinAT_Temp", 0); $this->RegisterPropertyInteger("MinAT_Temp", 0);
$this->RegisterPropertyBoolean("Boilertemperatur_glätten", false); $this->RegisterPropertyBoolean("Puffertemperatur_glätten", false);
$this->RegisterPropertyString("Zeitplan", ""); $this->RegisterPropertyString("Zeitplan", "");
$this->RegisterPropertyInteger("Interval", 5); // Recheninterval $this->RegisterPropertyInteger("Interval", 5); // Recheninterval
// Puffer spezifische Variablen // Puffer spezifische Variablen
$this->RegisterVariableInteger("Steigung","Steigung","",0); $this->RegisterVariableInteger("Steigung","Steigung","",0);
$this->RegisterVariableInteger("Maximaltemperatur"," Berechnete Maximaltemperatur VT","",60); $this->RegisterVariableInteger("Maximaltemperatur"," Berechnete Maximaltemperatur VT","",60);
$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 40); $this->RegisterVariableInteger("Puffertemperatur", "Puffertemperatur", "", 40);
$this->RegisterVariableInteger("Aussentemperatur", "Aussentemperatur", "", 15); $this->RegisterVariableInteger("Aussentemperatur", "Aussentemperatur", "", 15);
$this->RegisterVariableBoolean("Hysterese", "Hysterese","",false); $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) public function SetAktuelle_Leistung(int $power)
{ {
// Schalte Kontakt Teillast und Vollast entsprechend der Power-Einstellung // Schalte Kontakt Teillast und Vollast entsprechend der Power-Einstellung
if ($power == $this->ReadPropertyInteger("PufferLeistung")) { if ($power == $this->ReadPropertyInteger("PufferLeistung")) {
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer"), true); 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 { } else {
SetValue($this->ReadPropertyInteger("Heizkontakt_Puffer"), false); 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 // Setze die neue Aktuelle_Leistung
$this->SetValue("Aktuelle_Leistung", $power); $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) { if ($boilertemperatur_glätten) {
// Wenn Glättung aktiviert ist, führe das Glätten durch // 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)) { if (IPS_VariableExists($boilerFuehlerPT1ID)) {
$boilerPT1 = GetValue($boilerFuehlerPT1ID); $boilerPT1 = GetValue($boilerFuehlerPT1ID);
@@ -137,10 +138,10 @@ class Puffer extends IPSModule
$delta_t = 5; // Zeitdifferenz zwischen den Messungen (30 Sekunden) $delta_t = 5; // Zeitdifferenz zwischen den Messungen (30 Sekunden)
$alpha = $delta_t / ($time_constant + $delta_t); $alpha = $delta_t / ($time_constant + $delta_t);
$newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp); $newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp);
$this->SetValue("Boilertemperatur", $newBoilerTemp); $this->SetValue("Puffertemperatur", $newBoilerTemp);
} else { } else {
// Wenn Glättung nicht aktiviert ist, setze die Boilertemperatur direkt auf den Wert des Boilerfühlers // 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)) { if (IPS_VariableExists($boilerFuehlerPT1ID)) {
$boilerPT1 = GetValue($boilerFuehlerPT1ID); $boilerPT1 = GetValue($boilerFuehlerPT1ID);
@@ -148,7 +149,7 @@ class Puffer extends IPSModule
$boilerPT1 = 0.0; // Standardwert $boilerPT1 = 0.0; // Standardwert
} }
// Setze Boilertemperatur direkt auf den Wert des Boilerfühlers // Setze Boilertemperatur direkt auf den Wert des Boilerfühlers
$this->SetValue("Boilertemperatur", $boilerPT1); $this->SetValue("Puffertemperatur", $boilerPT1);
} }
@@ -173,9 +174,9 @@ class Puffer extends IPSModule
} }
$this->SetValue("Maximaltemperatur", $VT ); $this->SetValue("Maximaltemperatur", $VT );
$boilerTemp = $this->GetValue("Boilertemperatur"); $boilerTemp = $this->GetValue("Puffertemperatur");
$pufferLeistung = $this->ReadPropertyInteger("PufferLeistung"); $pufferLeistung = $this->ReadPropertyInteger("PufferLeistung");
$pufferTeilLeistung = $this->ReadPropertyInteger("PufferTeilLeistung");
$hyst = $this->GetValue("Hysterese"); $hyst = $this->GetValue("Hysterese");
@@ -190,7 +191,7 @@ class Puffer extends IPSModule
$this->SetValue( "PowerSteps", json_encode([0]) ); $this->SetValue( "PowerSteps", json_encode([0]) );
} else { } else {
if ($boilerTemp < $VT && $hyst== true) { 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) { } elseif ($boilerTemp > $VT - 5 && $hyst== false) {
$this->SetValue("PowerSteps", json_encode([0])); $this->SetValue("PowerSteps", json_encode([0]));
} else { } else {