2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 19:36:02 +00:00

76_SolarForecast.pm: contrib 0.23.0

git-svn-id: https://svn.fhem.de/fhem/trunk@24087 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-03-25 19:50:14 +00:00
parent bb942c15e9
commit 09c8782b4f

View File

@ -117,7 +117,7 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"0.23.0" => "25.03.2021 change attr layoutType ", "0.23.0" => "25.03.2021 change attr layoutType, fix calc reading Today_PVforecast ",
"0.22.0" => "25.03.2021 event management, move DWD values one hour to the future, some more corrections ", "0.22.0" => "25.03.2021 event management, move DWD values one hour to the future, some more corrections ",
"0.21.0" => "24.03.2021 event management ", "0.21.0" => "24.03.2021 event management ",
"0.20.0" => "23.03.2021 new sub CircularVal, NexthoursVal, some fixes ", "0.20.0" => "23.03.2021 new sub CircularVal, NexthoursVal, some fixes ",
@ -1188,7 +1188,7 @@ sub centralTask {
_transferInverterValues ($params); # WR Werte übertragen _transferInverterValues ($params); # WR Werte übertragen
_transferMeterValues ($params); _transferMeterValues ($params);
collectSummaries ($hash, $chour, \@da); # Zusammenfassung nächste 4 Stunden u.a. erstellen calcSummaries ($hash, $chour, \@da); # Zusammenfassungen erstellen
if(@da) { if(@da) {
createReadingsFromArray ($hash, \@da, 1); createReadingsFromArray ($hash, \@da, 1);
@ -3254,7 +3254,7 @@ return $sc;
################################################################ ################################################################
# Zusammenfassungen erstellen # Zusammenfassungen erstellen
################################################################ ################################################################
sub collectSummaries { sub calcSummaries {
my $hash = shift; my $hash = shift;
my $chour = shift; # aktuelle Stunde my $chour = shift; # aktuelle Stunde
my $daref = shift; my $daref = shift;
@ -3280,7 +3280,10 @@ sub collectSummaries {
$next4HoursSum->{PV} += $pvfc if($h <= 3); $next4HoursSum->{PV} += $pvfc if($h <= 3);
$restOfDaySum->{PV} += $pvfc if($h <= $rdh); $restOfDaySum->{PV} += $pvfc if($h <= $rdh);
$tomorrowSum->{PV} += $pvfc if($h > $rdh); $tomorrowSum->{PV} += $pvfc if($h > $rdh);
$todaySum->{PV} += $pvfc if($h <= 23); }
for my $th (1..24) {
$todaySum->{PV} += ReadingsNum($name, "Today_Hour".sprintf("%02d",$th)."_PVforecast", 0);;
} }
push @$daref, "Next04Hours_PV:". (int $next4HoursSum->{PV})." Wh"; push @$daref, "Next04Hours_PV:". (int $next4HoursSum->{PV})." Wh";
@ -3288,8 +3291,6 @@ sub collectSummaries {
push @$daref, "Tomorrow_PVforecast:".(int $tomorrowSum->{PV}). " Wh"; push @$daref, "Tomorrow_PVforecast:".(int $tomorrowSum->{PV}). " Wh";
push @$daref, "Today_PVforecast:". (int $todaySum->{PV}). " Wh"; push @$daref, "Today_PVforecast:". (int $todaySum->{PV}). " Wh";
# createReadingsFromArray ($hash, $daref, 1);
return; return;
} }