2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 01:14:19 +00:00

contrib/GDS/55_GDS.pm: RC5

git-svn-id: https://svn.fhem.de/fhem/trunk@9663 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2015-10-25 13:22:08 +00:00
parent cf03076bb1
commit f936668d8a

View File

@ -44,13 +44,13 @@ use XML::Simple;
#use Data::Dumper; #use Data::Dumper;
eval { use GDSweblink; }; eval "use GDSweblink";
no if $] >= 5.017011, warnings => 'experimental'; no if $] >= 5.017011, warnings => 'experimental';
my ($bulaList, $cmapList, %rmapList, $fmapList, %bula2bulaShort, my ($bulaList, $cmapList, %rmapList, $fmapList, %bula2bulaShort,
%bulaShort2dwd, %dwd2Dir, %dwd2Name, $alertsXml, %capCityHash, %bulaShort2dwd, %dwd2Dir, %dwd2Name, $alertsXml, %capCityHash,
%capCellHash, $sList, $aList, $fList, $fcmapList, $tempDir, @weekdays); %capCellHash, $sList, $aList, $fList, $fcList, $fcmapList, $tempDir, @weekdays);
#my %foreCastHash = (); #my %foreCastHash = ();
@ -106,9 +106,10 @@ sub _fillMappingTables($){
$tempDir = "/tmp/"; $tempDir = "/tmp/";
$aList = "no_data_available"; $aList = "no_data";
$sList = $aList; $sList = $aList;
$fList = $aList; $fList = $aList;
$fcList = $aList;
$bulaList = "Baden-Württemberg,Bayern,Berlin,Brandenburg,Bremen,". $bulaList = "Baden-Württemberg,Bayern,Berlin,Brandenburg,Bremen,".
"Hamburg,Hessen,Mecklenburg-Vorpommern,Niedersachsen,". "Hamburg,Hessen,Mecklenburg-Vorpommern,Niedersachsen,".
@ -330,18 +331,14 @@ sub GDS_Notify ($$) {
my ($hash,$dev) = @_; my ($hash,$dev) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
return if($dev->{NAME} ne "global"); return if($dev->{NAME} ne "global");
return if(!grep(m/^INITIALIZED/, @{$dev->{CHANGED}})); return if(!grep(m/^INITIALIZED|^REREAD/, @{$dev->{CHANGED}}));
my $d; $aList = "disabled_by_attribute" unless AttrVal($name,'gdsUseAlerts',0);
$fList = "disabled_by_attribute" unless AttrVal($name,'gdsUseForecasts',0);
$fcmapList = "disabled_by_attribute" unless AttrVal($name,'gdsUseForecasts',0);
GDS_Get($hash,undef,'rereadcfg'); GDS_Get($hash,undef,'rereadcfg');
# $d = AttrVal($name,'gdsSetCond',undef);
# GDS_Set($hash,undef,'conditions',$d) if(defined($d));
# $d = AttrVal($name,'gdsSetForecast',undef);
# GDS_Set($hash,undef,'forecasts',$d) if(defined($d));
return undef; return undef;
} }
@ -355,7 +352,7 @@ sub GDS_Set($@) {
"help:noArg ". "help:noArg ".
"update:noArg "; ; "update:noArg "; ;
readingsSingleUpdate($hash, '_tzOffset', _calctz(time,localtime(time))*3600, 0); # readingsSingleUpdate($hash, '_tzOffset', _calctz(time,localtime(time))*3600, 0);
my $command = lc($a[1]); my $command = lc($a[1]);
my $parameter = $a[2] if(defined($a[2])); my $parameter = $a[2] if(defined($a[2]));
@ -424,7 +421,7 @@ sub GDS_Get($@) {
"alerts:".$aList." ". "alerts:".$aList." ".
"conditions:".$sList." ". "conditions:".$sList." ".
"conditionsmap:".$cmapList." ". "conditionsmap:".$cmapList." ".
"forecasts:".$fcmapList." ". "forecasts:".$fcList." ".
"forecastsmap:".$fmapList." ". "forecastsmap:".$fmapList." ".
"radarmap:".$cmapList." ". "radarmap:".$cmapList." ".
"warningsmap:"."Deutschland,Bodensee,".$bulaList." ". "warningsmap:"."Deutschland,Bodensee,".$bulaList." ".
@ -440,7 +437,7 @@ sub GDS_Get($@) {
readingsSingleUpdate($hash, 'state', 'active', 0); readingsSingleUpdate($hash, 'state', 'active', 0);
my $_gdsAll = AttrVal($name,"gdsAll", 0); my $_gdsAll = AttrVal($name,"gdsAll", 0);
my $_gdsDebug = AttrVal($name,"gdsDebug", 0); my $_gdsDebug = AttrVal($name,"gdsDebug", 0);
readingsSingleUpdate($hash, '_tzOffset', _calctz(time,localtime(time))*3600, 0); # readingsSingleUpdate($hash, '_tzOffset', _calctz(time,localtime(time))*3600, 0);
my ($result, @datensatz, $found); my ($result, @datensatz, $found);
@ -545,7 +542,7 @@ sub GDS_Get($@) {
} }
when("rereadcfg"){ when("rereadcfg"){
$hash->{GDS_REREAD} = time(); $hash->{GDS_REREAD} = int(time());
DoTrigger($name, "REREAD", 1); DoTrigger($name, "REREAD", 1);
retrieveData($hash,'conditions'); retrieveData($hash,'conditions');
retrieveData($hash,'capdata') if AttrVal($name,'gdsUseAlerts',0); retrieveData($hash,'capdata') if AttrVal($name,'gdsUseAlerts',0);
@ -587,8 +584,6 @@ sub GDS_Get($@) {
break; break;
} }
when("forecasts"){ when("forecasts"){
return "Error: Forecasts disabled by attribute." unless AttrVal($name,'gdsUseForecasts',0); return "Error: Forecasts disabled by attribute." unless AttrVal($name,'gdsUseForecasts',0);
$parameter = "Daten_$parameter"; $parameter = "Daten_$parameter";
@ -621,6 +616,25 @@ sub GDS_Attr(@){
my ($cmd, $name, $attrName, $attrValue) = @a; my ($cmd, $name, $attrName, $attrValue) = @a;
given($attrName){ given($attrName){
when("gdsUseAlerts"){
if ($attrValue == 0 || $cmd eq 'del') {
$aList = "disabled_by_attribute";
} else {
$aList = "data_retrieval_running";
retrieveData($hash,'capdata');
retrieveListCapStations($hash);
}
}
when("gdsUseForecasts"){
if ($attrValue == 0 || $cmd eq 'del') {
$fList = "disabled_by_attribute";
$fcList = "disabled_by_attribute";
} else {
$fcList = $fcmapList;
$fList = "data_retrieval_running";
retrieveData($hash,'forecast');
}
}
when("gdsHideFiles"){ when("gdsHideFiles"){
my $hR = AttrVal($FW_wname,'hiddenroom',''); my $hR = AttrVal($FW_wname,'hiddenroom','');
$hR =~ s/\,GDS.Files//g; $hR =~ s/\,GDS.Files//g;
@ -630,7 +644,7 @@ sub GDS_Attr(@){
} }
CommandAttr(undef,"$FW_wname hiddenroom $hR"); CommandAttr(undef,"$FW_wname hiddenroom $hR");
break; break;
} }
default {$attr{$name}{$attrName} = $attrValue;} default {$attr{$name}{$attrName} = $attrValue;}
} }
if(IsDisabled($name)) { if(IsDisabled($name)) {
@ -656,6 +670,12 @@ sub GDS_GetUpdate($) {
} else { } else {
readingsSingleUpdate($hash, 'state', 'active', 0); readingsSingleUpdate($hash, 'state', 'active', 0);
if($cs) { if($cs) {
if(time() - InternalVal($name,'GDS_CONDITIONS_READ',0) > ($hash->{helper}{INTERVAL}-10)) {
retrieveData($hash,'conditions') ;
my $next = gettimeofday() + 1;
InternalTimer($next, "GDS_GetUpdate", $hash, 1);
return;
}
my @a; my @a;
push @a, undef; push @a, undef;
push @a, undef; push @a, undef;
@ -663,6 +683,12 @@ sub GDS_GetUpdate($) {
getConditions($hash, "c", @a); getConditions($hash, "c", @a);
} }
if($fs) { if($fs) {
if(time() - InternalVal($name,'GDS_FORECAST_READ',0) >= ($hash->{helper}{INTERVAL}-10)) {
retrieveData($hash,'forecast') ;
my $next = gettimeofday() + 1;
InternalTimer($next, "GDS_GetUpdate", $hash, 1);
return;
}
my @a; my @a;
push @a, undef; push @a, undef;
push @a, undef; push @a, undef;
@ -675,9 +701,10 @@ sub GDS_GetUpdate($) {
my $next = gettimeofday()+$hash->{helper}{INTERVAL}; my $next = gettimeofday()+$hash->{helper}{INTERVAL};
my $_gdsAll = AttrVal($name,"gdsAll", 0); my $_gdsAll = AttrVal($name,"gdsAll", 0);
my $_gdsDebug = AttrVal($name,"gdsDebug", 0); my $_gdsDebug = AttrVal($name,"gdsDebug", 0);
readingsSingleUpdate($hash, "_nextUpdate", localtime($next), 1) if($_gdsAll || $_gdsDebug);
InternalTimer($next, "GDS_GetUpdate", $hash, 1); InternalTimer($next, "GDS_GetUpdate", $hash, 1);
readingsSingleUpdate($hash, "_nextUpdate", localtime($next), 1) if($_gdsAll || $_gdsDebug);
readingsSingleUpdate($hash, '_tzOffset', _calctz(time,localtime(time))*3600, 0);
return 1; return 1;
} }
@ -896,28 +923,28 @@ sub getConditions($$@){
if(length($wx{"Station"})){ if(length($wx{"Station"})){
$cread{$prefix."_stationName"} = utf8ToLatin1($wx{"Station"}); $cread{$prefix."_stationName"} = utf8ToLatin1($wx{"Station"});
$cread{$prefix."_altitude"} = $wx{"H\xF6he"}; $cread{$prefix."_altitude"} = $wx{"H\xF6he"};
$cread{$prefix."_pressure-nn"} = $wx{"Luftd."}; $cread{$prefix."_pressure-nn"} = $wx{"Luftd."};
$cread{$prefix."_temperature"} = $wx{"TT"}; $cread{$prefix."_temperature"} = $wx{"TT"};
$cread{$prefix."_tMinAir12"} = $wx{"Tn12"}; $cread{$prefix."_tMinAir12"} = $wx{"Tn12"};
$cread{$prefix."_tMaxAir12"} = $wx{"Tx12"}; $cread{$prefix."_tMaxAir12"} = $wx{"Tx12"};
$cread{$prefix."_tMinGrnd24"} = $wx{"Tg24"}; $cread{$prefix."_tMinGrnd24"} = $wx{"Tg24"};
$cread{$prefix."_tMinAir24"} = $wx{"Tn24"}; $cread{$prefix."_tMinAir24"} = $wx{"Tn24"};
$cread{$prefix."_tAvgAir24"} = $wx{"Tm24"}; $cread{$prefix."_tAvgAir24"} = $wx{"Tm24"};
$cread{$prefix."_tMaxAir24"} = $wx{"Tx24"}; $cread{$prefix."_tMaxAir24"} = $wx{"Tx24"};
$cread{$prefix."_tempMin"} = $wx{"Tmin"}; $cread{$prefix."_tempMin"} = $wx{"Tmin"};
$cread{$prefix."_tempMax"} = $wx{"Tmax"}; $cread{$prefix."_tempMax"} = $wx{"Tmax"};
$cread{$prefix."_rain1h"} = $wx{"RR1"}; $cread{$prefix."_rain1h"} = $wx{"RR1"};
$cread{$prefix."_rain12h"} = $wx{"RR12"}; $cread{$prefix."_rain12h"} = $wx{"RR12"};
$cread{$prefix."_rain24h"} = $wx{"RR24"}; $cread{$prefix."_rain24h"} = $wx{"RR24"};
$cread{$prefix."_snow"} = $wx{"SSS"}; $cread{$prefix."_snow"} = $wx{"SSS"};
$cread{$prefix."_sunshine"} = $wx{"SSS24"}; $cread{$prefix."_sunshine"} = $wx{"SSS24"};
$cread{$prefix."_solar"} = $wx{"SGLB24"}; $cread{$prefix."_solar"} = $wx{"SGLB24"};
$cread{$prefix."_windDir"} = $wx{"DD"}; $cread{$prefix."_windDir"} = $wx{"DD"};
$cread{$prefix."_windSpeed"} = $wx{"FF"}; $cread{$prefix."_windSpeed"} = $wx{"FF"};
$cread{$prefix."_windPeak"} = $wx{"FX"}; $cread{$prefix."_windPeak"} = $wx{"FX"};
$cread{$prefix."_weather"} = utf8ToLatin1($wx{"Wetter\/Wolken"}); $cread{$prefix."_weather"} = utf8ToLatin1($wx{"Wetter\/Wolken"});
$cread{$prefix."_windGust"} = $wx{"B\xF6en"}; $cread{$prefix."_windGust"} = $wx{"B\xF6en"};
} else { } else {
$cread{$prefix."_stationName"} = "unknown: $myStation"; $cread{$prefix."_stationName"} = "unknown: $myStation";
} }
@ -955,7 +982,13 @@ sub retrieveListCapStations($){
$hash->{file}{dir} = "gds/help/"; $hash->{file}{dir} = "gds/help/";
$hash->{file}{dwd} = "legend_warnings_CAP_WarnCellsID.csv"; $hash->{file}{dwd} = "legend_warnings_CAP_WarnCellsID.csv";
$hash->{file}{target} = $tempDir."capstations.csv"; $hash->{file}{target} = $tempDir."capstations.csv";
retrieveData($hash,'FILE'); unless(-e $hash->{file}{target}) {
retrieveData($hash,'FILE');
} else {
# read capstationslist once a day
my $alter = time() - (stat($hash->{file}{target}))[9];
retrieveData($hash,'FILE') if ($alter > 86400);
}
} }
sub decodeCAPData($$$){ sub decodeCAPData($$$){
@ -1232,6 +1265,7 @@ sub _retrieveCONDITIONS {
sub _finishedCONDITIONS { sub _finishedCONDITIONS {
my ($name,$file_name,$file_content) = split(/;;;/,shift); my ($name,$file_name,$file_content) = split(/;;;/,shift);
my $hash = $defs{$name}; my $hash = $defs{$name};
return _abortedCONDITIONS($hash) unless $file_content;
@allConditionsData = split(/\$/,$file_content); @allConditionsData = split(/\$/,$file_content);
# fill dropdown list # fill dropdown list
@ -1247,10 +1281,9 @@ sub _finishedCONDITIONS {
$sList =~ s/\s/_/g; # replace spaces in stationName with underscore for list in frontende $sList =~ s/\s/_/g; # replace spaces in stationName with underscore for list in frontende
readingsSingleUpdate($hash, "_dF_conditions",$file_name,0) if(AttrVal($name, "gdsDebug", 0)); readingsSingleUpdate($hash, "_dF_conditions",$file_name,0) if(AttrVal($name, "gdsDebug", 0));
$hash->{GDS_CONDITIONS_READ} = time(); $hash->{GDS_CONDITIONS_READ} = int(time());
my $cf = AttrVal($name,'gdsSetCond',''); my $cf = AttrVal($name,'gdsSetCond','');
my $up = time() - $fhem_started; GDS_GetUpdate($hash) if $cf;
GDS_GetUpdate($hash) if $cf; #if ($cf && $up < 120);
DoTrigger($name,"REREADCONDITIONS",1); DoTrigger($name,"REREADCONDITIONS",1);
} }
sub __first_index ($@) { sub __first_index ($@) {
@ -1283,7 +1316,7 @@ sub _retrieveCAPDATA {
my $datafile; my $datafile;
my $targetDir = $tempDir.$name."_alerts.dir"; my $targetDir = $tempDir.$name."_alerts.dir";
my $targetFile = "$targetDir/$name"."_alerts.zip"; my $targetFile = $tempDir.$name."_alerts.zip";
mkdir $targetDir unless -d $targetDir; mkdir $targetDir unless -d $targetDir;
eval { eval {
@ -1327,7 +1360,7 @@ sub _retrieveCAPDATA {
# unzip # unzip
my $zip = Archive::Extract->new( archive => $targetFile ); my $zip = Archive::Extract->new( archive => $targetFile );
my $ok = $zip->extract( to => $targetDir); my $ok = $zip->extract( to => $targetDir);
Log3($name, 1, "GDS $name: error ".$zip->error()) unless $ok; Log3($name, 5, "GDS $name: error ".$zip->error()) unless $ok;
# delete archive file # delete archive file
unlink $targetFile; unlink $targetFile;
@ -1359,7 +1392,7 @@ sub _finishedCAPDATA {
return; return;
} }
readingsSingleUpdate($hash, "_dF_alerts",$datafile,0) if(AttrVal($name, "gdsDebug", 0)); readingsSingleUpdate($hash, "_dF_alerts",$datafile,0) if(AttrVal($name, "gdsDebug", 0));
$hash->{GDS_CAPDATA_READ} = time(); $hash->{GDS_CAPDATA_READ} = int(time());
DoTrigger($name,"REREADALERTS",1); DoTrigger($name,"REREADALERTS",1);
} }
sub _abortedCAPDATA { sub _abortedCAPDATA {
@ -1489,7 +1522,7 @@ sub _retrieveFORECAST {
my $passive = AttrVal($name, "gdsPassiveFtp", 0); my $passive = AttrVal($name, "gdsPassiveFtp", 0);
my $dir = "gds/specials/forecasts/tables/germany/"; my $dir = "gds/specials/forecasts/tables/germany/";
my $ret; my $ret = "";
eval { eval {
my $ftp = Net::FTP->new( $host, my $ftp = Net::FTP->new( $host,
@ -1536,12 +1569,11 @@ sub _finishedFORECAST {
my ($fn,$fc) = split(/\:/,$l); my ($fn,$fc) = split(/\:/,$l);
$allForecastData{$fn} = $fc; $allForecastData{$fn} = $fc;
} }
$hash->{GDS_FORECAST_READ} = time(); $hash->{GDS_FORECAST_READ} = int(time());
getListForecastStations($hash);
my $sf = AttrVall($name,'gdsSetForecast','');
my $up = time() - $fhem_started;
GDS_GetUpdate($hash) if $sf; #if ($sf && $up < 120);
DoTrigger($name,"REREADFORECAST",1); DoTrigger($name,"REREADFORECAST",1);
getListForecastStations($hash);
my $sf = AttrVall($name,'gdsSetForecast',0);
GDS_GetUpdate($hash) if $sf;
} }
sub _abortedFORECAST { sub _abortedFORECAST {
my ($hash) = shift; my ($hash) = shift;
@ -1561,21 +1593,17 @@ sub retrieveForecasts($$@) {
my $name = $hash->{NAME}; my $name = $hash->{NAME};
# extract region and station name # extract region and station name
if (!defined($a[2])) { return unless defined($a[2]);
return;
} my ($area,$station) = split(/\//,$a[2]);
my $i = index($a[2], '/'); return unless $station;
if ($i <= 0 ) {
return;
}
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
my ($dataFile, $found, $line, %fread, $k, $v, $data); my ($dataFile, $found, $line, %fread, $k, $v, $data);
my $area = utf8ToLatin1(substr($a[2], 0, $i)); $area = utf8ToLatin1($area);
my $station = utf8ToLatin1(substr($a[2], $i+1)); $station =~ s/_/ /g; # replace underscore in station name by space
$station =~ s/_/ /g; # replace underscore in station name by space my $searchLen = length($station);
my $searchLen = length($station); %fread = ();
%fread = ();
# define fetch scope (all forecasts or single forecast) # define fetch scope (all forecasts or single forecast)
my $fc = 0; my $fc = 0;
@ -1706,9 +1734,9 @@ sub retrieveForecasts($$@) {
} else { } else {
$b[3] = ' '; $b[3] = ' ';
} }
$fread{$prefix."_stationName"} = $area.'/'.$b[0]; $fread{$prefix."_stationName"} = $area.'/'.latin1ToUtf8($b[0]);
$fread{$prefix.$day.$tempLabel} = $b[1]; $fread{$prefix.$day.$tempLabel} = $b[1];
$fread{$prefix.$day."_weather".$timeLabel} = $b[2]; $fread{$prefix.$day."_weather".$timeLabel} = latin1ToUtf8($b[2]);
$fread{$prefix.$day."_windGust".$timeLabel} = $b[3]; $fread{$prefix.$day."_windGust".$timeLabel} = $b[3];
if ($fc != 3) { if ($fc != 3) {
$fread{$prefix.$day."_weekday"} = $fcWeekday; $fread{$prefix.$day."_weekday"} = $fcWeekday;
@ -1743,7 +1771,8 @@ sub retrieveForecasts($$@) {
my $temp = $fread{$prefix.$day.$tempLabel}; my $temp = $fread{$prefix.$day.$tempLabel};
if (defined($temp) && substr($temp, 0, 2) eq '--') { if (defined($temp) && substr($temp, 0, 2) eq '--') {
if (defined($copyTimeLabel)) { if (defined($copyTimeLabel)) {
$fread{$prefix.$day.$tempLabel} = utf8ToLatin1(ReadingsVal($name, $prefix.$copyDay.$tempLabel, '---')); # $fread{$prefix.$day.$tempLabel} = utf8ToLatin1(ReadingsVal($name, $prefix.$copyDay.$tempLabel, '---'));
$fread{$prefix.$day.$tempLabel} = ReadingsVal($name, $prefix.$copyDay.$tempLabel, '---');
} else { } else {
# today noon/night and 3rd day is undefined # today noon/night and 3rd day is undefined
$fread{$prefix.$day.$tempLabel} = ' '; $fread{$prefix.$day.$tempLabel} = ' ';
@ -1753,7 +1782,8 @@ sub retrieveForecasts($$@) {
if (defined($weather) && substr($weather, 0, 2) eq '--') { if (defined($weather) && substr($weather, 0, 2) eq '--') {
if (defined($copyTimeLabel)) { if (defined($copyTimeLabel)) {
$fread{$prefix.$day."_weather".$timeLabel} = $fread{$prefix.$day."_weather".$timeLabel} =
utf8ToLatin1(ReadingsVal($name, $prefix.$copyDay."_weather".$copyTimeLabel, '---')); # utf8ToLatin1(ReadingsVal($name, $prefix.$copyDay."_weather".$copyTimeLabel, '---'));
ReadingsVal($name, $prefix.$copyDay."_weather".$copyTimeLabel, '---');
} else { } else {
# today noon/night and 3rd day is undefined # today noon/night and 3rd day is undefined
$fread{$prefix.$day."_weather".$timeLabel} = ' '; $fread{$prefix.$day."_weather".$timeLabel} = ' ';
@ -1763,7 +1793,8 @@ sub retrieveForecasts($$@) {
if (defined($windGust) && substr($windGust, 0, 2) eq '--') { if (defined($windGust) && substr($windGust, 0, 2) eq '--') {
if (defined($copyTimeLabel)) { if (defined($copyTimeLabel)) {
$fread{$prefix.$day."_windGust".$timeLabel} = $fread{$prefix.$day."_windGust".$timeLabel} =
utf8ToLatin1(ReadingsVal($name, $prefix.$copyDay."_windGust".$copyTimeLabel, '---')); # utf8ToLatin1(ReadingsVal($name, $prefix.$copyDay."_windGust".$copyTimeLabel, '---'));
ReadingsVal($name, $prefix.$copyDay."_windGust".$copyTimeLabel, '---');
} else { } else {
# today noon/night and 3rd day is undefined # today noon/night and 3rd day is undefined
$fread{$prefix.$day."_windGust".$timeLabel} = ' '; $fread{$prefix.$day."_windGust".$timeLabel} = ' ';
@ -1780,7 +1811,7 @@ sub retrieveForecasts($$@) {
if($v =~ m/^--/) {delete($defs{$name}{READINGS}{$k}); next;}; if($v =~ m/^--/) {delete($defs{$name}{READINGS}{$k}); next;};
unless(length(trim($v))) {delete($defs{$name}{READINGS}{$k}); next;}; unless(length(trim($v))) {delete($defs{$name}{READINGS}{$k}); next;};
# readingsBulkUpdate($hash, $k, latin1ToUtf8($v)); # readingsBulkUpdate($hash, $k, latin1ToUtf8($v));
readingsBulkUpdate($hash, $k, $v); readingsBulkUpdate($hash, $k, utf8ToLatin1($v));
} }
readingsEndUpdate($hash, 1); readingsEndUpdate($hash, 1);
} }
@ -1800,6 +1831,7 @@ sub getListForecastStations($) {
last; last;
}; };
} }
next unless $data;
my @data = split(/\$/,$data); my @data = split(/\$/,$data);
splice(@data, 0,2); splice(@data, 0,2);
splice(@data,-2); splice(@data,-2);
@ -1831,6 +1863,10 @@ sub getListForecastStations($) {
# #
################################################################################################### ###################################################################################################
# #
# 2015-10-25 public RC5 published, SVN #
#
# 2015-10-24 public RC3 published, SVN #9627
#
# 2015-10-13 changed getListForecastStations() completed # 2015-10-13 changed getListForecastStations() completed
# changed retrieveForecasts() completed # changed retrieveForecasts() completed
# added DoTrigger() according to reread # added DoTrigger() according to reread