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