76_SolarForecast: contrib V1.59.1
git-svn-id: https://svn.fhem.de/fhem/trunk@30364 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -11856,10 +11856,12 @@ sub _batChargeMgmt {
|
|||||||
|
|
||||||
$socwh += $delta;
|
$socwh += $delta;
|
||||||
|
|
||||||
$socwh = $socwh < $lowSocwh ? $lowSocwh : # SoC begrenzen
|
#$socwh = $socwh < $lowSocwh ? $lowSocwh : # SoC begrenzen
|
||||||
$socwh < $batoptsocwh ? $batoptsocwh :
|
# $socwh < $batoptsocwh ? $batoptsocwh :
|
||||||
$socwh > $batinstcap ? $batinstcap :
|
# $socwh > $batinstcap ? $batinstcap :
|
||||||
$socwh;
|
# $socwh;
|
||||||
|
|
||||||
|
$socwh = ___batClampValue ($socwh, $lowSocwh, $batoptsocwh, $batinstcap); # SoC begrenzen
|
||||||
|
|
||||||
$socwh = sprintf "%.0f", $socwh; # SoC Prognose in Wh
|
$socwh = sprintf "%.0f", $socwh; # SoC Prognose in Wh
|
||||||
$progsoc = sprintf "%.1f", (100 * $socwh / $batinstcap); # Prognose SoC in %
|
$progsoc = sprintf "%.1f", (100 * $socwh / $batinstcap); # Prognose SoC in %
|
||||||
@@ -12090,10 +12092,12 @@ sub __batChargeOptTargetPower {
|
|||||||
|
|
||||||
$runwh += $hsurp->{$hod}{speff} / $befficiency; # um Verbrauch reduzieren
|
$runwh += $hsurp->{$hod}{speff} / $befficiency; # um Verbrauch reduzieren
|
||||||
|
|
||||||
$runwh = $runwh < $lowSocwh ? $lowSocwh : # runwh begrenzen
|
#$runwh = $runwh < $lowSocwh ? $lowSocwh : # runwh begrenzen
|
||||||
$runwh < $batoptsocwh ? $batoptsocwh :
|
# $runwh < $batoptsocwh ? $batoptsocwh :
|
||||||
$runwh > $batinstcap ? $batinstcap :
|
# $runwh > $batinstcap ? $batinstcap :
|
||||||
$runwh;
|
# $runwh;
|
||||||
|
|
||||||
|
$runwh = ___batClampValue ($runwh, $lowSocwh, $batoptsocwh, $batinstcap); # runwh begrenzen
|
||||||
|
|
||||||
$hsurp->{$hod}{$sbn}{fcendwh} = sprintf "%.0f", $runwh;
|
$hsurp->{$hod}{$sbn}{fcendwh} = sprintf "%.0f", $runwh;
|
||||||
$hsurp->{$nexthod}{$sbn}{fcnextwh} = $hsurp->{$hod}{$sbn}{fcendwh} if(defined $nextnhr); # Startwert kommende Stunde
|
$hsurp->{$nexthod}{$sbn}{fcnextwh} = $hsurp->{$hod}{$sbn}{fcendwh} if(defined $nextnhr); # Startwert kommende Stunde
|
||||||
@@ -12151,10 +12155,12 @@ sub __batChargeOptTargetPower {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$runwh = $runwh < $lowSocwh ? $lowSocwh : # fcendwh begrenzen
|
#$runwh = $runwh < $lowSocwh ? $lowSocwh : # fcendwh begrenzen
|
||||||
$runwh < $batoptsocwh ? $batoptsocwh :
|
# $runwh < $batoptsocwh ? $batoptsocwh :
|
||||||
$runwh > $batinstcap ? $batinstcap :
|
# $runwh > $batinstcap ? $batinstcap :
|
||||||
$runwh;
|
# $runwh;
|
||||||
|
|
||||||
|
$runwh = ___batClampValue ($runwh, $lowSocwh, $batoptsocwh, $batinstcap); # fcendwh begrenzen
|
||||||
|
|
||||||
$hsurp->{$hod}{$sbn}{fcendwh} = sprintf "%.0f", $runwh;
|
$hsurp->{$hod}{$sbn}{fcendwh} = sprintf "%.0f", $runwh;
|
||||||
$hsurp->{$nexthod}{$sbn}{fcnextwh} = $hsurp->{$hod}{$sbn}{fcendwh} if(defined $nextnhr); # Startwert kommende Stunde
|
$hsurp->{$nexthod}{$sbn}{fcnextwh} = $hsurp->{$hod}{$sbn}{fcendwh} if(defined $nextnhr); # Startwert kommende Stunde
|
||||||
@@ -12168,6 +12174,22 @@ sub __batChargeOptTargetPower {
|
|||||||
return ($hsurp, $otp);
|
return ($hsurp, $otp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
# Begrenzungen einhalten zwischen low, mid und high Grenze
|
||||||
|
#
|
||||||
|
# $x = ___batClampValue ($value, $low, $mid, $high);
|
||||||
|
################################################################
|
||||||
|
sub ___batClampValue {
|
||||||
|
my ($value, $low, $mid, $high) = @_;
|
||||||
|
|
||||||
|
$value = $value < $low ? $low :
|
||||||
|
$value < $mid ? $mid :
|
||||||
|
$value > $high ? $high :
|
||||||
|
$value;
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################################
|
###############################################################################################
|
||||||
# Binärsuche für konstante Ladeleistung: $ph Wh via Binärsuche Iteration
|
# Binärsuche für konstante Ladeleistung: $ph Wh via Binärsuche Iteration
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user