feat(workflow): publish verified forecast controls and consolidated docs
Tests / test (push) Successful in 1m1s
Tests / test (push) Successful in 1m1s
Approved by Daniel Haefliger for develop and beta. Author dh_Agent, authenticated account dh. Preserve published battery, charging and overall Energy Pie changes. No deployment or plant control authorization.
This commit is contained in:
@@ -40,7 +40,7 @@ trait ManagerNetzfahrplanV4Trait
|
||||
foreach (['Netzleistungsfaktor', 'Lastspitzengrenze', 'Einspeisegrenze'] as $key) {
|
||||
$manager[$key] = $this->ReadPropertyFloat($key);
|
||||
}
|
||||
$manager['V4ControlPlanSource'] = $this->leseJsonAttribut('Netzfahrplan')['sourceModel'] ?? 'legacy-unspecified';
|
||||
$manager['V4ControlPlanSource'] = 'netplan-v4';
|
||||
$manager['EinspeisebegrenzungAktiv'] = $this->ReadPropertyBoolean('EinspeisebegrenzungAktiv');
|
||||
$manager['NetzladenErlaubt'] = $this->ReadPropertyBoolean('NetzfahrplanV4NetzladenErlaubt');
|
||||
$manager['Monatsgrenzen'] = json_decode($this->ReadPropertyString('Monatsgrenzen'), true, 512, JSON_THROW_ON_ERROR);
|
||||
@@ -48,6 +48,20 @@ trait ManagerNetzfahrplanV4Trait
|
||||
$manager['V4BezugszaehlerQuellen'] = json_decode(
|
||||
$this->ReadPropertyString('NetzfahrplanV4BezugszaehlerQuellen'), true, 512, JSON_THROW_ON_ERROR
|
||||
);
|
||||
if ($manager['V4BezugszaehlerQuellen'] === [] && $this->ReadPropertyInteger('NetzbezugEnergieVariableID') > 0) {
|
||||
$meterID = $this->ReadPropertyInteger('NetzbezugEnergieVariableID');
|
||||
if (!IPS_VariableExists($meterID)) throw new RuntimeException('Wirkenergie-Bezugszaehler fehlt.');
|
||||
$meterObject = IPS_GetObject($meterID);
|
||||
if (!IPS_InstanceExists($meterObject['ParentID'])
|
||||
|| !in_array(IPS_GetInstance($meterObject['ParentID'])['ModuleInfo']['ModuleID'],
|
||||
[NetzfahrplanV4Geraeteabruf::MBUS_DEVICE, NetzfahrplanV4Geraeteabruf::MODBUS_DEVICE,
|
||||
NetzfahrplanV4Geraeteabruf::MODBUS_ADDRESS], true)) {
|
||||
throw new RuntimeException('Wirkenergie-Bezugszaehler benoetigt eine direkte physische Messquelle.');
|
||||
}
|
||||
$manager['V4BezugszaehlerQuellen'] = [['VariableID' => $meterID,
|
||||
'ElternID' => $meterObject['ParentID'], 'Ident' => $meterObject['ObjectIdent'],
|
||||
'FaktorZuKWh' => $this->ReadPropertyFloat('NetzbezugEnergiefaktor'), 'Messgroesse' => 'WirkenergieBezug']];
|
||||
}
|
||||
$assets = json_decode($this->ReadPropertyString('AnlagenBatterien'), true, 512, JSON_THROW_ON_ERROR);
|
||||
$cache = $this->leseJsonAttribut('VerbraucherCache');
|
||||
$controllers = [];
|
||||
@@ -64,11 +78,15 @@ trait ManagerNetzfahrplanV4Trait
|
||||
$entry = $cache[(string) $id] ?? [];
|
||||
$c['EmpfangenAm'] = $entry['EmpfangenAm'] ?? 0;
|
||||
$c['Verfuegbar'] = $entry['Daten']['Verfuegbar'] ?? false;
|
||||
if (function_exists('ENELIX_GetV4BatterieRueckmeldung')) {
|
||||
if (function_exists('ENELIX_GetV4BatterieRueckmeldungCache')) {
|
||||
$configured = IPS_GetProperty($id, 'NetzfahrplanV4RueckmeldungKonfiguration');
|
||||
if (in_array(trim((string) $configured), ['', '{}'], true)
|
||||
&& method_exists($this, 'GetV4RueckmeldungKonfiguration')) {
|
||||
$configured = $this->GetV4RueckmeldungKonfiguration($id);
|
||||
}
|
||||
if (is_string($configured) && !in_array(trim($configured), ['', '{}'], true)) {
|
||||
try {
|
||||
$feedback = json_decode(ENELIX_GetV4BatterieRueckmeldung($id), true, 32, JSON_THROW_ON_ERROR);
|
||||
$feedback = json_decode(ENELIX_GetV4BatterieRueckmeldungCache($id), true, 32, JSON_THROW_ON_ERROR);
|
||||
$checkedAt = $feedback['checkedAt'] ?? null;
|
||||
if (($feedback['usableForTrial'] ?? false) === true
|
||||
&& ($feedback['deviceReadConfirmed'] ?? false) === true
|
||||
@@ -128,7 +146,7 @@ trait ManagerNetzfahrplanV4Trait
|
||||
|
||||
private function sendeNetzfahrplanV4(): void
|
||||
{
|
||||
if (!$this->ReadPropertyBoolean('NetzfahrplanV4SchattenAktiv')) {
|
||||
if (!$this->prognoseLernenAktiv()) {
|
||||
$this->WriteAttributeString('NetzfahrplanV4Sendestatus', '{"status":"disabled"}');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user