Auf stand von Testing

This commit is contained in:
2025-01-21 07:36:49 +01:00
parent 278fafeca1
commit 7856853146
3 changed files with 17 additions and 23 deletions

View File

@@ -18,14 +18,12 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
// Boiler spezifische Variablen
$this->RegisterVariableInteger("Mindesttemperatur","Mindesttemperatur","",45);
$this->RegisterVariableInteger("Maximaltemperatur","Maximaltemperatur","",60);
$this->RegisterVariableInteger("Legionellentemperatur","Legionellentemperatur","",65);
$this->RegisterVariableInteger("LegioCounter", "LegioCounter", "", 0);
//$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0);
$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0);
// Variabeln für Kommunkation mit Manager
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
@@ -114,46 +112,42 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
$boilertemperatur_glätten = $this->ReadPropertyBoolean("Boilertemperatur_glätten");
if ($boilertemperatur_glätten) {
// Wenn Glättung aktiviert ist, führe das Glätten durch
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
} else {
$boilerPT1 = 0.0; // Standardwert
$boilerPT1 = 0.0;
}
$boilerTempID = $this->GetIDForIdent("Boilertemperatur");
if (IPS_VariableExists($boilerTempID)) {
$boilerTemp = $this->GetValue("Boilertemperatur");
$boilerTemp_test = $this->GetIDForIdent("Boilertemperatur");
if (IPS_VariableExists($boilerTemp_test)) {
$boilerTemp_test = $this->GetValue("Boilertemperatur");
} else {
$boilerTemp = 0.0; // Standardwert
$boilerTemp_test = 0.0;
}
// PT
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
$boilerTemp_test = $this->GetValue("Boilertemperatur");
$time_constant= $this->ReadPropertyInteger("ZeitKonstante");
$delta_t = 30; // Zeitdifferenz zwischen den Messungen (30 Sekunden)
$delta_t = 30;
$alpha = $delta_t / ($time_constant + $delta_t);
$newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp);
$newBoilerTemp = $boilerTemp_test + $alpha * ($boilerPT1 - $boilerTemp_test);
$this->SetValue("Boilertemperatur", $newBoilerTemp);
} else {
// Wenn Glättung nicht aktiviert ist, setze die Boilertemperatur direkt auf den Wert des Boilerfühlers
$boilerFuehlerPT1ID = $this->ReadPropertyInteger("Boilerfuehler_PT1");
if (IPS_VariableExists($boilerFuehlerPT1ID)) {
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
} else {
$boilerPT1 = 0.0; // Standardwert
$boilerPT1 = 0.0;
}
// Setze Boilertemperatur direkt auf den Wert des Boilerfühlers
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
$this->SetValue("Boilertemperatur", $boilerPT1);
}
$boilerTemp = $this->GetValue("Boilertemperatur");
$minTemp = $this->GetValue("Mindesttemperatur");
$maxTemp = $this->GetValue("Maximaltemperatur");
$LegioTemp = $this->GetValue("Legionellentemperatur");

View File

@@ -4,7 +4,7 @@ class CC100_HW extends IPSModule
{
private $DigOutPID = "/sys/kernel/dout_drv/DOUT_DATA";
private $PT1PID = "/sys/bus/iio/devices/iio:device2/in_voltage13_raw";
private $PT2PID = "/sys/bus/iio/devices/iio:device2/in_voltage1_raw";
private $PT2PID = "/sys/bus/iio/devices/iio:device2/in_voltage1_raw";
private $DIN_FILE = "/sys/devices/platform/soc/44009000.spi/spi_master/spi0/spi0.0/din";
private $waitingTime = 1; // Waiting time (in ms) for a new attempt to write a digital output (if file is blocked)
private $maxTime = 5000; // Max time (in ms) for the writing process

View File

@@ -6,7 +6,7 @@
"compatibility": {
"version": "7.1"
},
"version": "0.268",
"version": "0.277",
"build": 0,
"date": 0