76_SolarForecast: opt load if battery load control is deactivated

git-svn-id: https://svn.fhem.de/fhem/trunk@30322 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
DS_Starter
2025-09-24 06:35:43 +00:00
parent 8148656bd3
commit 0c0d8bcdc8
3 changed files with 38 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it
- bugfix: 76_SolarForecast: opt load if battery load control is deactivated
- change: 76_SolarForecast: Version 1.58.4
- bugfix: 55_DWD_OpenData: replace for..when structures
- feature: 76_SolarForecast: Version 1.58.3

View File

@@ -160,6 +160,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"1.58.5" => "24.09.2025 __batChargeOptTargetPower: fix if battery load control is deactivated ",
"1.58.4" => "23.09.2025 __batChargeOptTargetPower: user a better surplus value, excess based on average removed & some other code optimization ",
"1.58.3" => "17.09.2025 __batChargeOptTargetPower: minor code change, consider bpinmax & lcintime ",
"1.58.2" => "11.09.2025 __batChargeOptTargetPower: a lot of Code improvements, Attr flowGraphicControl->shiftx: unrestrict possible values ",
@@ -1090,8 +1091,8 @@ my %htitles = (
DE => qq{SoC Prognose} },
socbaths => { EN => qq{SoC at the end of the hour},
DE => qq{SoC am Ende der Stunde} },
lcready => { EN => qq{Charge management ready},
DE => qq{Lademanagement bereit} },
lcenable => { EN => qq{Charge management enabled},
DE => qq{Lademanagement aktiviert} },
ldstratg => { EN => qq{Loading strategy},
DE => qq{Ladestrategie} },
ldreleas => { EN => qq{load release},
@@ -11921,7 +11922,13 @@ sub __batChargeOptTargetPower {
for my $sbn (sort @batteries) { # jede Batterie
if (!$hsurp->{$shod}{$sbn}{lcintime}) { # Ladesteuerung nicht "In Time"
$hsurp->{$shod}{$sbn}{pneedmin} = $hsurp->{$shod}{$sbn}{bpinmax};
next;
if ($hsurp->{$shod}{nhr} eq '00') {
$otp->{$sbn}{target} = $hsurp->{$shod}{$sbn}{bpinmax};
storeReading ('Battery_ChargeOptTargetPower_'.$sbn, $hsurp->{$shod}{$sbn}{bpinmax}.' W');
}
next;
}
my $bpinreduced = BatteryVal ($name, $sbn, 'bpinreduced', 0); # Standardwert wenn z.B. kein Überschuß oder Zwangsladung vom Grid
@@ -11937,8 +11944,13 @@ sub __batChargeOptTargetPower {
my $margin = defined $otpMargin ? $otpMargin : SFTYMARGIN_20;
if (!$spls) { # auf kleine Sollladeleistung setzen wenn kein Überschuß
$otp->{$sbn}{target} = $bpinreduced;
storeReading ('Battery_ChargeOptTargetPower_'.$sbn, $bpinreduced.' W');
$hsurp->{$shod}{$sbn}{pneedmin} = $bpinreduced;
if ($hsurp->{$shod}{nhr} eq '00') {
$otp->{$sbn}{target} = $bpinreduced;
storeReading ('Battery_ChargeOptTargetPower_'.$sbn, $bpinreduced.' W');
}
next;
}
@@ -19184,7 +19196,7 @@ sub __substituteIcon {
}
}
$pretxt .= "\n".$htitles{lcready}{$lang}.": ".(defined $msg2 ? ($msg2 == 1 ? $htitles{simplyes}{$lang} : $htitles{simpleno}{$lang}) : '-');
$pretxt .= "\n".$htitles{lcenable}{$lang}.": ".(defined $msg2 ? ($msg2 == 1 ? $htitles{simplyes}{$lang} : $htitles{simpleno}{$lang}) : '-');
$pretxt .= "\n".$htitles{ldstratg}{$lang}.": ".(defined $msg2 ? $msg3 : '-');
if (defined $pcurr) { # aktueller Zustand

View File

@@ -160,6 +160,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"1.58.5" => "24.09.2025 __batChargeOptTargetPower: fix if battery load control is deactivated ",
"1.58.4" => "23.09.2025 __batChargeOptTargetPower: user a better surplus value, excess based on average removed & some other code optimization ",
"1.58.3" => "17.09.2025 __batChargeOptTargetPower: minor code change, consider bpinmax & lcintime ",
"1.58.2" => "11.09.2025 __batChargeOptTargetPower: a lot of Code improvements, Attr flowGraphicControl->shiftx: unrestrict possible values ",
@@ -1090,8 +1091,8 @@ my %htitles = (
DE => qq{SoC Prognose} },
socbaths => { EN => qq{SoC at the end of the hour},
DE => qq{SoC am Ende der Stunde} },
lcready => { EN => qq{Charge management ready},
DE => qq{Lademanagement bereit} },
lcenable => { EN => qq{Charge management enabled},
DE => qq{Lademanagement aktiviert} },
ldstratg => { EN => qq{Loading strategy},
DE => qq{Ladestrategie} },
ldreleas => { EN => qq{load release},
@@ -11921,7 +11922,13 @@ sub __batChargeOptTargetPower {
for my $sbn (sort @batteries) { # jede Batterie
if (!$hsurp->{$shod}{$sbn}{lcintime}) { # Ladesteuerung nicht "In Time"
$hsurp->{$shod}{$sbn}{pneedmin} = $hsurp->{$shod}{$sbn}{bpinmax};
next;
if ($hsurp->{$shod}{nhr} eq '00') {
$otp->{$sbn}{target} = $hsurp->{$shod}{$sbn}{bpinmax};
storeReading ('Battery_ChargeOptTargetPower_'.$sbn, $hsurp->{$shod}{$sbn}{bpinmax}.' W');
}
next;
}
my $bpinreduced = BatteryVal ($name, $sbn, 'bpinreduced', 0); # Standardwert wenn z.B. kein Überschuß oder Zwangsladung vom Grid
@@ -11937,8 +11944,13 @@ sub __batChargeOptTargetPower {
my $margin = defined $otpMargin ? $otpMargin : SFTYMARGIN_20;
if (!$spls) { # auf kleine Sollladeleistung setzen wenn kein Überschuß
$otp->{$sbn}{target} = $bpinreduced;
storeReading ('Battery_ChargeOptTargetPower_'.$sbn, $bpinreduced.' W');
$hsurp->{$shod}{$sbn}{pneedmin} = $bpinreduced;
if ($hsurp->{$shod}{nhr} eq '00') {
$otp->{$sbn}{target} = $bpinreduced;
storeReading ('Battery_ChargeOptTargetPower_'.$sbn, $bpinreduced.' W');
}
next;
}
@@ -11960,7 +11972,7 @@ sub __batChargeOptTargetPower {
$hsurp->{$newshod}{$sbn}{fcnextwh} = $runwh + $hsurp->{$shod}{$sbn}{pneedmin} if(defined $hsurp->{$newshod});
if ($hsurp->{$shod}{nhr} eq '00') {
my $target = max (BatteryVal ($name, $sbn, 'bpinreduced', 0), $hsurp->{$shod}{$sbn}{pneedmin});
my $target = max ($bpinreduced, $hsurp->{$shod}{$sbn}{pneedmin});
if (NexthoursVal ($name, 'NextHour00', 'DoN', 0)) {
$target *= 1 + ($margin / 100); # 2. Sicherheitsaufschlag
@@ -19184,7 +19196,7 @@ sub __substituteIcon {
}
}
$pretxt .= "\n".$htitles{lcready}{$lang}.": ".(defined $msg2 ? ($msg2 == 1 ? $htitles{simplyes}{$lang} : $htitles{simpleno}{$lang}) : '-');
$pretxt .= "\n".$htitles{lcenable}{$lang}.": ".(defined $msg2 ? ($msg2 == 1 ? $htitles{simplyes}{$lang} : $htitles{simpleno}{$lang}) : '-');
$pretxt .= "\n".$htitles{ldstratg}{$lang}.": ".(defined $msg2 ? $msg3 : '-');
if (defined $pcurr) { # aktueller Zustand