mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 16:05:19 +00:00
76_Solarforcast: contrib 0.68.6
git-svn-id: https://svn.fhem.de/fhem/trunk@26490 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2af7c886d2
commit
6c615741e0
@ -126,7 +126,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
"0.68.6 "=> "05.10.2022 new attribute solCastPercentile ",
|
"0.68.6 "=> "06.10.2022 new attribute solCastPercentile, change _calcMaxEstimateToday ",
|
||||||
"0.68.5 "=> "03.10.2022 extent plant configuration check ",
|
"0.68.5 "=> "03.10.2022 extent plant configuration check ",
|
||||||
"0.68.4 "=> "03.10.2022 do ___setLastAPIcallKeyData if response_status, generate events of Today_MaxPVforecast.* in every cycle ".
|
"0.68.4 "=> "03.10.2022 do ___setLastAPIcallKeyData if response_status, generate events of Today_MaxPVforecast.* in every cycle ".
|
||||||
"add SolCast section in _graphicHeader, change default colors and settings, new reading Today_PVreal ".
|
"add SolCast section in _graphicHeader, change default colors and settings, new reading Today_PVreal ".
|
||||||
@ -3620,34 +3620,29 @@ return ($pvsum, $logao);
|
|||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# den Maximalwert PV Vorhersage für Heute ermitteln
|
# den Maximalwert PV Vorhersage für Heute ermitteln
|
||||||
# und mit seinem Zeitparamter im current Hash speichern
|
|
||||||
################################################################
|
################################################################
|
||||||
sub _calcMaxEstimateToday {
|
sub _calcMaxEstimateToday {
|
||||||
my $paref = shift;
|
my $paref = shift;
|
||||||
my $hash = $paref->{hash};
|
my $hash = $paref->{hash};
|
||||||
my $name = $paref->{name};
|
my $name = $paref->{name};
|
||||||
my $daref = $paref->{daref};
|
my $daref = $paref->{daref};
|
||||||
|
my $date = $paref->{date};
|
||||||
|
|
||||||
my $type = $hash->{TYPE};
|
my $type = $hash->{TYPE};
|
||||||
|
|
||||||
return if (!keys %{$data{$type}{$name}{nexthours}});
|
my $maxest = 0;
|
||||||
|
my $maxtim = '-';
|
||||||
|
|
||||||
my $maxest = ReadingsNum($name, 'Today_MaxPVforecast', 0);
|
for my $h (1..23) {
|
||||||
my $maxtim = ReadingsVal($name, 'Today_MaxPVforecastTime', '-');
|
my $pvfc = ReadingsNum ($name, "Today_Hour".sprintf("%02d",$h)."_PVforecast", 0);
|
||||||
|
next if($pvfc <= $maxest);
|
||||||
for my $idx (sort keys %{$data{$type}{$name}{nexthours}}) {
|
|
||||||
next if(!NexthoursVal ($hash, $idx, 'today', 0));
|
|
||||||
|
|
||||||
my $stt = NexthoursVal ($hash, $idx, 'starttime', '');
|
|
||||||
next if (!$stt);
|
|
||||||
|
|
||||||
my $pvfc = NexthoursVal ($hash, $idx, 'pvforecast', 0);
|
|
||||||
next if($pvfc < $maxest);
|
|
||||||
|
|
||||||
|
$maxtim = $date.' '.sprintf("%02d",$h-1).':00:00';
|
||||||
$maxest = $pvfc;
|
$maxest = $pvfc;
|
||||||
$maxtim = $stt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return if(!$maxest);
|
||||||
|
|
||||||
push @$daref, "Today_MaxPVforecast<>". $maxest." Wh";
|
push @$daref, "Today_MaxPVforecast<>". $maxest." Wh";
|
||||||
push @$daref, "Today_MaxPVforecastTime<>". $maxtim;
|
push @$daref, "Today_MaxPVforecastTime<>". $maxtim;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user