no message

This commit is contained in:
belevo\mh
2026-01-26 14:56:00 +01:00
parent ef49957d7f
commit 9f22ae0aa7
2 changed files with 19 additions and 14 deletions

View File

@@ -102,14 +102,8 @@
},
{
"type": "NumberSpinner",
"name": "SDL_Lade_Leistung",
"caption": "SDL_Lade_Leistung",
"suffix": "W"
},
{
"type": "NumberSpinner",
"name": "SDL_Entlade_Leistung",
"caption": "SDL_Entlade_Leistung",
"name": "SDL_Leistung",
"caption": "SDL_Leistung",
"suffix": "W"
},
{

View File

@@ -8,8 +8,7 @@ class Bat_EV_SDL extends IPSModule
// Properties
$this->RegisterPropertyString("Batteries", "[]");
$this->RegisterPropertyInteger("SDL_Lade_Leistung", 0);
$this->RegisterPropertyInteger("SDL_Entlade_Leistung", 0); // W
$this->RegisterPropertyInteger("SDL_Leistung", 0); // W
$this->RegisterPropertyInteger("UpdateInterval", 5); // Minuten
// Status
@@ -70,13 +69,17 @@ class Bat_EV_SDL extends IPSModule
$batteries = [];
}
<<<<<<< HEAD
//--------------------------------------------------
/*
=======
>>>>>>> parent of 2eab6b6 (no message)
$sdlTotalW = (float)$this->ReadPropertyInteger("SDL_Leistung"); // W
if ($sdlTotalW < 0) $sdlTotalW = 0;
$sdlTotalkW = $sdlTotalW / 1000.0;
<<<<<<< HEAD
"""
*/
@@ -108,6 +111,8 @@ class Bat_EV_SDL extends IPSModule
}
//---------------------------------------------
=======
>>>>>>> parent of 2eab6b6 (no message)
// 30 Minuten Fenster
$hours = 0.5;
@@ -128,8 +133,7 @@ class Bat_EV_SDL extends IPSModule
$calc = [
"inputs" => [
"SDL_Entlade_Leistung_W" => round($sdlTotalEntladeW, 0),
"SDL_Lade_Leistung_W" => round($sdlTotalLadeW, 0),
"SDL_Leistung_W" => round($sdlTotalW, 0),
"SumBatPower_W" => round($sumBatPowerW, 0),
"hours" => $hours
],
@@ -187,13 +191,15 @@ class Bat_EV_SDL extends IPSModule
continue;
}
// Deine Logik: SDL/EV Aufteilung über Leistungsanteil
$sdlShareKW = ($sumBatPowerkW > 0.0) ? ($sdlTotalkW / $sumBatPowerkW * $pBatkW) : 0.0;
$evShareKW = $pBatkW - $sdlShareKW;
// untere Grenze für SDL (wichtig: zuerst setzen, dann clamp)
$underKWh = $sdlShareKW * $hours;
$underKWh = max(0.0, min($underKWh, $capKWh / 2.0));
<<<<<<< HEAD
if ($mode == 'charge') {
$ver = $sdlTotalLadekW / $sdlTotalEntladekW;
$underKWh = ($sdlShareKW * $hours) / $ver;
@@ -221,6 +227,11 @@ class Bat_EV_SDL extends IPSModule
=======
$upKWh = $capKWh - $underKWh;
$SDL_kWh = 2.0 * $underKWh;
$EV_kWH = max(0.0, $capKWh - $SDL_kWh);
>>>>>>> parent of 2eab6b6 (no message)
$real_kWh = $capKWh / 100.0 * $socPct;