diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm
index 0a1b8ca9e..731dd5bb6 100644
--- a/fhem/contrib/DS_Starter/76_SolarForecast.pm
+++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm
@@ -160,12 +160,12 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
- "1.59.6" => "20.10.2025 ___ownSpecGetFWwidget: handling of line breaks in attributes & can hamdle a key=value pair separateley ".
+ "1.59.6" => "24.10.2025 ___ownSpecGetFWwidget: handling of line breaks in attributes & can hamdle a key=value pair separateley ".
"Width of a text field in graphicHeaderOwnspec fixed to 10, edit commandref ".
"__batChargeOptTargetPower: use an average for the charging power if optPower set and charging target are not achievable ".
"__createOwnSpec: an empty field can be created within a line by simply using a colon (:). ".
- "add new key pvshare to CustomerXX attributes -> __setConsRcmdState add pvshare calculation ".
- "___doPlanning: code improvements ",
+ "add new key pvshare to CustomerXX attributes -> __setConsRcmdState add PV share calculation ".
+ "___doPlanning: code improvements and implement PV share needed ",
"1.59.5" => "15.10.2025 new sub ___batAdjustPowerByMargin: implement optPower Safety margin decreasing proportionally to the linear surplus ".
"new Reading Battery_TargetAchievable_XX, _batSocTarget: minor code change ",
"1.59.4" => "14.10.2025 new subs, ctrlBatSocManagementXX: new key loadTarget, replace __batCapShareFactor by __batDeficitShareFactor ".
@@ -12150,7 +12150,6 @@ sub __batChargeOptTargetPower {
my $replacement = sprintf "%.0f", ($spls00 / 60 * (60 - int $minute)); # aktuelle (Rest)-Stunde -> zeitgewichteter PV-Überschuß
$replacement .= '.'.$2;
$hsurp->{$k}{surplswh} = $replacement;
- #Log3 ($name, 1, "$name - spls00: $spls00, replacement: $replacement ");
}
last; # da Stunde 00 nur einmal vorkommt, können wir abbrechen
@@ -12272,20 +12271,13 @@ sub __batChargeOptTargetPower {
$target = ___batAdjustPowerByMargin ($name, $target, $bpinmax, $runwhneed, $otpMargin);
}
}
- else { # Tagesziel nicht erreichbar: Aufschlag potenziert (zweifach wirksam)
- #$hs2sunset -= 1;
-#Log3 ($name, 1, "$name - target0: $target");
- #$target = $runwhneed > 0 && $hs2sunset > 0 ? $runwhneed / $hs2sunset : $target;
-#Log3 ($name, 1, "$name - runwhneed: $runwhneed, hs2sunset: $hs2sunset, target: $target");
- #$target *= (1 + $otpMargin / 100) ** 2;
-#Log3 ($name, 1, "$name - target1: $target");
- if ($strategy eq 'smartPower') { # smartPower: maximale Ladeleistung erzwingen
- #$target = $bpinmax;
+ else { # Tagesziel nicht erreichbar: Aufschlag potenziert (zweifach wirksam)
+ if ($strategy eq 'smartPower') { # smartPower: agressivere Ladeleistung
$hs2sunset -= 1;
$target = $runwhneed > 0 && $hs2sunset > 0 ? $runwhneed / $hs2sunset : $target;
}
- $target *= (1 + $otpMargin / 100) ** 2;
+ $target *= (1 + $otpMargin / 100) ** 2;
}
my $gfeedin = CurrentVal ($name, 'gridfeedin', 0); # aktuelle Netzeinspeisung
@@ -13343,7 +13335,6 @@ sub ___doPlanning {
my $debug = $paref->{debug};
my $lang = $paref->{lang};
my $nh = $data{$name}{nexthours};
- my $cicfip = CurrentVal ($name, 'consForecastInPlanning', 0); # soll Consumption Vorhersage in die Überschußermittlung eingehen ?
my $hash = $defs{$name};
@@ -13354,9 +13345,12 @@ sub ___doPlanning {
return;
}
- debugLog ($paref, "consumerPlanning", qq{consumer "$c" - consider consumption forecast in consumer planning (attr 'plantControl'): }.($cicfip ? 'yes' : 'no'));
-
+ my $cicfip = CurrentVal ($name, 'consForecastInPlanning', 0); # soll Consumption Vorhersage in die Überschußermittlung eingehen ?
+ my $pvshare = ConsumerVal ($name, $c, 'pvshare', 100); # Soll-Anteil PV-Energie an nompower: 100 - nur PV, 0 - kann mit vollem Netzstrom betrieben werden
+ my $shfactor = $pvshare / 100;
my (%tmp, %max, %mtimes);
+
+ debugLog ($paref, "consumerPlanning", qq{consumer "$c" - consider consumption forecast in consumer planning (attr 'plantControl'): }.($cicfip ? 'yes' : 'no'));
## max. PV-Forecast bzw. Überschuß (bei gesetzen consForecastInPlanning) ermitteln
####################################################################################
@@ -13364,7 +13358,7 @@ sub ___doPlanning {
my $pvfc = NexthoursVal ($name, $idx, 'pvfc', 0);
my $confcex = NexthoursVal ($name, $idx, 'confcEx', 0); # prognostizierter Verbrauch ohne registrierte Consumer mit gesetzten Schlüssel exconfc
- my $spexp = $pvfc - ($cicfip ? $confcex : 0); # prognostizierter Energieüberschuß (kann negativ sein)
+ my $spexp = $pvfc - ($cicfip ? $confcex : 0); # prognostizierte Leistung -> Überschuß oder negativ
my ($hour) = $idx =~ /NextHour(\d+)/xs;
$tmp{$spexp}{starttime} = NexthoursVal ($name, $idx, 'starttime', '');
@@ -13393,7 +13387,7 @@ sub ___doPlanning {
my $epiece1 = $data{$name}{consumers}{$c}{epieces}{1};
- debugLog ($paref, "consumerPlanning", qq{consumer "$c" - first energy piece: $epiece1});
+ debugLog ($paref, "consumerPlanning", qq{consumer "$c" - first energy piece: $epiece1, PV share needed: $pvshare %, energy piece share: }.$epiece1 * $shfactor);
my $mode = getConsumerPlanningMode ($hash, $c); # Planungsmode 'can' oder 'must'
my $calias = ConsumerVal ($name, $c, 'alias', '');
@@ -13428,7 +13422,7 @@ sub ___doPlanning {
}
for my $ts (sort{$a<=>$b} keys %mtimes) {
- if ($mtimes{$ts}{spexp} >= $epiece1) { # die früheste Startzeit sofern Überschuß größer als Bedarf
+ if ($mtimes{$ts}{spexp} >= $epiece1 * $shfactor) { # die früheste Startzeit mit Leistung > als Bedarf
my $starttime = $mtimes{$ts}{starttime};
$paref->{starttime} = $starttime;
$starttime = ___switchonTimelimits ($paref);
@@ -13493,6 +13487,10 @@ sub ___doPlanning {
delete $paref->{supplement};
}
}
+
+ delete $paref->{maxref};
+ delete $paref->{mintime};
+ delete $paref->{stopdiff};
my $planstate = ConsumerVal ($name, $c, 'planstate', '');
my $planspmlt = ConsumerVal ($name, $c, 'planSupplement', '');
@@ -27140,7 +27138,7 @@ to ensure that the system configuration is correct.
-