GoCubs;539940 Wrote: 
> I think in your case your wunderground station is providing its raw data
> in Celsius.  The plugin has no way of knowing for certain what format
> the raw data is in so it assumes Fahrenheit.
> 
> -Greg

The %e + %E thing depends on your preferences on wunderground.com.

Try this link:
http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=MMWQKK&format=1

If you see "Time,TemperatureC,DewpointC..." in the first line then you
could edit your preferences here:
http://www.wunderground.com/member/membersettings.html?page=prefs so
you're no longer using Metric.

Save your preferences then re-try the link above, and you'll see
"Time,TemperatureF,DewpointF..." in the first line.

And then, %e and %E will work as expected.

A quick fix for %e + %E in the code (but not other items like windspeed
which are also dependent on your wunderground settings)

sub gotWunderground {  #Weather data was received
        my $http = shift;
        
        my $params = $http->params();
        my $client = $params->{'client'};
        my $refreshItem = $params->{'refreshItem'};

$log->info("got " . $http->url());
        my $content = $http->content();
        my $metric = ($content =~ m/TemperatureC/);

        my @ary=split /\n/,$content; #break large string into array

        #$::d_plugins && msg("WU DATA: ".$ary[scalar(@ary)-3]."\n");

        if($ary[scalar(@ary)-3] =~
/^20\d\d-.*?,(.*?),(.*?),(.*?),(.*?),.*?,(.*?),.*?,(.*?),.*?,(.*?),(.*?),.*,/)
{
                if ($metric) {
                        $wetData{'wu_temperatureF'} = CtoF($1);
                        $wetData{'wu_temperatureC'} = $1; 
                        
                        $wetData{'wu_dewpointF'} = CtoF($2);
                        $wetData{'wu_dewpointC'} = $2;
                } else {
                        $wetData{'wu_temperatureF'} = $1;
                        $wetData{'wu_temperatureC'} = FtoC($1); 
                        
                        $wetData{'wu_dewpointF'} = $2;
                        $wetData{'wu_dewpointC'} = FtoC($2);
                }


-- 
stevekgoodwin
------------------------------------------------------------------------
stevekgoodwin's Profile: http://forums.slimdevices.com/member.php?userid=37550
View this thread: http://forums.slimdevices.com/showthread.php?t=14327

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to