76_SolarForecast: contrib V1.58.6
git-svn-id: https://svn.fhem.de/fhem/trunk@30333 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -11840,7 +11840,7 @@ sub _batChargeMgmt {
|
|||||||
## Speicherung und Readings erstellen
|
## Speicherung und Readings erstellen
|
||||||
#######################################
|
#######################################
|
||||||
$values = { hsoc => $hsoc,
|
$values = { hsoc => $hsoc,
|
||||||
strategy => 'loadRelease',
|
loop => 'LR',
|
||||||
num => $num,
|
num => $num,
|
||||||
crel => $crel,
|
crel => $crel,
|
||||||
bn => $bn,
|
bn => $bn,
|
||||||
@@ -12045,33 +12045,40 @@ sub ___batChargeSaveResults {
|
|||||||
my $values = shift;
|
my $values = shift;
|
||||||
|
|
||||||
my $name = $paref->{name};
|
my $name = $paref->{name};
|
||||||
my $hsoc = $values->{hsoc};
|
my $hsoc = $values->{hsoc}; # Referenz SoC-Hash
|
||||||
my $strategy = $values->{strategy};
|
my $bn = $values->{bn}; # Batterie Nummer
|
||||||
my $num = $values->{num};
|
my $num = $values->{num}; # Nexthours Schleife (0..MAXNEXTHOURS)
|
||||||
my $crel = $values->{crel};
|
my $nhr = $values->{nhr}; # zweistellige lfd. Nexthour
|
||||||
my $bn = $values->{bn};
|
my $progsoc = $values->{progsoc}; # Prognose-SoC in %
|
||||||
my $labortCond = $values->{labortCond};
|
my $socwh = $values->{socwh}; # Prognose-SoC in Wh
|
||||||
my $loadAbort = $values->{loadAbort};
|
my $today = $values->{today}; # Statusbit aktueller Tag
|
||||||
my $nhr = $values->{nhr};
|
my $hod = $values->{hod}; # Stunde des Tages
|
||||||
my $progsoc = $values->{progsoc};
|
my $loop = $values->{loop}; # in welcher Loop gestartet?
|
||||||
my $lcintime = $values->{lcintime};
|
my $crel = $values->{crel}; # nur in Schleife 'loadRelease' mitgeben
|
||||||
my $cgbt = $values->{cgbt}; # nur einmal bei 'loadRelease' mitgeben!
|
my $labortCond = $values->{labortCond}; # nur in Schleife 'loadRelease' mitgeben
|
||||||
my $socwh = $values->{socwh};
|
my $loadAbort = $values->{loadAbort}; # nur in Schleife 'loadRelease' mitgeben
|
||||||
my $today = $values->{today};
|
my $cgbt = $values->{cgbt}; # nur in Schleife 'loadRelease' mitgeben
|
||||||
my $hod = $values->{hod};
|
my $lcintime = $values->{lcintime}; # nur in Schleife 'loadRelease' mitgeben
|
||||||
|
|
||||||
if ($strategy eq 'loadRelease') { # nur in Schleife 'loadRelease' setzen
|
## in Schleife 'loadRelease' setzen
|
||||||
|
#####################################
|
||||||
|
if ($loop eq 'LR') { # nur in Schleife 'loadRelease' setzen
|
||||||
$data{$name}{nexthours}{'NextHour'.$nhr}{'rcdchargebat'.$bn} = $crel;
|
$data{$name}{nexthours}{'NextHour'.$nhr}{'rcdchargebat'.$bn} = $crel;
|
||||||
|
$data{$name}{nexthours}{'NextHour'.$nhr}{'lcintimebat'.$bn} = $lcintime if($cgbt); # nur einmal bei 'loadRelease' setzen -> Ladesteuerung "In Time", "nicht In Time" oder nicht verwendet
|
||||||
|
|
||||||
if (!$num) {
|
if (!$num) {
|
||||||
storeReading ('Battery_ChargeUnrestricted_'.$bn, $crel);
|
storeReading ('Battery_ChargeUnrestricted_'.$bn, $crel);
|
||||||
storeReading ('Battery_ChargeAbort_'.$bn, $labortCond) if ($loadAbort); # Ladeabbruchbedingung
|
storeReading ('Battery_ChargeAbort_'.$bn, $labortCond) if ($loadAbort); # Ladeabbruchbedingung
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($today && $hod) {
|
||||||
|
writeToHistory ( { paref => $paref, key => 'lcintimebat'.$bn, val => $lcintime, hour => $hod } ) if($cgbt); # nur einmal bei 'loadRelease' setzen
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($today && $hod) {
|
if ($today && $hod) {
|
||||||
writeToHistory ( { paref => $paref, key => 'batprogsoc'.$bn, val => $progsoc, hour => $hod } );
|
writeToHistory ( { paref => $paref, key => 'batprogsoc'.$bn, val => $progsoc, hour => $hod } );
|
||||||
writeToHistory ( { paref => $paref, key => 'lcintimebat'.$bn, val => $lcintime, hour => $hod } ) if($cgbt); # nur einmal bei 'loadRelease' setzen
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__createNextHoursSFCReadings ( {name => $name,
|
__createNextHoursSFCReadings ( {name => $name,
|
||||||
@@ -12081,7 +12088,6 @@ sub ___batChargeSaveResults {
|
|||||||
}
|
}
|
||||||
); # Readings NextHourXX_Bat_XX_ChargeForecast erstellen
|
); # Readings NextHourXX_Bat_XX_ChargeForecast erstellen
|
||||||
|
|
||||||
$data{$name}{nexthours}{'NextHour'.$nhr}{'lcintimebat'.$bn} = $lcintime if($cgbt); # nur einmal bei 'loadRelease' setzen -> Ladesteuerung "In Time", "nicht In Time" oder nicht verwendet
|
|
||||||
$data{$name}{nexthours}{'NextHour'.$nhr}{'soc'.$bn} = $progsoc;
|
$data{$name}{nexthours}{'NextHour'.$nhr}{'soc'.$bn} = $progsoc;
|
||||||
|
|
||||||
$hsoc->{$nhr}{socprogwhsum} += $socwh; # Hilfshash Aufsummierung SoC-Prognose (Wh) über alle Batterien
|
$hsoc->{$nhr}{socprogwhsum} += $socwh; # Hilfshash Aufsummierung SoC-Prognose (Wh) über alle Batterien
|
||||||
|
|||||||
Reference in New Issue
Block a user