no message
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
"caption": "Intervall Neuberechnung der Werte ",
|
||||
"suffix": "Sekunden"
|
||||
},
|
||||
{
|
||||
"type": "NumberSpinner",
|
||||
"name": "Mindestsperrleistung",
|
||||
"caption": "Minimaler Leistungswert um eine Sperre zu starten",
|
||||
"suffix": "Watt"
|
||||
},
|
||||
{
|
||||
"type": "NumberSpinner",
|
||||
"name": "MaxSperrZeit",
|
||||
|
||||
@@ -18,8 +18,10 @@ class Verbraucher_Sperrbar extends IPSModule
|
||||
$this->RegisterVariableInteger("DailyOnTime", "DailyOnTime", "", 0);
|
||||
$this->RegisterVariableBoolean("IsTimerActive", "IsTimerActive", "", 0);
|
||||
$this->RegisterVariableBoolean("IstNacht", "IstNacht", "", 0);
|
||||
$this->RegisterVariableBoolean("Sperrung_Aktiv", "Sperrung_Aktiv", "", false);
|
||||
$this->RegisterVariableInteger("Mindestsperrleistung", "Mindestsperrleistung", "", 100);
|
||||
|
||||
|
||||
|
||||
// Verbraucherspezifischer Timer
|
||||
$this->SetValue("IsTimerActive", false);
|
||||
$this->RegisterTimer("ZustandswechselTimer",0,"IPS_RequestAction(" .$this->InstanceID .', "ResetPowerSteps", "");');
|
||||
@@ -125,7 +127,7 @@ class Verbraucher_Sperrbar extends IPSModule
|
||||
$this->SetValue("Aktuelle_Leistung", $power);
|
||||
$this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600))));
|
||||
|
||||
$Leistung = $this->ReadPropertyInteger("Leistung");
|
||||
$Leistung = GetValue($this->ReadPropertyInteger("Leistung"));
|
||||
$schaltkontaktID = $this->ReadPropertyInteger("Schaltkontakt1");
|
||||
|
||||
if ($power == $Leistung) {
|
||||
@@ -156,16 +158,24 @@ class Verbraucher_Sperrbar extends IPSModule
|
||||
$IstNacht = $this->GetValue("IstNacht");
|
||||
$NeuesIstNacht = $this->ist_nachts();
|
||||
|
||||
if ($IstNacht == true && $NeuesIstNacht == false) {
|
||||
if ($IstNacht == false && $NeuesIstNacht == true) {
|
||||
$this->SetValue("DailyOnTime", 0);
|
||||
}
|
||||
|
||||
$this->SetValue("IstNacht", $NeuesIstNacht);
|
||||
|
||||
$istSperre = $this->GetValue("Sperrung_Aktiv");
|
||||
|
||||
if($istSperre ==false && GetValue($this->ReadPropertyInteger("Leistung"))>=$this->GetValue("Mindestsperrleistung")){
|
||||
$istSperre = true;
|
||||
$this->SetValue("Sperrung_Aktiv", true);
|
||||
}elseif($istSperre ==true && GetValue($this->ReadPropertyInteger("Leistung"))<=$this->GetValue("Mindestsperrleistung")){
|
||||
$istSperre = false;
|
||||
$this->SetValue("Sperrung_Aktiv", false);
|
||||
}
|
||||
|
||||
$DailyOnTime = $this->GetValue("DailyOnTime");
|
||||
$maxlaufzeit = $this->ReadPropertyInteger("MaxSperrZeit") * 60 *12 / $this->ReadPropertyInteger("Interval");
|
||||
$maxlaufzeit = $this->ReadPropertyInteger("MaxSperrZeit") * 60 * 60 / $this->ReadPropertyInteger("Interval");
|
||||
|
||||
// Überprüfen, ob der Timer aktiv ist
|
||||
if ($this->GetValue("IsTimerActive")) {
|
||||
@@ -177,7 +187,7 @@ class Verbraucher_Sperrbar extends IPSModule
|
||||
}
|
||||
// Wenn Maxlaufzeit nicht erreicht ist
|
||||
elseif ($DailyOnTime < $maxlaufzeit) {
|
||||
if ($Peak) {
|
||||
if ($Peak && $istSperre) {
|
||||
$this->SetValue(
|
||||
"PowerSteps",
|
||||
json_encode([
|
||||
|
||||
Reference in New Issue
Block a user