Sun Tracker and Yahoo Weather = random conditions

Questions and comments specific to a particular plugin should go here.
Post Reply
davidmark
Experienced User
Posts: 85
Joined: Thu Jan 01, 2015 5:25 pm

Sun Tracker and Yahoo Weather = random conditions

Post by davidmark » Thu Nov 19, 2015 4:44 am

Have noticed flaky behavior out of this plug-in in past, but lately it's particularly bad. Appears to be trying to scrape data out of Yahoo Weather HTML. Notes indicate it used to use Google Weather (don't know if it was used any better).

It's using another library to download the conditions and that library supports real data (e.g. NOAA XML), as opposed to parsed HTML BS. Any plans to change this or do I have to hack it myself? Seems crazy to try to do weather the way it is. Particularly irritating if monitoring for state changes. Temperature fluctuates wildly every few minutes according to this thing. :(

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Sun Tracker and Yahoo Weather = random conditions

Post by krambriw » Thu Nov 19, 2015 5:17 am

but lately it's particularly bad
Interesting, I have noticed a couple of times that the reported weather condition has changed frequently in a few minutes. Maybe Yahoo! Weather service has some problems, maybe temporarily, since this has been working ok for years now. I did use Google earlier but the api stopped working long time ago.

The NOAA is for the US? Is not useful for us in Europe...

davidmark
Experienced User
Posts: 85
Joined: Thu Jan 01, 2015 5:25 pm

Re: Sun Tracker and Yahoo Weather = random conditions

Post by davidmark » Thu Nov 19, 2015 5:19 am

pywapi returns this:

Code: Select all

weather_data['html_description'] = dom.getElementsByTagName('item')[0].getElementsByTagName('description')[0].firstChild.data
...Sun Tracker uses it (!), despite all the other data being in the same hash (or whatever Python calls it). Is this supposed to be a joke? :(

The pywapi README shows examples that get the temperature and other data directly, rather than trying to parse the HTML.

https://code.google.com/p/python-weather-api/#Script

Here's the problem in CheckWeatherCondition:

Code: Select all

wd = self.weather_data['html_description'].split(':')[2].split('>')[2]
currCondition = wd[1:wd.find(',')]
Last edited by davidmark on Thu Nov 19, 2015 5:25 am, edited 3 times in total.

davidmark
Experienced User
Posts: 85
Joined: Thu Jan 01, 2015 5:25 pm

Re: Sun Tracker and Yahoo Weather = random conditions

Post by davidmark » Thu Nov 19, 2015 5:20 am

krambriw wrote:
but lately it's particularly bad
Interesting, I have noticed a couple of times that the reported weather condition has changed frequently in a few minutes. Maybe Yahoo! Weather service has some problems, maybe temporarily, since this has been working ok for years now. I did use Google earlier but the api stopped working long time ago.

The NOAA is for the US? Is not useful for us in Europe...
It's always been flaky here. Same symptom of alternating conditions. I found the problem; see follow-up.

As for Europe, make it configurable: Yahoo, NOAA or whatever. ;)

davidmark
Experienced User
Posts: 85
Joined: Thu Jan 01, 2015 5:25 pm

Re: Sun Tracker and Yahoo Weather = random conditions

Post by davidmark » Thu Nov 19, 2015 5:47 am

Further inspection of the code indicates Yahoo could be partly to blame, at least for temperature, etc. They definitely suck. :(

That conditions HTML parse should go though. IIRC, I was watching that for changes and it recently changed every five minutes like clockwork (and temperature, wind, etc. fluctuated wildly as well). Used to happen less often. Hard to say why without logging the HTML description. Personally, I'd ignore the HTML description. ;)

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Sun Tracker and Yahoo Weather = random conditions

Post by krambriw » Thu Nov 19, 2015 10:18 am

It is definitely Yahoo that has some problems. Here it is raining but Yahoo says Fair / Clear

I would like to wait and see if this gets sorted out before I dive into it. If you like, you may go ahead and make your changes.

SupahNoob
Posts: 21
Joined: Mon Jun 29, 2015 11:32 pm

Re: Sun Tracker and Yahoo Weather = random conditions

Post by SupahNoob » Sat Nov 21, 2015 9:40 pm

For anything weather related, I've always been a fan of Wunderground .. it might be against the spirit of a free-level API, but you could always sign up for 4-5 accounts if you're worried about hitting the rate limit for a particular plugin. Still, even with some of our more popular plugins seeing 100+ downloads, that's still 5 calls per user per day per API key.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Sun Tracker and Yahoo Weather = random conditions

Post by krambriw » Sun Nov 22, 2015 9:35 am

I will definitely monitor the situation but I will not panic. Actually, all iPhone users using the default Weather app are affected if YAHOO! Weather is inaccurate. So they will for sure have to fix this.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Sun Tracker and Yahoo Weather = random conditions

Post by krambriw » Sun Nov 22, 2015 1:19 pm

Well, after analyzing during the day, it seems that Yahoo weather api is completely useless as it is right now. Luckily, there is a new version of pywapi.py that supports Weather.com that seems to be both globally useful and reliable. See the SunTracker plugin thread where I describe the updated version of the plugin now available.

Post Reply