mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
76_SolarForecast: optimize battery management once more
git-svn-id: https://svn.fhem.de/fhem/trunk@28397 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4eb2594986
commit
2572525a78
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- change: 76_SolarForecast: optimize battery management once more
|
||||||
- feature: 00_KNXIO: set-cmds: connect, disconnect, restart
|
- feature: 00_KNXIO: set-cmds: connect, disconnect, restart
|
||||||
- feature: 76_SolarForecast: Consumer planning can now react dynamically to
|
- feature: 76_SolarForecast: Consumer planning can now react dynamically to
|
||||||
changing or time-shifting PV generation,
|
changing or time-shifting PV generation,
|
||||||
|
@ -157,6 +157,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
|
"1.7.1" => "20.01.2024 optimize battery management ",
|
||||||
"1.7.0" => "18.01.2024 Changeover Start centralTask completely to runCentralTask, ".
|
"1.7.0" => "18.01.2024 Changeover Start centralTask completely to runCentralTask, ".
|
||||||
"aiAddRawData: Weekday from pvHistory not taken into account greater than current day ".
|
"aiAddRawData: Weekday from pvHistory not taken into account greater than current day ".
|
||||||
"__reviewSwitchTime: new function for review consumer planning state ".
|
"__reviewSwitchTime: new function for review consumer planning state ".
|
||||||
@ -6358,7 +6359,7 @@ sub _batSocTarget {
|
|||||||
delete $paref->{careCycle};
|
delete $paref->{careCycle};
|
||||||
|
|
||||||
my $nt;
|
my $nt;
|
||||||
my $chargereq = 0; # Ladeanforedrung wenn SoC unter Minimum SoC gefallen ist
|
my $chargereq = 0; # Ladeanforderung wenn SoC unter Minimum SoC gefallen ist
|
||||||
my $target = $lowSoc;
|
my $target = $lowSoc;
|
||||||
my $yday = strftime "%d", localtime($t - 86400); # Vortag (range 01 to 31)
|
my $yday = strftime "%d", localtime($t - 86400); # Vortag (range 01 to 31)
|
||||||
my $batymaxsoc = HistoryVal ($hash, $yday, 99, 'batmaxsoc', 0); # gespeicherter max. SOC des Vortages
|
my $batymaxsoc = HistoryVal ($hash, $yday, 99, 'batmaxsoc', 0); # gespeicherter max. SOC des Vortages
|
||||||
@ -6368,12 +6369,12 @@ sub _batSocTarget {
|
|||||||
$batymaxsoc >= $maxsoc ? $batysetsoc - $batSocChgDay :
|
$batymaxsoc >= $maxsoc ? $batysetsoc - $batSocChgDay :
|
||||||
$batysetsoc; # neuer Min SOC für den laufenden Tag
|
$batysetsoc; # neuer Min SOC für den laufenden Tag
|
||||||
|
|
||||||
debugLog ($paref, 'batteryManagement', "SoC calc Step1 - compare with SoC history -> Target: $target %");
|
debugLog ($paref, 'batteryManagement', "SoC calc Step1 - compare with SoC history -> new Target: $target %");
|
||||||
|
|
||||||
## Pflege-SoC (Soll SoC $maxSoCdef bei $batSocChgDay % Steigerung p. Tag)
|
## Pflege-SoC (Soll SoC $maxSoCdef bei $batSocChgDay % Steigerung p. Tag)
|
||||||
###########################################################################
|
###########################################################################
|
||||||
my $sunset = CurrentVal ($hash, 'sunsetTodayTs', $t);
|
my $sunset = CurrentVal ($hash, 'sunsetTodayTs', $t);
|
||||||
my $delayts = $sunset - 5400; # Pflege-SoC/Erhöhung SoC erst ab 1,5 h vor Sonnenuntergang berechnen/anwenden
|
my $delayts = $sunset - 5400; # Pflege-SoC/Erhöhung SoC erst ab 1,5h vor Sonnenuntergang berechnen/anwenden
|
||||||
my $la = '';
|
my $la = '';
|
||||||
|
|
||||||
if ($t > $delayts) {
|
if ($t > $delayts) {
|
||||||
@ -6403,21 +6404,19 @@ sub _batSocTarget {
|
|||||||
my $pvexpect = $pvfctm > $pvfctd ? $pvfctm : $pvfctd;
|
my $pvexpect = $pvfctm > $pvfctd ? $pvfctm : $pvfctd;
|
||||||
|
|
||||||
my $batinstcap = CurrentVal ($hash, 'batinstcap', 0); # installierte Batteriekapazität Wh
|
my $batinstcap = CurrentVal ($hash, 'batinstcap', 0); # installierte Batteriekapazität Wh
|
||||||
my $needcharge = $batinstcap - ($batinstcap / 100 * $batcharge); # vorläufige benötigte Ladeenergie (Wh) bis 100% SOC
|
my $cantarget = 100 - (100 / $batinstcap) * $pvexpect; # berechneter möglicher Min SOC nach Berücksichtigung Ladewahrscheinlichkeit
|
||||||
my $cancharge = $pvexpect > $needcharge ? $pvexpect : $needcharge; # resultierende benötigte Ladeenergie (Wh)
|
|
||||||
my $cantarget = 100 - (100 / $batinstcap) * $cancharge; # berechneter möglicher Min SOC nach Berücksichtigung Ladewahrscheinlichkeit
|
|
||||||
|
|
||||||
my $newtarget = sprintf "%.0f", ($cantarget < $target ? $cantarget : $target); # Abgleich möglicher Min SOC gg. berechneten Min SOC
|
my $newtarget = sprintf "%.0f", ($cantarget < $target ? $cantarget : $target); # Abgleich möglicher Min SOC gg. berechneten Min SOC
|
||||||
my $logadd = '';
|
my $logadd = '';
|
||||||
|
|
||||||
if ($newtarget > $csopt && $t > $delayts) { # Erhöhung des SoC erst ab Sonnenuntergang anwenden
|
if ($newtarget > $csopt && $t > $delayts) { # Erhöhung des SoC (wird ab Sonnenuntergang angewendet)
|
||||||
$target = $newtarget;
|
$target = $newtarget;
|
||||||
$logadd = "(new target > $csopt % and Sunset has passed)";
|
$logadd = "(new target > $csopt % and Sunset has passed)";
|
||||||
}
|
}
|
||||||
elsif ($newtarget > $csopt && $t <= $delayts) { # bisheriges Optimum bleibt vorerst
|
elsif ($newtarget > $csopt && $t <= $delayts) { # bisheriges Optimum bleibt vorerst
|
||||||
$target = $csopt;
|
$target = $csopt;
|
||||||
$nt = (timestampToTimestring ($delayts, $paref->{lang}))[0];
|
$nt = (timestampToTimestring ($delayts, $paref->{lang}))[0];
|
||||||
$logadd = "(new target $newtarget % is only activated after $nt)";
|
$logadd = "(calculated new target $newtarget % is only activated after $nt)";
|
||||||
}
|
}
|
||||||
elsif ($newtarget < $csopt) { # Targetminderung sofort umsetzen -> Freiplatz für Ladeprognose
|
elsif ($newtarget < $csopt) { # Targetminderung sofort umsetzen -> Freiplatz für Ladeprognose
|
||||||
$target = $newtarget;
|
$target = $newtarget;
|
||||||
@ -6454,7 +6453,7 @@ sub _batSocTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
debugLog ($paref, 'batteryManagement', "SoC calc Step6 - force charging request: ".
|
debugLog ($paref, 'batteryManagement', "SoC calc Step6 - force charging request: ".
|
||||||
($chargereq ? 'yes (battery charge is below minimum SoC)' : 'no (sufficient battery charge)'));
|
($chargereq ? 'yes (battery charge is below minimum SoC)' : 'no (Battery is sufficiently charged)'));
|
||||||
|
|
||||||
## pvHistory/Readings schreiben
|
## pvHistory/Readings schreiben
|
||||||
#################################
|
#################################
|
||||||
@ -16448,6 +16447,8 @@ to ensure that the system configuration is correct.
|
|||||||
<a id="SolarForecast-attr-affectMaxDayVariance"></a>
|
<a id="SolarForecast-attr-affectMaxDayVariance"></a>
|
||||||
<li><b>affectMaxDayVariance <Zahl> </b><br>
|
<li><b>affectMaxDayVariance <Zahl> </b><br>
|
||||||
Maximum change size of the PV prediction factor (Reading pvCorrectionFactor_XX) per day. <br>
|
Maximum change size of the PV prediction factor (Reading pvCorrectionFactor_XX) per day. <br>
|
||||||
|
This setting has no influence on the learning and forecasting behavior of any AI support used
|
||||||
|
(<a href="#SolarForecast-set-pvCorrectionFactor_Auto">pvCorrectionFactor_Auto</a>). <br>
|
||||||
(default: 0.5)
|
(default: 0.5)
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
@ -18485,6 +18486,9 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
|
|||||||
<a id="SolarForecast-attr-affectMaxDayVariance"></a>
|
<a id="SolarForecast-attr-affectMaxDayVariance"></a>
|
||||||
<li><b>affectMaxDayVariance <Zahl> </b><br>
|
<li><b>affectMaxDayVariance <Zahl> </b><br>
|
||||||
Maximale Änderungsgröße des PV Vorhersagefaktors (Reading pvCorrectionFactor_XX) pro Tag. <br>
|
Maximale Änderungsgröße des PV Vorhersagefaktors (Reading pvCorrectionFactor_XX) pro Tag. <br>
|
||||||
|
Auf das Lern- und Prognoseverhalten einer eventuell verwendeten KI-Unterstützung
|
||||||
|
(<a href="#SolarForecast-set-pvCorrectionFactor_Auto">pvCorrectionFactor_Auto</a>) hat diese Einstellung keinen
|
||||||
|
Einfluß. <br>
|
||||||
(default: 0.5)
|
(default: 0.5)
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user