no message
This commit is contained in:
@@ -69,10 +69,9 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sdlTotalW = (float)$this->ReadPropertyInteger("SDL_Leistung"); // W
|
$sdlTotalW = (float)$this->ReadPropertyInteger("SDL_Leistung"); // W
|
||||||
if ($sdlTotalW < 0) $sdlTotalW = 0;
|
if ($sdlTotalW < 0) $sdlTotalW = 0.0;
|
||||||
$sdlTotalkW = $sdlTotalW/1000;
|
|
||||||
// 30 Minuten Fenster
|
$hours = 0.5; // 30 Minuten
|
||||||
$hours = 0.5;
|
|
||||||
|
|
||||||
// Summe Batterie-Maxleistungen
|
// Summe Batterie-Maxleistungen
|
||||||
$sumBatPowerW = 0.0;
|
$sumBatPowerW = 0.0;
|
||||||
@@ -85,13 +84,27 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
$this->WriteAllZero("sumBatPowerW=0");
|
$this->WriteAllZero("sumBatPowerW=0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$sumBatPowerkW = $sumBatPowerW/1000;
|
|
||||||
|
|
||||||
|
// Einheiten
|
||||||
|
$sdlTotalkW = $sdlTotalW / 1000.0;
|
||||||
|
$sumBatPowerkW = $sumBatPowerW / 1000.0;
|
||||||
|
|
||||||
//--------------------------------------------
|
// Totals (dein Modell)
|
||||||
$real_kWh = 0.0;
|
$totalCapKWh = 0.0;
|
||||||
|
|
||||||
//-------------------------------
|
$real_kWh_ev_ges = 0.0;
|
||||||
|
$real_kWh_sdl_ges = 0.0;
|
||||||
|
|
||||||
|
$SDL_kWh_ges = 0.0; // Summe (2*under)
|
||||||
|
$EV_kWh_ges = 0.0; // Summe (cap - 2*under)
|
||||||
|
|
||||||
|
$sdlDisKW_ges = 0.0;
|
||||||
|
$evDisKW_ges = 0.0;
|
||||||
|
$sdlChKW_ges = 0.0;
|
||||||
|
$evChKW_ges = 0.0;
|
||||||
|
|
||||||
|
$pSDLmaxKW_ges = 0.0; // Summe SDL-Anteile (kW)
|
||||||
|
$pEVmaxKW_ges = 0.0; // Summe EV-Anteile (kW)
|
||||||
|
|
||||||
$calc = [
|
$calc = [
|
||||||
"inputs" => [
|
"inputs" => [
|
||||||
@@ -103,138 +116,150 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
"total" => []
|
"total" => []
|
||||||
];
|
];
|
||||||
|
|
||||||
// Meine initalisierte Variablen
|
|
||||||
$EV_SOC = 0.0;
|
|
||||||
$SDL_SOC =0.0;
|
|
||||||
$sdlDisKW = 0.0; // SDL-
|
|
||||||
$evDisKW = 0.0; // EV-
|
|
||||||
$sdlChKW = 0.0; // SDL+
|
|
||||||
$evChKW = 0.0; //EV+
|
|
||||||
|
|
||||||
$sdlDisKW_ges = 0.0; // SDL- gesamt
|
|
||||||
$evDisKW_ges = 0.0; // EV- gesamt
|
|
||||||
$sdlChKW_ges = 0.0; // SDL+ gesamt
|
|
||||||
$evChKW_ges = 0.0; //EV+ gesamt
|
|
||||||
|
|
||||||
$real_kWh_ev_ges = 0.0;
|
|
||||||
$real_kWh_sdl_ges = 0.0;
|
|
||||||
$SDL_kWh_ges = 0.0;
|
|
||||||
$EV_kWh_ges = 0.0;
|
|
||||||
|
|
||||||
$real_kWh_ev = 0.0;
|
|
||||||
$real_kWh_sdl = 0.0;
|
|
||||||
$EV_SOC = 0.0;
|
|
||||||
$SDL_SOC = 0.0;
|
|
||||||
$sdlDisKW = 0.0;
|
|
||||||
$evDisKW = 0.0;
|
|
||||||
$sdlChKW = 0.0;
|
|
||||||
$evChKW = 0.0;
|
|
||||||
|
|
||||||
$totalCapKWh = 0.0;
|
|
||||||
|
|
||||||
foreach ($batteries as $idx => $b) {
|
foreach ($batteries as $idx => $b) {
|
||||||
|
|
||||||
|
// pro Batterie reset
|
||||||
|
$EV_SOC = 0.0;
|
||||||
|
$SDL_SOC = 0.0;
|
||||||
|
|
||||||
|
$sdlDisKW = 0.0;
|
||||||
|
$evDisKW = 0.0;
|
||||||
|
$sdlChKW = 0.0;
|
||||||
|
$evChKW = 0.0;
|
||||||
|
|
||||||
|
$real_kWh_ev = 0.0;
|
||||||
|
$real_kWh_sdl = 0.0;
|
||||||
|
|
||||||
|
// Eingaben
|
||||||
$pBatW = max(0.0, (float)($b["powerbat"] ?? 0));
|
$pBatW = max(0.0, (float)($b["powerbat"] ?? 0));
|
||||||
$pBatkW = $pBatW/1000;
|
$pBatkW = $pBatW / 1000.0;
|
||||||
$capKWh = max(0.0, (float)($b["capazity"] ?? 0));
|
$capKWh = max(0.0, (float)($b["capazity"] ?? 0));
|
||||||
|
|
||||||
// soc ist SelectVariable -> Variable-ID
|
|
||||||
$socVarId = (int)($b["soc"] ?? 0);
|
$socVarId = (int)($b["soc"] ?? 0);
|
||||||
$socPct = $this->ReadSocPercent($socVarId);
|
$socPct = (float)$this->ReadSocPercent($socVarId);
|
||||||
|
|
||||||
|
if ($socPct < 0.0) $socPct = 0.0;
|
||||||
|
if ($socPct > 100.0) $socPct = 100.0;
|
||||||
//--------------Meine Berechnung, so wie ich es möchte------------------------
|
|
||||||
|
|
||||||
|
|
||||||
$sdlShareKW = $sdlTotalkW/$sumBatPowerkW*$pBatkW; // SDL Power
|
|
||||||
$evShareKW = $pBatkW - $sdlShareKW ; // EV Power
|
|
||||||
$underKWh = $sdlShareKW * $hours;// untere GRenze für SDL
|
|
||||||
$upKWh = $capKWh - $underKWh ; // obere Grenze für SDL
|
|
||||||
$SDL_kWh = 2*$underKWh; //SDL kWh
|
|
||||||
$EV_kWH = $capKWh - 2*$underKWh; // EV kWh
|
|
||||||
$real_kWh = $capKWh/100 * $socPct;// Jetziger Füllstand in kWh
|
|
||||||
|
|
||||||
|
|
||||||
if ($underKWh < $real_kWh && $upKWh > $real_kWh ){
|
|
||||||
$SDL_SOC = 50;
|
|
||||||
$EV_SOC = ($real_kWh - $underKWh) * 100 / $capKWh;
|
|
||||||
$sdlDisKW = $sdlShareKW; // SDL-
|
|
||||||
$evDisKW = $evShareKW; // EV-
|
|
||||||
$sdlChKW = $sdlShareKW; // SDL+
|
|
||||||
$evChKW = $evShareKW; //EV+
|
|
||||||
// Reale kWh für EV und SDl
|
|
||||||
$real_kWh_ev = $real_kWh - $underKWh;
|
|
||||||
$real_kWh_sdl = $underKWh;
|
|
||||||
|
|
||||||
} elseif ($upKWh < $real_kWh) {
|
|
||||||
$EV_SOC = 100;
|
|
||||||
$SDL_SOC = ($capKWh - $EV_kWH) / (2*$underKWh) * 100;
|
|
||||||
$sdlDisKW = $sdlShareKW; // SDL-
|
|
||||||
$evDisKW = $evShareKW; // EV-
|
|
||||||
$sdlChKW = $sdlShareKW; // SDL+
|
|
||||||
$evChKW = 0; //EV+
|
|
||||||
// Reale kWh für EV und SDl
|
|
||||||
$real_kWh_ev = $real_kWh - 2*$underKWh;
|
|
||||||
$real_kWh_sdl = (2 * $underKWh) - ($capKWh - $real_kWh);
|
|
||||||
|
|
||||||
} elseif ($underKWh > $real_kWh) {
|
|
||||||
$EV_SOC = 0;
|
|
||||||
$den = 2 * $underKWh;
|
|
||||||
$SDL_SOC = ($den > 0) ? ($real_kWh * 100 / $den) : 0.0;
|
|
||||||
$sdlDisKW = $sdlShareKW; // SDL-
|
|
||||||
$evDisKW = 0; // EV-
|
|
||||||
$sdlChKW = $sdlShareKW; // SDL+
|
|
||||||
$evChKW = $evShareKW; //EV+
|
|
||||||
// Reale kWh für EV und SDl
|
|
||||||
$real_kWh_ev = 0;
|
|
||||||
$real_kWh_sdl = $real_kWh;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Null SoC für sdl Power abdecken
|
|
||||||
if ($real_kWh <= 0) {
|
|
||||||
$sdlDisKW = 0;
|
|
||||||
// Reale kWh für EV und SDl
|
|
||||||
$real_kWh_ev = 0;
|
|
||||||
$real_kWh_sdl = 0;
|
|
||||||
} elseif ($real_kWh >= $capKWh) {
|
|
||||||
$sdlChKW = 0;
|
|
||||||
// Reale kWh für EV und SDl
|
|
||||||
$real_kWh_ev = $capKWh - 2* $underKWh;
|
|
||||||
$real_kWh_sdl = 2 * $underKWh ;
|
|
||||||
}
|
|
||||||
|
|
||||||
$totalCapKWh += $capKWh;
|
$totalCapKWh += $capKWh;
|
||||||
// Berechnungen für Leistungen laden und entladen gesamt haft
|
|
||||||
$sdlDisKW_ges += $sdlDisKW;
|
|
||||||
$evDisKW_ges += $evDisKW;
|
|
||||||
$sdlChKW_ges += $sdlChKW;
|
|
||||||
$evChKW_ges += $evChKW;
|
|
||||||
|
|
||||||
$real_kWh_ev_ges += $real_kWh_ev;
|
// SDL/EV Power Verteilung (proportional nach Leistung)
|
||||||
$real_kWh_sdl_ges += $real_kWh_sdl ;
|
$sdlShareKW = ($sumBatPowerkW > 0.0) ? ($sdlTotalkW / $sumBatPowerkW * $pBatkW) : 0.0;
|
||||||
|
if ($sdlShareKW < 0.0) $sdlShareKW = 0.0;
|
||||||
|
if ($sdlShareKW > $pBatkW) $sdlShareKW = $pBatkW;
|
||||||
|
|
||||||
// gesamte kWh über alle Batterien für EV und SDL berechnet
|
$evShareKW = max(0.0, $pBatkW - $sdlShareKW);
|
||||||
$SDL_kWh_ges += $SDL_kWh; //SDL kWh geamt
|
|
||||||
$EV_kW_ges += $EV_kWH; // EV kWh
|
|
||||||
//--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// von mir angepasst
|
// Grenzen / Zonen
|
||||||
|
$underKWh = $sdlShareKW * $hours; // SDL Reserve für 30min
|
||||||
|
$upKWh = $capKWh - $underKWh; // obere Grenze (deine Definition)
|
||||||
|
|
||||||
|
$SDL_kWh = 2.0 * $underKWh; // SDL-Zonenbreite
|
||||||
|
$EV_kWh = $capKWh - 2.0 * $underKWh; // EV-Zonenbreite
|
||||||
|
if ($EV_kWh < 0.0) $EV_kWh = 0.0;
|
||||||
|
|
||||||
|
$real_kWh = $capKWh * ($socPct / 100.0); // aktueller Inhalt
|
||||||
|
|
||||||
|
// Zonenlogik
|
||||||
|
if ($real_kWh <= $underKWh) {
|
||||||
|
// untere Zone: EV = 0
|
||||||
|
$EV_SOC = 0.0;
|
||||||
|
$den = 2.0 * $underKWh;
|
||||||
|
$SDL_SOC = ($den > 0.0) ? ($real_kWh * 100.0 / $den) : 0.0;
|
||||||
|
|
||||||
|
$sdlDisKW = $sdlShareKW;
|
||||||
|
$evDisKW = 0.0;
|
||||||
|
|
||||||
|
$sdlChKW = $sdlShareKW;
|
||||||
|
$evChKW = $evShareKW;
|
||||||
|
|
||||||
|
$real_kWh_ev = 0.0;
|
||||||
|
$real_kWh_sdl = $real_kWh;
|
||||||
|
} elseif ($real_kWh < $upKWh) {
|
||||||
|
// mittlere Zone: SDL fix 50, EV wächst
|
||||||
|
$SDL_SOC = 50.0;
|
||||||
|
|
||||||
|
// EV_SOC bezogen auf EV_kWh (wenn du lieber capKWh willst: / $capKWh)
|
||||||
|
$EV_SOC = ($EV_kWh > 0.0) ? (($real_kWh - $underKWh) * 100.0 / $EV_kWh) : 0.0;
|
||||||
|
if ($EV_SOC < 0.0) $EV_SOC = 0.0;
|
||||||
|
if ($EV_SOC > 100.0) $EV_SOC = 100.0;
|
||||||
|
|
||||||
|
$sdlDisKW = $sdlShareKW;
|
||||||
|
$evDisKW = $evShareKW;
|
||||||
|
|
||||||
|
$sdlChKW = $sdlShareKW;
|
||||||
|
$evChKW = $evShareKW;
|
||||||
|
|
||||||
|
$real_kWh_ev = $real_kWh - $underKWh;
|
||||||
|
$real_kWh_sdl = $underKWh;
|
||||||
|
} else {
|
||||||
|
// obere Zone: EV voll, SDL wächst
|
||||||
|
$EV_SOC = 100.0;
|
||||||
|
|
||||||
|
$SDL_SOC = ($underKWh > 0.0)
|
||||||
|
? (50.0 + (($real_kWh - $upKWh) * 50.0 / $underKWh))
|
||||||
|
: 100.0;
|
||||||
|
|
||||||
|
if ($SDL_SOC < 0.0) $SDL_SOC = 0.0;
|
||||||
|
if ($SDL_SOC > 100.0) $SDL_SOC = 100.0;
|
||||||
|
|
||||||
|
$sdlDisKW = $sdlShareKW;
|
||||||
|
$evDisKW = $evShareKW;
|
||||||
|
|
||||||
|
$sdlChKW = $sdlShareKW;
|
||||||
|
$evChKW = 0.0;
|
||||||
|
|
||||||
|
$real_kWh_ev = max(0.0, $real_kWh - 2.0*$underKWh);
|
||||||
|
$real_kWh_sdl = min($SDL_kWh, $real_kWh);
|
||||||
|
}
|
||||||
|
|
||||||
|
// leer/voll Sicherheitskorrektur
|
||||||
|
if ($real_kWh <= 0.000001) {
|
||||||
|
$sdlDisKW = 0.0;
|
||||||
|
$evDisKW = 0.0;
|
||||||
|
$real_kWh_ev = 0.0;
|
||||||
|
$real_kWh_sdl = 0.0;
|
||||||
|
$EV_SOC = 0.0;
|
||||||
|
$SDL_SOC = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($capKWh > 0.0 && $real_kWh >= $capKWh - 0.000001) {
|
||||||
|
$sdlChKW = 0.0;
|
||||||
|
$evChKW = 0.0;
|
||||||
|
|
||||||
|
$real_kWh_ev = $EV_kWh;
|
||||||
|
$real_kWh_sdl = $SDL_kWh;
|
||||||
|
$EV_SOC = 100.0;
|
||||||
|
$SDL_SOC = 100.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Totals
|
||||||
|
$pSDLmaxKW_ges += $sdlShareKW;
|
||||||
|
$pEVmaxKW_ges += $evShareKW;
|
||||||
|
|
||||||
|
$sdlDisKW_ges += $sdlDisKW;
|
||||||
|
$evDisKW_ges += $evDisKW;
|
||||||
|
$sdlChKW_ges += $sdlChKW;
|
||||||
|
$evChKW_ges += $evChKW;
|
||||||
|
|
||||||
|
$real_kWh_ev_ges += $real_kWh_ev;
|
||||||
|
$real_kWh_sdl_ges += $real_kWh_sdl;
|
||||||
|
|
||||||
|
$SDL_kWh_ges += $SDL_kWh;
|
||||||
|
$EV_kWh_ges += $EV_kWh;
|
||||||
|
|
||||||
|
// Debug pro Batterie
|
||||||
$calc["batteries"][] = [
|
$calc["batteries"][] = [
|
||||||
"idx" => $idx,
|
"idx" => $idx,
|
||||||
"typ" => (string)($b["typ"] ?? ("Bat " . ($idx + 1))),
|
"typ" => (string)($b["typ"] ?? ("Bat " . ($idx + 1))),
|
||||||
|
|
||||||
"P_bat_W" => round($pBatW, 0),
|
"P_bat_W" => round($pBatW, 0),
|
||||||
"Cap_kWh" => round($capKWh, 3),
|
"Cap_kWh" => round($capKWh, 3),
|
||||||
|
|
||||||
"SoC_varId" => $socVarId,
|
"SoC_varId" => $socVarId,
|
||||||
"SoC_pct" => round($socPct, 3),
|
"SoC_pct" => round($socPct, 3),
|
||||||
|
|
||||||
|
|
||||||
"EV_SOC"=> round($EV_SOC, 3),
|
"real_kWh" => round($real_kWh, 3),
|
||||||
"SDL_SOC"=> round($SDL_SOC, 3),
|
|
||||||
|
|
||||||
"EV_kWh"=> round($real_kWh_ev, 3),
|
|
||||||
"SDL_kWh"=> round($real_kWh_sdl, 3),
|
|
||||||
|
|
||||||
"SDL_Power_kW" => round($sdlShareKW, 3),
|
"SDL_Power_kW" => round($sdlShareKW, 3),
|
||||||
"EV_Power_kW" => round($evShareKW, 3),
|
"EV_Power_kW" => round($evShareKW, 3),
|
||||||
@@ -242,6 +267,15 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
"under_grenze_kWh" => round($underKWh, 3),
|
"under_grenze_kWh" => round($underKWh, 3),
|
||||||
"up_grenze_kWh" => round($upKWh, 3),
|
"up_grenze_kWh" => round($upKWh, 3),
|
||||||
|
|
||||||
|
"SDL_kWh_zone" => round($SDL_kWh, 3),
|
||||||
|
"EV_kWh_zone" => round($EV_kWh, 3),
|
||||||
|
|
||||||
|
"SDL_SOC" => round($SDL_SOC, 3),
|
||||||
|
"EV_SOC" => round($EV_SOC, 3),
|
||||||
|
|
||||||
|
"SDL_kWh" => round($real_kWh_sdl, 3),
|
||||||
|
"EV_kWh" => round($real_kWh_ev, 3),
|
||||||
|
|
||||||
"SDL_Charge_kW" => round($sdlChKW, 3),
|
"SDL_Charge_kW" => round($sdlChKW, 3),
|
||||||
"SDL_Discharge_kW" => round($sdlDisKW, 3),
|
"SDL_Discharge_kW" => round($sdlDisKW, 3),
|
||||||
|
|
||||||
@@ -250,29 +284,32 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prozentwerte nach deinem Ansatz (Division absichern!)
|
||||||
|
$evPosPct = ($EV_kWh_ges > 0.000001) ? ($real_kWh_ev_ges * 100.0 / $EV_kWh_ges) : 0.0;
|
||||||
|
$sdlPosPct = ($SDL_kWh_ges > 0.000001) ? ($real_kWh_sdl_ges * 100.0 / $SDL_kWh_ges) : 0.0;
|
||||||
|
|
||||||
|
|
||||||
$evPosPct = $real_kWh_ev_ges/ $EV_kWh_ges *100 ;
|
|
||||||
$sdlPosPct = $real_kWh_sdl_ges/ $SDL_kWh_ges *100 ;
|
|
||||||
// Variablen setzen
|
// Variablen setzen
|
||||||
$this->SetIdentValue("SDL_Pos", round($sdlPosPct, 3));
|
$this->SetIdentValue("SDL_Pos", round($sdlPosPct, 3));
|
||||||
$this->SetIdentValue("SoC_EV", round($evPosPct, 3));
|
$this->SetIdentValue("SoC_EV", round($evPosPct, 3));
|
||||||
|
|
||||||
// W-Variablen
|
// Leistungsvariablen (in W)
|
||||||
|
$this->SetIdentValue("P_SDL_max", round($pSDLmaxKW_ges * 1000.0, 0));
|
||||||
$this->SetIdentValue("P_SDL_laden", round($sdlChKW_ges * 1000.0, 0));
|
$this->SetIdentValue("P_SDL_laden", round($sdlChKW_ges * 1000.0, 0));
|
||||||
$this->SetIdentValue("P_SDL_entladen", round($sdlDisKW_ges * 1000.0, 0));
|
$this->SetIdentValue("P_SDL_entladen", round($sdlDisKW_ges * 1000.0, 0));
|
||||||
|
|
||||||
|
$this->SetIdentValue("P_EV_max", round($pEVmaxKW_ges * 1000.0, 0));
|
||||||
$this->SetIdentValue("P_EV_laden", round($evChKW_ges * 1000.0, 0));
|
$this->SetIdentValue("P_EV_laden", round($evChKW_ges * 1000.0, 0));
|
||||||
$this->SetIdentValue("P_EV_entladen", round($evDisKW_ges * 1000.0, 0));
|
$this->SetIdentValue("P_EV_entladen", round($evDisKW_ges * 1000.0, 0));
|
||||||
|
|
||||||
$calc["total"] = [
|
$calc["total"] = [
|
||||||
"SDL_SoC_pct" => round($sdlPosPct, 3),
|
"SDL_SoC_pct" => round($sdlPosPct, 3),
|
||||||
"EV_SoC_pct" => round($evPosPct, 3),
|
"EV_SoC_pct" => round($evPosPct, 3),
|
||||||
|
|
||||||
"SDL_kWh_pct" => round($SDL_kWh_ges, 3),
|
"SDL_kWh_total" => round($real_kWh_sdl_ges, 3),
|
||||||
"EV_kWh_pct" => round($EV_kWh_ges, 3),
|
"EV_kWh_total" => round($real_kWh_ev_ges, 3),
|
||||||
|
|
||||||
|
"SDL_kWh_zone_total" => round($SDL_kWh_ges, 3),
|
||||||
|
"EV_kWh_zone_total" => round($EV_kWh_ges, 3),
|
||||||
|
|
||||||
"SDL_Charge_kW" => round($sdlChKW_ges, 3),
|
"SDL_Charge_kW" => round($sdlChKW_ges, 3),
|
||||||
"SDL_Discharge_kW" => round($sdlDisKW_ges, 3),
|
"SDL_Discharge_kW" => round($sdlDisKW_ges, 3),
|
||||||
@@ -280,8 +317,10 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
"EV_Charge_kW" => round($evChKW_ges, 3),
|
"EV_Charge_kW" => round($evChKW_ges, 3),
|
||||||
"EV_Discharge_kW" => round($evDisKW_ges, 3),
|
"EV_Discharge_kW" => round($evDisKW_ges, 3),
|
||||||
|
|
||||||
"totalCap_kWh" => round($totalCapKWh, 3)
|
"P_SDL_max_kW" => round($pSDLmaxKW_ges, 3),
|
||||||
|
"P_EV_max_kW" => round($pEVmaxKW_ges, 3),
|
||||||
|
|
||||||
|
"totalCap_kWh" => round($totalCapKWh, 3)
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->SetIdentValue("CalcJSON", json_encode($calc, JSON_PRETTY_PRINT));
|
$this->SetIdentValue("CalcJSON", json_encode($calc, JSON_PRETTY_PRINT));
|
||||||
@@ -333,7 +372,7 @@ class Bat_EV_SDL extends IPSModule
|
|||||||
|
|
||||||
$soc = (float)$v;
|
$soc = (float)$v;
|
||||||
|
|
||||||
// 0..1 -> 0..100
|
// 0..1 -> 0..100 (Achtung: wenn dein Sensor 1 = 1% liefert, muss das raus!)
|
||||||
if ($soc >= 0.0 && $soc <= 1.0) {
|
if ($soc >= 0.0 && $soc <= 1.0) {
|
||||||
$soc *= 100.0;
|
$soc *= 100.0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user