umbau der energiemenge, manager rundet jetzt auf 2kwh dadurch wird integratepower nicht mehr benötigt.
This commit is contained in:
@@ -29,7 +29,6 @@ class Verbraucher_1_Stufig 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");
|
||||
$this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving");
|
||||
@@ -79,19 +78,6 @@ class Verbraucher_1_Stufig 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -135,7 +121,7 @@ class Verbraucher_1_Stufig extends IPSModule
|
||||
$this->SetTimerOn();
|
||||
}
|
||||
$this->SetValue("Aktuelle_Leistung", $power);
|
||||
$this->IntegratePower();
|
||||
$this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600))));
|
||||
|
||||
$boilerLeistung = $this->ReadPropertyInteger("BoilerLeistung");
|
||||
$schaltkontaktID = $this->ReadPropertyInteger("Schaltkontakt1");
|
||||
|
||||
Reference in New Issue
Block a user