no message
This commit is contained in:
@@ -629,6 +629,34 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sumReq = (abs($pEvW) + abs($pSdlW));
|
||||||
|
$sumReqRel = ($pEvW + $pSdlW);
|
||||||
|
|
||||||
|
if($sumReq==0){
|
||||||
|
|
||||||
|
$this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist / 2);
|
||||||
|
$this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist / 2);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
if($pEvW>=0){
|
||||||
|
|
||||||
|
$this->SetValue("Aktuelle_Leistung_EV",((1+($totalPower_ist-$sumReqRel) / $sumReq)) * $pEvW);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$this->SetValue("Aktuelle_Leistung_EV",((1-($totalPower_ist-$sumReqRel) / $sumReq)) * $pEvW);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if($pSdlW>=0){
|
||||||
|
$this->SetValue("Aktuelle_Leistung_SDL",((1+($totalPower_ist-$sumReqRel) / $sumReq)) * $pSdlW);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$this->SetValue("Aktuelle_Leistung_SDL",((1-($totalPower_ist-$sumReqRel) / $sumReq)) * $pSdlW);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/*
|
||||||
$sumReq = (float)($pEvW + $pSdlW);
|
$sumReq = (float)($pEvW + $pSdlW);
|
||||||
|
|
||||||
if (!is_finite($sumReq) || abs($sumReq) < 0.01) {
|
if (!is_finite($sumReq) || abs($sumReq) < 0.01) {
|
||||||
@@ -643,6 +671,9 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array
|
|||||||
$this->SetValue("Aktuelle_Leistung_SDL",($totalPower_ist / $sumReq) * $pSdlW);
|
$this->SetValue("Aktuelle_Leistung_SDL",($totalPower_ist / $sumReq) * $pSdlW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
return $finalOutput;
|
return $finalOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
"VGT MQTT Device"
|
"VGT MQTT Device"
|
||||||
],
|
],
|
||||||
"parentRequirements": [
|
"parentRequirements": [
|
||||||
"{043EA491-0325-4ADD-8FC2-A30C8EEB4D3F}"
|
"{F7A0DD2E-7684-4520-B61B-9613D6163722}"
|
||||||
],
|
],
|
||||||
"childRequirements": [],
|
"childRequirements": [],
|
||||||
"implemented": [
|
"implemented": [
|
||||||
"{7F7632D9-FA40-4F38-8DEA-C83CD4325A32}"
|
"{018EF6B5-AB94-40C6-AA53-46943E824ACF}"
|
||||||
],
|
],
|
||||||
"prefix": "VGT",
|
"prefix": "VGT",
|
||||||
"version": "1.0"
|
"version": "1.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user