no message
This commit is contained in:
@@ -139,7 +139,18 @@ public function RequestAction($Ident, $Value)
|
|||||||
if ($power < 0) {
|
if ($power < 0) {
|
||||||
|
|
||||||
// Laden
|
// Laden
|
||||||
$lade_strom = abs($power) / GetValue($this->ReadPropertyInteger("Batteriespannung"));
|
$uVarID = $this->ReadPropertyInteger("Batteriespannung");
|
||||||
|
if ($uVarID > 0 && IPS_VariableExists($uVarID)) {
|
||||||
|
$U = GetValue($uVarID);
|
||||||
|
if ($U > 0) {
|
||||||
|
$lade_strom = abs($power) / $U;
|
||||||
|
} else {
|
||||||
|
$lade_strom = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$lade_strom = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$this->SetValue("Ladestrom", $lade_strom);
|
$this->SetValue("Ladestrom", $lade_strom);
|
||||||
$this->SetValue("Entladestrom", 0);
|
$this->SetValue("Entladestrom", 0);
|
||||||
$this->SetValue("Batteriespannung_laden_entladen", 56);
|
$this->SetValue("Batteriespannung_laden_entladen", 56);
|
||||||
@@ -147,7 +158,18 @@ public function RequestAction($Ident, $Value)
|
|||||||
} elseif ($power > 0) {
|
} elseif ($power > 0) {
|
||||||
|
|
||||||
// Entladen
|
// Entladen
|
||||||
$entlade_strom = $power / GetValue($this->ReadPropertyInteger("Batteriespannung"));
|
$uVarID = $this->ReadPropertyInteger("Batteriespannung");
|
||||||
|
if ($uVarID > 0 && IPS_VariableExists($uVarID)) {
|
||||||
|
$U = GetValue($uVarID);
|
||||||
|
if ($U > 0) {
|
||||||
|
$entlade_strom = $power / $U;
|
||||||
|
} else {
|
||||||
|
$entlade_strom = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$entlade_strom = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$this->SetValue("Entladestrom", $entlade_strom);
|
$this->SetValue("Entladestrom", $entlade_strom);
|
||||||
$this->SetValue("Ladestrom", 0);
|
$this->SetValue("Ladestrom", 0);
|
||||||
$this->SetValue("Batteriespannung_laden_entladen", 49);
|
$this->SetValue("Batteriespannung_laden_entladen", 49);
|
||||||
@@ -157,8 +179,6 @@ public function RequestAction($Ident, $Value)
|
|||||||
// Kein Stromfluss (Leistung = 0)
|
// Kein Stromfluss (Leistung = 0)
|
||||||
$this->SetValue("Ladestrom", 0);
|
$this->SetValue("Ladestrom", 0);
|
||||||
$this->SetValue("Entladestrom", 0);
|
$this->SetValue("Entladestrom", 0);
|
||||||
// Optional: Spannung neutral setzen, falls gewünscht
|
|
||||||
$this->SetValue("Batteriespannung_laden_entladen", 52);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -290,7 +310,7 @@ public function RequestAction($Ident, $Value)
|
|||||||
IPS_LogMessage("Batterie", "Im else teil");
|
IPS_LogMessage("Batterie", "Im else teil");
|
||||||
|
|
||||||
|
|
||||||
if($batterieladezustand>99){
|
if($batterieladezustand>59.9){
|
||||||
IPS_LogMessage("Batterie", "im 1");
|
IPS_LogMessage("Batterie", "im 1");
|
||||||
|
|
||||||
$filtered_powersteps = array_filter($array_powersteps, function ($value) {
|
$filtered_powersteps = array_filter($array_powersteps, function ($value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user