From 746b13ad600f97ebd0aebde7ac9737a49eafb59f Mon Sep 17 00:00:00 2001 From: DS_Starter Date: Tue, 20 May 2025 08:43:56 +0000 Subject: [PATCH] 76_SolarForecast.pm: contrib 1.52.4 git-svn-id: https://svn.fhem.de/fhem/trunk@29982 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 4bc5996fc..065dc7ce3 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -160,8 +160,9 @@ BEGIN { # Versions History intern my %vNotesIntern = ( - "1.52.4" => "19.05.2025 commandref edited, setupInverterDevXX: change pv to pvOut, new key pvIn ". - "fix devision by zero -Forum: https://forum.fhem.de/index.php?msg=1341884, __calcFcQuality: minor code change ", + "1.52.4" => "20.05.2025 commandref edited, setupInverterDevXX: change pv to pvOut, new key pvIn ". + "fix devision by zero -Forum: https://forum.fhem.de/index.php?msg=1341884, __calcFcQuality: minor code change ". + "ctrlSpecialReadings: new Topic BatWeightedTotalSOC ", "1.52.3" => "17.05.2025 _transferInverterValues: new property itype, graphicControl: new keys beamPaddingBottom, beamPaddingTop ". " setter attrKeyVal has dorp down list of all composite attributes ", "1.52.2" => "14.05.2025 _flowGraphic: Discharge the battery directly into the household grid if no battery inverter is defined ". @@ -1401,6 +1402,7 @@ my %hcsr = ( todayConsumptionForecastDay => { fnr => 4, fn => \&HistoryVal, par => 99, par1 => 'confc', unit => ' Wh', def => '-' }, BatPowerIn_Sum => { fnr => 5, fn => \&CurrentVal, par => 'batpowerinsum', par1 => '', unit => ' W', def => '-' }, BatPowerOut_Sum => { fnr => 5, fn => \&CurrentVal, par => 'batpoweroutsum', par1 => '', unit => ' W', def => '-' }, + BatWeightedTotalSOC => { fnr => 2, fn => \&CurrentVal, par => 'batsoctotal', par1 => '', unit => ' Wh', def => 0 }, SunHours_Remain => { fnr => 5, fn => \&CurrentVal, par => '', par1 => '', unit => '', def => 0 }, # fnr => 3 -> Custom Calc SunMinutes_Remain => { fnr => 5, fn => \&CurrentVal, par => '', par1 => '', unit => '', def => 0 }, dayAfterTomorrowPVforecast => { fnr => 5, fn => \&RadiationAPIVal, par => 'pv_estimate50', par1 => '', unit => '', def => 0 }, @@ -14007,10 +14009,8 @@ sub __calcNewFactor_migrated { } } else { - #$pvrl = sprintf "%.0f", medianArray (\@{$data{$name}{circular}{$hh}{'pvrl_'.$sabin}{"$crang"}}); # neuen Median berechnen - #$pvfc = sprintf "%.0f", medianArray (\@{$data{$name}{circular}{$hh}{'pvfc_'.$sabin}{"$crang"}}); # neuen Median berechnen - $pvrl = medianArray (\@{$data{$name}{circular}{$hh}{'pvrl_'.$sabin}{"$crang"}}); # neuen Median berechnen - $pvfc = medianArray (\@{$data{$name}{circular}{$hh}{'pvfc_'.$sabin}{"$crang"}}); # neuen Median berechnen + $pvrl = medianArray (\@{$data{$name}{circular}{$hh}{'pvrl_'.$sabin}{"$crang"}}); # neuen Median berechnen + $pvfc = medianArray (\@{$data{$name}{circular}{$hh}{'pvfc_'.$sabin}{"$crang"}}); # neuen Median berechnen $factor = 0; $dnum = scalar (@{$data{$name}{circular}{$hh}{'pvrl_'.$sabin}{"$crang"}}); @@ -14034,8 +14034,6 @@ sub __calcNewFactor_migrated { ## Qualität berechnen ####################### $oldfac = sprintf "%.2f", $oldfac; - #$pvrl = sprintf "%.0f", $pvrl; - #$pvfc = sprintf "%.0f", $pvfc; my $qual = __calcFcQuality ($pvfc, $pvrl); # Qualität der Vorhersage für die vergangene Stunde debugLog ($paref, 'pvCorrectionWrite', "$calc Corrf -> determined values - hour: $hh, Sun Altitude range: $sabin, Cloud range: $crang, old factor: $oldfac, new factor: $factor, days: $dnum"); @@ -17113,7 +17111,7 @@ sub _flowGraphic { $batout += $batoutpow if(defined $batoutpow); } - my $soc = CurrentVal ($name, 'batsoctotal', 0); # resultierender SoC (%) aller Batterien als Cluster + my $soc = __normDecPlaces (CurrentVal ($name, 'batsoctotal', 0)); # resultierender SoC (%) aller Batterien als Cluster if (!defined $batin && !defined $batout) { $hasbat = 0; @@ -25637,7 +25635,8 @@ to ensure that the system configuration is correct. BatPowerIn_Sum the sum of the current battery charging power of all defined battery devices BatPowerOut_Sum the sum of the current battery discharge power of all defined battery devices - allStringsFullfilled Fulfillment status of error-free generation of all strings + BatWeightedTotalSOC the resulting (weighted) SOC across all installed batteries + allStringsFullfilled Fulfillment status of error-free generation of all strings conForecastTillNextSunrise Consumption forecast from current hour to the coming sunrise currentAPIinterval the current polling interval of the selected radiation data API in seconds currentRunMtsConsumer_XX the running time (minutes) of the consumer "XX" since the last switch-on. (last running cycle) @@ -28243,6 +28242,7 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden. BatPowerIn_Sum die Summe der momentanen Batterieladeleistung aller definierten Batterie Geräte BatPowerOut_Sum die Summe der momentanen Batterieentladeleistung aller definierten Batterie Geräte + BatWeightedTotalSOC der resultierende (gewichtete) SOC über alle installierten Batterien allStringsFullfilled Erfüllungsstatus der fehlerfreien Generierung aller Strings conForecastTillNextSunrise Verbrauchsprognose von aktueller Stunde bis zum kommenden Sonnenaufgang currentAPIinterval das aktuelle Abrufintervall der gewählten Strahlungsdaten-API in Sekunden