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

76_Solarforcast: contrib 0.1.0

git-svn-id: https://svn.fhem.de/fhem/trunk@23370 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-12-17 08:44:29 +00:00
parent 4381ae57b3
commit ab1ea04423

View File

@ -455,7 +455,7 @@ sub _setpvCorrectionFactor { ## no critic "not used"
$prop =~ s/,/./x; $prop =~ s/,/./x;
readingsSingleUpdate($hash, $opt, $prop." (manual set)", 1); readingsSingleUpdate($hash, $opt, $prop." (manual)", 1);
my @da; my @da;
my $t = time; # aktuelle Unix-Zeit my $t = time; # aktuelle Unix-Zeit
@ -708,7 +708,7 @@ sub _transferForecastValues {
$myHash->{HELPER}{"fc${fd}_".sprintf("%02d",$fh)."_PVforecast"} = $v." Wh"; # original Vorhersagedaten zur Berechnung Auto-Korrekturfaktor in Helper speichern $myHash->{HELPER}{"fc${fd}_".sprintf("%02d",$fh)."_PVforecast"} = $v." Wh"; # original Vorhersagedaten zur Berechnung Auto-Korrekturfaktor in Helper speichern
if($fd == 0 && int $calcpv > 0) { # Vorhersagedaten des aktuellen Tages zum manuellen Vergleich in Reading speichern if($fd == 0 && int $calcpv > 0) { # Vorhersagedaten des aktuellen Tages zum manuellen Vergleich in Reading speichern
push @$daref, "Today_Hour".sprintf("%02d",$fh)."_PVforecast:$calcpv"; push @$daref, "Today_Hour".sprintf("%02d",$fh)."_PVforecast:$calcpv Wh";
} }
## Wetter Forecast ## Wetter Forecast
@ -774,6 +774,7 @@ sub _transferInverterValues {
my $edaypast = 0; my $edaypast = 0;
for my $h (0..int($chour)-1) { # alle bisherigen Erzeugungen des Tages summieren for my $h (0..int($chour)-1) { # alle bisherigen Erzeugungen des Tages summieren
deleteReadingspec ($myHash, "Today_Hour00_PV.*");
$edaypast += ReadingsNum ($myName, "Today_Hour".sprintf("%02d",$h)."_PVreal", 0); $edaypast += ReadingsNum ($myName, "Today_Hour".sprintf("%02d",$h)."_PVreal", 0);
} }
@ -1872,7 +1873,7 @@ sub calcVariance {
Log3($myName, 4, "$myName - new Variance factor: $factor for hour: $h calculated"); Log3($myName, 4, "$myName - new Variance factor: $factor for hour: $h calculated");
} }
push @da, "pvCorrectionFactor_".sprintf("%02d",$h).":".$factor." (auto calc)"; push @da, "pvCorrectionFactor_".sprintf("%02d",$h).":".$factor." (automatic)";
} }
createReadings ($myHash, \@da); createReadings ($myHash, \@da);