leistungsintegral verändert damit das takten nincht so schnell läfunt
This commit is contained in:
@@ -35,6 +35,7 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
|
||||
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
|
||||
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
|
||||
$this->RegisterVariableFloat("Bezogene_Energie_Zwischenwert", "Bezogene_Energie_Zwischenwert", "", 0);
|
||||
$this->RegisterVariableString("PowerSteps", "PowerSteps");
|
||||
$this->RegisterVariableInteger("Power", "Power", '', 0);
|
||||
$this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving", "", true);
|
||||
@@ -83,6 +84,22 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function IntegratePower() {
|
||||
|
||||
if (rand(1, 1000) === 1) { // 0.1% Chance
|
||||
|
||||
$this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + $this->GetValue("Bezogene_Energie_Zwischenwert") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600))));
|
||||
$this->SetValue("Bezogene_Energie_Zwischenwert", 0);
|
||||
|
||||
}else{
|
||||
$this->SetValue("Bezogene_Energie_Zwischenwert", $this->GetValue("Bezogene_Energie_Zwischenwert") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600)));
|
||||
}
|
||||
|
||||
return; // Falls nichts gespeichert wird
|
||||
}
|
||||
|
||||
|
||||
public function getNextTimeAndTemperature($zeitplan) {
|
||||
$arr = json_decode($zeitplan, true);
|
||||
if (empty($arr)) {
|
||||
@@ -161,7 +178,7 @@ class Boiler_2_Stufig_Mit_Fueler extends IPSModule
|
||||
|
||||
// Setze die neue Aktuelle_Leistung
|
||||
$this->SetValue("Aktuelle_Leistung", $power);
|
||||
$this->SetValue("Bezogene_Energie", $this->GetValue("Bezogene_Energie")+($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600)));
|
||||
$this->IntegratePower();
|
||||
// IdleCounter verarbeiten
|
||||
$this->ProcessIdleCounter();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user