From 293db628b4fd0c5b2463c2eebb04907f367f4177 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Fri, 27 Sep 2024 07:30:45 +0000 Subject: [PATCH] 76_SolarForecast: internal code change git-svn-id: https://svn.fhem.de/fhem/trunk@29168 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/76_SolarForecast.pm | 10 ++++++---- fhem/contrib/DS_Starter/76_SolarForecast.pm | 10 ++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 7a8ba5397..d3d61deb1 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it + - bugfix: 76_SolarForecast: internal code change - change: 76_SolarForecast: internal code change - bufgix: 72_FRITZBOX: Blockade des Intervall-Timers durch nonBlocking set/get Befehle diff --git a/fhem/FHEM/76_SolarForecast.pm b/fhem/FHEM/76_SolarForecast.pm index b733b49c9..b636e846d 100644 --- a/fhem/FHEM/76_SolarForecast.pm +++ b/fhem/FHEM/76_SolarForecast.pm @@ -155,6 +155,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "1.33.1" => "27.09.2024 bugfix of 1.33.0 ", "1.33.0" => "26.09.2024 substitute area factor hash by ___areaFactorPV function ", "1.32.0" => "02.09.2024 new attr setupOtherProducerXX, report calculation and storage of negative consumption values ". "Forum: https://forum.fhem.de/index.php?msg=1319083 ". @@ -3392,7 +3393,8 @@ sub __getDWDSolarData { $peak *= 1000; # kWp in Wp umrechnen my $ti = $data{$type}{$name}{strings}{$string}{tilt}; # Neigungswinkel Solarmodule my $az = $data{$type}{$name}{strings}{$string}{azimut}; # Ausrichtung der Solarmodule - + $az += 180; # Umsetzung -180 - 180 in 0 - 360 + my $af = ___areaFactorPV ($ti, $az); # Flächenfaktor: https://wiki.fhem.de/wiki/Ertragsprognose_PV my $pv = sprintf "%.1f", ($rad * $af * $kJtokWh * $peak * $prdef); # Rad wird in kW/m2 erwartet @@ -6854,6 +6856,8 @@ return; sub _ident2azimuth { my $id = shift; + return $id if(isNumeric ($id)); + my $az = $id eq 'N' ? -180 : $id eq 'NE' ? -135 : $id eq 'E' ? -90 : @@ -6862,9 +6866,7 @@ sub _ident2azimuth { $id eq 'SW' ? 45 : $id eq 'W' ? 90 : $id eq 'NW' ? 135 : - $id; - - $az += 180; # Umsetzung -180 - 180 in 0 - 360 + undef; return $az; } diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index b733b49c9..b636e846d 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -155,6 +155,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "1.33.1" => "27.09.2024 bugfix of 1.33.0 ", "1.33.0" => "26.09.2024 substitute area factor hash by ___areaFactorPV function ", "1.32.0" => "02.09.2024 new attr setupOtherProducerXX, report calculation and storage of negative consumption values ". "Forum: https://forum.fhem.de/index.php?msg=1319083 ". @@ -3392,7 +3393,8 @@ sub __getDWDSolarData { $peak *= 1000; # kWp in Wp umrechnen my $ti = $data{$type}{$name}{strings}{$string}{tilt}; # Neigungswinkel Solarmodule my $az = $data{$type}{$name}{strings}{$string}{azimut}; # Ausrichtung der Solarmodule - + $az += 180; # Umsetzung -180 - 180 in 0 - 360 + my $af = ___areaFactorPV ($ti, $az); # Flächenfaktor: https://wiki.fhem.de/wiki/Ertragsprognose_PV my $pv = sprintf "%.1f", ($rad * $af * $kJtokWh * $peak * $prdef); # Rad wird in kW/m2 erwartet @@ -6854,6 +6856,8 @@ return; sub _ident2azimuth { my $id = shift; + return $id if(isNumeric ($id)); + my $az = $id eq 'N' ? -180 : $id eq 'NE' ? -135 : $id eq 'E' ? -90 : @@ -6862,9 +6866,7 @@ sub _ident2azimuth { $id eq 'SW' ? 45 : $id eq 'W' ? 90 : $id eq 'NW' ? 135 : - $id; - - $az += 180; # Umsetzung -180 - 180 in 0 - 360 + undef; return $az; }