2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

76_Solarforcast: contrib 0.15.2

git-svn-id: https://svn.fhem.de/fhem/trunk@24007 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-03-19 13:37:06 +00:00
parent 57226d8a9c
commit 0dcf745430

View File

@ -1381,20 +1381,20 @@ sub _transferDWDForecastValues {
Log3($name, 5, "$name - collect DWD forecast data: device=$fcname, rad=fc${fd}_${fh}_Rad1h, Val=$v");
my $calcpv = calcPVforecast ($name, $v, $fh); # Vorhersage gewichtet kalkulieren
if ($num1 >= 0) {
$time_str = "NextHour".sprintf "%02d", $num1;
$epoche = $t + (3600*$num1);
}
my $calcpv = calcPVforecast ($name, $v, $fh); # Vorhersage gewichtet kalkulieren
push @$daref, "${time_str}_PVforecast:".$calcpv." Wh";
push @$daref, "${time_str}_Time:" .TimeAdjust ($epoche); # Zeit fortschreiben
}
if($num < 24 && $fh && $fh < 24) { # Ringspeicher PV forecast Forum: https://forum.fhem.de/index.php/topic,117864.msg1133350.html#msg1133350
$data{$hash->{TYPE}}{$name}{pvfc}{sprintf("%02d",$fh)} = $calcpv;
}
push @$daref, "${time_str}_PVforecast:".$calcpv." Wh";
push @$daref, "${time_str}_Time:" .TimeAdjust ($epoche); # Zeit fortschreiben
$hash->{HELPER}{"fc${fd}_".sprintf("%02d",$fh)."_Rad1h"} = $v." kJ/m2"; # nur Info: original Vorhersage Strahlungsdaten zur Berechnung Auto-Korrekturfaktor in Helper speichern
if($fd == 0 && int $calcpv > 0) { # Vorhersagedaten des aktuellen Tages zum manuellen Vergleich in Reading speichern
@ -1449,13 +1449,6 @@ sub _transferWeatherValues {
my ($fd,$fh) = _calcDayHourMove ($chour, $num);
last if($fd > 1);
my $num1 = $num-1;
if ($num1 >= 0) {
$time_str = "NextHour".sprintf "%02d", $num1;
$epoche = $t + (3600*$num1);
}
my $wid = ReadingsNum($fcname, "fc${fd}_${fh}_ww", -1);
my $neff = ReadingsNum($fcname, "fc${fd}_${fh}_Neff", 0); # Effektive Wolkendecke
my $r101 = ReadingsNum($fcname, "fc${fd}_${fh}_R101", 0); # Niederschlagswahrscheinlichkeit> 0,1 mm während der letzten Stunde
@ -1473,10 +1466,17 @@ sub _transferWeatherValues {
Log3($name, 5, "$name - collect Weather data: device=$fcname, wid=fc${fd}_${fh}_ww, val=$wid, txt=$txt, cc=$neff, rp=$r101");
$hash->{HELPER}{"${time_str}_WeatherId"} = $wid;
$hash->{HELPER}{"${time_str}_WeatherTxt"} = $txt;
$hash->{HELPER}{"${time_str}_CloudCover"} = $neff;
$hash->{HELPER}{"${time_str}_RainProb"} = $r101;
my $num1 = $num-1;
if ($num1 >= 0) {
$time_str = "NextHour".sprintf "%02d", $num1;
$epoche = $t + (3600*$num1);
$hash->{HELPER}{"${time_str}_WeatherId"} = $wid;
$hash->{HELPER}{"${time_str}_WeatherTxt"} = $txt;
$hash->{HELPER}{"${time_str}_CloudCover"} = $neff;
$hash->{HELPER}{"${time_str}_RainProb"} = $r101;
}
if($num < 24 && $fh && $fh < 24) { # Ringspeicher Weather Forum: https://forum.fhem.de/index.php/topic,117864.msg1139251.html#msg1139251
$data{$type}{$name}{weather}{sprintf("%02d",$fh)}{id} = $wid;