2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

76_SolarForecast: replace calcRange by cloud2bin

git-svn-id: https://svn.fhem.de/fhem/trunk@28027 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2023-10-06 19:57:06 +00:00
parent 28a2dd478a
commit 6ef49d9e05

View File

@ -144,6 +144,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"1.0.2" => "05.10.2023 replace calcRange by cloud2bin ",
"1.0.1" => "03.10.2023 fixes in comRef, bug fix Forum: https://forum.fhem.de/index.php?msg=1288637 ",
"1.0.0" => "01.10.2023 preparation for check in ",
"0.83.3" => "28.09.2023 fix Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1288032 ".
@ -5537,7 +5538,7 @@ sub ___readCandQ {
delete $data{$type}{$name}{nexthours}{"NextHour".sprintf("%02d",$num)}{cloudrange};
if ($acu =~ /on_complex/xs) { # Autokorrektur complex soll genutzt werden
my $range = calcRange ($cc); # Range errechnen
my $range = cloud2bin ($cc); # Range errechnen
($hc, $hq) = CircularAutokorrVal ($hash, sprintf("%02d",$fh1), $range, undef); # Korrekturfaktor/Qualität der Stunde des Tages (complex)
$hq //= '-';
$hc //= 1; # Korrekturfaktor = 1 (keine Korrektur) # keine Qualität definiert
@ -10592,7 +10593,7 @@ sub __Pv_Fc_Complex_Dnum_Hist {
return;
}
my $range = calcRange ($chwcc);
my $range = cloud2bin ($chwcc);
if(scalar(@efa)) {
debugLog ($paref, 'pvCorrection', "Complex Corrf -> Raw Days ($calcd) for average check: ".join " ",@efa);
@ -10612,7 +10613,7 @@ sub __Pv_Fc_Complex_Dnum_Hist {
next;
}
$histwcc = calcRange ($histwcc); # V 0.50.1
$histwcc = cloud2bin ($histwcc); # V 0.50.1
if($range == $histwcc) {
$pvrl += HistoryVal ($hash, $dayfa, $hour, 'pvrl', 0);
@ -11217,18 +11218,6 @@ sub _aiMakeIdxRaw {
return $ridx;
}
################################################################
# Bewölkungs- bzw. Regenrange berechnen
################################################################
sub calcRange {
my $range = shift;
#$range = sprintf "%.0f", $range/10;
$range = sprintf "%.0f", $range;
return $range;
}
################################################################
# History-Hash verwalten
################################################################
@ -13305,7 +13294,8 @@ return $bin;
sub cloud2bin {
my $wcc = shift;
my $bin = $wcc > 95 ? '95' :
my $bin = $wcc == 100 ? '100' :
$wcc > 95 ? '95' :
$wcc > 90 ? '90' :
$wcc > 85 ? '85' :
$wcc > 80 ? '80' :
@ -13335,7 +13325,8 @@ return $bin;
sub rain2bin {
my $wrp = shift;
my $bin = $wrp > 95 ? '95' :
my $bin = $wrp == 100 ? '100' :
$wrp > 95 ? '95' :
$wrp > 90 ? '90' :
$wrp > 85 ? '85' :
$wrp > 80 ? '80' :