no message

This commit is contained in:
belevo\mh
2025-09-30 14:23:26 +02:00
parent 34be216cc7
commit da44cab3e0
2 changed files with 5 additions and 76 deletions

View File

@@ -1,3 +1,4 @@
{ {
"elements": [ "elements": [
{ {
@@ -100,45 +101,6 @@
"name": "Aussentemp", "name": "Aussentemp",
"caption": "Aussentemperatur", "caption": "Aussentemperatur",
"suffix": "°C" "suffix": "°C"
},
{
"elements": [
{
"type": "Select",
"name": "Stufen",
"caption": "Anzahl Stufen",
"options": [
{ "caption": "1-stufig", "value": 1 },
{ "caption": "2-stufig", "value": 2 },
{ "caption": "3-stufig", "value": 3 },
{ "caption": "4-stufig", "value": 4 }
]
},
{
"type": "NumberSpinner",
"name": "Stufe1",
"caption": "Wert Stufe 1",
"visible": "{Stufen} >= 1"
},
{
"type": "NumberSpinner",
"name": "Stufe2",
"caption": "Wert Stufe 2",
"visible": "{Stufen} >= 2"
},
{
"type": "NumberSpinner",
"name": "Stufe3",
"caption": "Wert Stufe 3",
"visible": "{Stufen} >= 3"
},
{
"type": "NumberSpinner",
"name": "Stufe4",
"caption": "Wert Stufe 4",
"visible": "{Stufen} >= 4"
}
]
} }
] ]
} }

View File

@@ -1,23 +1,14 @@
<?php
<?php
class Pufferspeicher extends IPSModule class Pufferspeicher extends IPSModule
{ {
public function Create() public function Create()
{ {
parent::Create(); parent::Create();
// Boiler spezifische Properties // Boiler spezifische Properties
$this->RegisterPropertyInteger("PufferLeistung", 6000); $this->RegisterPropertyInteger("PufferLeistung", 6000);
$this->RegisterPropertyInteger("PufferTeilLeistung", 3000); $this->RegisterPropertyInteger("PufferTeilLeistung", 3000);
$this->RegisterPropertyInteger("Stufe1", 100);
$this->RegisterPropertyInteger("Stufe2", 1000);
$this->RegisterPropertyInteger("Stufe3", 3000);
$this->RegisterPropertyInteger("Stufe4", 6000);
$this->RegisterPropertyInteger("ZeitKonstante", 120); $this->RegisterPropertyInteger("ZeitKonstante", 120);
$this->RegisterPropertyInteger("Pufferfuehler_PT1", 0); $this->RegisterPropertyInteger("Pufferfuehler_PT1", 0);
$this->RegisterPropertyInteger("Heizkontakt2_Puffer", 0); $this->RegisterPropertyInteger("Heizkontakt2_Puffer", 0);
@@ -38,7 +29,6 @@ class Pufferspeicher extends IPSModule
$this->RegisterVariableInteger("Aussentemperatur", "Aussentemperatur", "", 15); $this->RegisterVariableInteger("Aussentemperatur", "Aussentemperatur", "", 15);
$this->RegisterVariableBoolean("Hysterese", "Hysterese","",false); $this->RegisterVariableBoolean("Hysterese", "Hysterese","",false);
// Variabeln für Kommunkation mit Manager // Variabeln für Kommunkation mit Manager
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio"); $this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
$this->RegisterVariableInteger("PV_Prio", "PV_Prio"); $this->RegisterVariableInteger("PV_Prio", "PV_Prio");
@@ -49,29 +39,22 @@ class Pufferspeicher extends IPSModule
$this->RegisterVariableInteger("Power", "Power", '', 0); $this->RegisterVariableInteger("Power", "Power", '', 0);
$this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving", "", true); $this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving", "", true);
$this->RegisterVariableInteger("Leistung_Delta", "Leistung_Delta", "", 0); $this->RegisterVariableInteger("Leistung_Delta", "Leistung_Delta", "", 0);
// Hilfsvariabeln für Idle zustand // Hilfsvariabeln für Idle zustand
$this->RegisterPropertyInteger("IdleCounterMax", 2); $this->RegisterPropertyInteger("IdleCounterMax", 2);
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0); $this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
$this->SetValue("IdleCounter", 0); $this->SetValue("IdleCounter", 0);
// Initialisiere Idle // Initialisiere Idle
$this->SetValue("Idle", true); $this->SetValue("Idle", true);
$this->RegisterTimer("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");'); $this->RegisterTimer("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
} }
public function ApplyChanges() public function ApplyChanges()
{ {
parent::ApplyChanges(); parent::ApplyChanges();
$this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000); $this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000);
} }
public function RequestAction($Ident, $Value) public function RequestAction($Ident, $Value)
{ {
switch ($Ident) { switch ($Ident) {
case "SetAktuelle_Leistung": case "SetAktuelle_Leistung":
$this->SetValue("Power", (int)$Value); $this->SetValue("Power", (int)$Value);
break; break;
@@ -81,25 +64,22 @@ class Pufferspeicher extends IPSModule
break; break;
case "Do_UserCalc": case "Do_UserCalc":
$this->SetAktuelle_Leistung($this->GetValue("Power")); $this->SetAktuelle_Leistung($this->GetValue("Power"));
$this->GetCurrentData($this->GetValue("Is_Peak_Shaving")); $this->GetCurrentData($this->GetValue("Is_Peak_Shaving"));
break; break;
default: default:
throw new Exception("Invalid Ident"); throw new Exception("Invalid Ident");
} }
} }
// 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("Stufe4")) { if ($power == $this->ReadPropertyInteger("PufferLeistung")) {
SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), true); SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), true);
SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), false); SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), false);
} elseif ( } elseif (
$power == $this->ReadPropertyInteger("Stufe3") $power == $this->ReadPropertyInteger("PufferTeilLeistung")
) { ) {
SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), false); SetValue($this->ReadPropertyInteger("Heizkontakt2_Puffer"), false);
SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), true); SetValue($this->ReadPropertyInteger("Heizkontakt1_Puffer"), true);
@@ -117,21 +97,18 @@ class Pufferspeicher extends IPSModule
$this->ReadPropertyInteger("IdleCounterMax") $this->ReadPropertyInteger("IdleCounterMax")
); );
} }
// Setze die neue Aktuelle_Leistung // Setze die neue Aktuelle_Leistung
$this->SetValue("Aktuelle_Leistung", $power); $this->SetValue("Aktuelle_Leistung", $power);
$this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600)))); $this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600))));
// IdleCounter verarbeiten // IdleCounter verarbeiten
$this->ProcessIdleCounter(); $this->ProcessIdleCounter();
} }
// Methode zum Abrufen der aktuellen Daten // Methode zum Abrufen der aktuellen Daten
public function GetCurrentData(bool $Peak) public function GetCurrentData(bool $Peak)
{ {
$boilertemperatur_glätten = $this->ReadPropertyBoolean("Puffertemperatur_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("Pufferfuehler_PT1"); $boilerFuehlerPT1ID = $this->ReadPropertyInteger("Pufferfuehler_PT1");
@@ -169,7 +146,6 @@ class Pufferspeicher extends IPSModule
} }
$at = GetValue($this->ReadPropertyInteger("Aussentemp")); $at = GetValue($this->ReadPropertyInteger("Aussentemp"));
$this->SetValue("Aussentemperatur", $at); $this->SetValue("Aussentemperatur", $at);
$m = $this->GetValue("Steigung"); $m = $this->GetValue("Steigung");
@@ -178,9 +154,7 @@ class Pufferspeicher extends IPSModule
$maxAT = $this->ReadPropertyInteger("MaxAT_Temp"); // z.B. 20 $maxAT = $this->ReadPropertyInteger("MaxAT_Temp"); // z.B. 20
$minAT = $this->ReadPropertyInteger("MinAT_Temp"); // z.B. 0 $minAT = $this->ReadPropertyInteger("MinAT_Temp"); // z.B. 0
$m = ($maxVT - $minVT) / ($minAT - $maxAT); $m = ($maxVT - $minVT) / ($minAT - $maxAT);
$this->SetValue("Steigung", $m); $this->SetValue("Steigung", $m);
if ($at < $minAT){ if ($at < $minAT){
$VT = $maxVT; $VT = $maxVT;
} elseif ($at > $maxAT){ } elseif ($at > $maxAT){
@@ -189,20 +163,17 @@ class Pufferspeicher extends IPSModule
$VT = $m * $at + $maxVT; $VT = $m * $at + $maxVT;
} }
$this->SetValue("Maximaltemperatur", $VT ); $this->SetValue("Maximaltemperatur", $VT );
$boilerTemp = $this->GetValue("Puffertemperatur"); $boilerTemp = $this->GetValue("Puffertemperatur");
$pufferLeistung = $this->ReadPropertyInteger("PufferLeistung"); $pufferLeistung = $this->ReadPropertyInteger("PufferLeistung");
$pufferTeilLeistung = $this->ReadPropertyInteger("PufferTeilLeistung"); $pufferTeilLeistung = $this->ReadPropertyInteger("PufferTeilLeistung");
$hyst = $this->GetValue("Hysterese"); $hyst = $this->GetValue("Hysterese");
if($VT < $boilerTemp){ if($VT < $boilerTemp){
$this->SetValue("Hysterese", false ); $this->SetValue("Hysterese", false );
}elseif($VT-5 >= $boilerTemp){ }elseif($VT-5 >= $boilerTemp){
$this->SetValue("Hysterese", true); $this->SetValue("Hysterese", true);
} }
if ($Peak) { if ($Peak) {
$this->SetValue( "PowerSteps", json_encode([0]) ); $this->SetValue( "PowerSteps", json_encode([0]) );
} else { } else {
@@ -215,7 +186,6 @@ class Pufferspeicher extends IPSModule
} }
} }
} }
private function ProcessIdleCounter() private function ProcessIdleCounter()
{ {
// IdleCounter auslesen und verarbeiten // IdleCounter auslesen und verarbeiten
@@ -227,7 +197,6 @@ class Pufferspeicher extends IPSModule
$this->SetValue("Idle", true); $this->SetValue("Idle", true);
} }
} }
private function CheckIdle($power) private function CheckIdle($power)
{ {
$lastpower = GetValue("Aktuelle_Leistung"); $lastpower = GetValue("Aktuelle_Leistung");
@@ -248,7 +217,5 @@ class Pufferspeicher extends IPSModule
} }
} }
} }
?> ?>