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 // Boiler spezifische Variablen
$this->RegisterVariableInteger("Mindesttemperatur","Mindesttemperatur","",45); $this->RegisterVariableInteger("Mindesttemperatur","Mindesttemperatur","",45);
$this->RegisterVariableInteger("Maximaltemperatur","Maximaltemperatur","",60); $this->RegisterVariableInteger("Maximaltemperatur","Maximaltemperatur","",60);
$this->RegisterVariableInteger("Legionellentemperatur","Legionellentemperatur","",65); $this->RegisterVariableInteger("Legionellentemperatur","Legionellentemperatur","",65);
$this->RegisterVariableInteger("LegioCounter", "LegioCounter", "", 0); $this->RegisterVariableInteger("LegioCounter", "LegioCounter", "", 0);
//$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0);
$this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0); $this->RegisterVariableInteger("Boilertemperatur", "Boilertemperatur", "", 0);
// Variabeln für Kommunkation mit Manager // Variabeln für Kommunkation mit Manager
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio"); $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"); $boilertemperatur_glätten = $this->ReadPropertyBoolean("Boilertemperatur_glätten");
if ($boilertemperatur_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("Boilerfuehler_PT1");
if (IPS_VariableExists($boilerFuehlerPT1ID)) { if (IPS_VariableExists($boilerFuehlerPT1ID)) {
$boilerPT1 = GetValue($boilerFuehlerPT1ID); $boilerPT1 = GetValue($boilerFuehlerPT1ID);
} else { } else {
$boilerPT1 = 0.0; // Standardwert $boilerPT1 = 0.0;
} }
$boilerTemp_test = $this->GetIDForIdent("Boilertemperatur");
$boilerTempID = $this->GetIDForIdent("Boilertemperatur"); if (IPS_VariableExists($boilerTemp_test)) {
if (IPS_VariableExists($boilerTempID)) { $boilerTemp_test = $this->GetValue("Boilertemperatur");
$boilerTemp = $this->GetValue("Boilertemperatur");
} else { } else {
$boilerTemp = 0.0; // Standardwert $boilerTemp_test = 0.0;
} }
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
// PT $boilerTemp_test = $this->GetValue("Boilertemperatur");
$time_constant= $this->ReadPropertyInteger("ZeitKonstante"); $time_constant= $this->ReadPropertyInteger("ZeitKonstante");
$delta_t = 30; // Zeitdifferenz zwischen den Messungen (30 Sekunden) $delta_t = 30;
$alpha = $delta_t / ($time_constant + $delta_t); $alpha = $delta_t / ($time_constant + $delta_t);
$newBoilerTemp = $boilerTemp + $alpha * ($boilerPT1 - $boilerTemp); $newBoilerTemp = $boilerTemp_test + $alpha * ($boilerPT1 - $boilerTemp_test);
$this->SetValue("Boilertemperatur", $newBoilerTemp); $this->SetValue("Boilertemperatur", $newBoilerTemp);
} else { } 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("Boilerfuehler_PT1");
if (IPS_VariableExists($boilerFuehlerPT1ID)) { if (IPS_VariableExists($boilerFuehlerPT1ID)) {
$boilerPT1 = GetValue($boilerFuehlerPT1ID); $boilerPT1 = GetValue($boilerFuehlerPT1ID);
} else { } else {
$boilerPT1 = 0.0; // Standardwert $boilerPT1 = 0.0;
} }
$boilerPT1 = GetValue($boilerFuehlerPT1ID);
// Setze Boilertemperatur direkt auf den Wert des Boilerfühlers
$this->SetValue("Boilertemperatur", $boilerPT1); $this->SetValue("Boilertemperatur", $boilerPT1);
} }
$boilerTemp = $this->GetValue("Boilertemperatur");
$minTemp = $this->GetValue("Mindesttemperatur"); $minTemp = $this->GetValue("Mindesttemperatur");
$maxTemp = $this->GetValue("Maximaltemperatur"); $maxTemp = $this->GetValue("Maximaltemperatur");
$LegioTemp = $this->GetValue("Legionellentemperatur"); $LegioTemp = $this->GetValue("Legionellentemperatur");

View File

@@ -4,7 +4,7 @@ class CC100_HW extends IPSModule
{ {
private $DigOutPID = "/sys/kernel/dout_drv/DOUT_DATA"; private $DigOutPID = "/sys/kernel/dout_drv/DOUT_DATA";
private $PT1PID = "/sys/bus/iio/devices/iio:device2/in_voltage13_raw"; 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 $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 $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 private $maxTime = 5000; // Max time (in ms) for the writing process

View File

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