feat(manager): use overall Energy Pie balance with SDL
Tests / test (push) Successful in 1m3s

This commit is contained in:
dh
2026-10-08 09:40:14 +00:00
parent 86834bb8aa
commit af69151165
4 changed files with 82 additions and 2 deletions
+14 -2
View File
@@ -297,9 +297,21 @@ trait ManagerEnergieTrait
private function synchronisiereEnergyPieAnteile(int $instanzID, bool $anwenden = true): void
{
// Physischer Netzbezug enthaelt SDL, die Hausenergie dagegen nicht.
$berechenbar = !$this->ReadPropertyBoolean('SDLAktiv');
$konfiguration = json_decode(IPS_GetConfiguration($instanzID), true, 512, JSON_THROW_ON_ERROR);
if (is_array($konfiguration) && array_key_exists('Gesamtbilanz', $konfiguration)) {
// Physical grid counters already include SDL; Utils derives the complete site balance.
IPS_SetHidden($instanzID, false);
if (IPS_GetProperty($instanzID, 'Gesamtbilanz') !== true) {
IPS_SetProperty($instanzID, 'Gesamtbilanz', true);
if ($anwenden) {
IPS_ApplyChanges($instanzID);
}
}
return;
}
// Compatibility until Utils is updated: do not enable the old mixed-boundary calculation.
$berechenbar = !$this->ReadPropertyBoolean('SDLAktiv');
if (!is_array($konfiguration) || !array_key_exists('EnergieanteileBerechenbar', $konfiguration)) {
IPS_SetHidden($instanzID, !$berechenbar);
if (!$berechenbar) {