[RELEASE] Weather Plus Addon

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
schumi2004 Offline
Fan
Posts: 641
Joined: Aug 2011
Reputation: 4
Post: #911
Is this plugin still updated?

I tried the fix mentioned , removing 128x128 from code, but still no weather icons.
Any suggestions?

[Image: watched-clearlogo.jpg]
find quote
pkscuot Offline
Fan
Posts: 602
Joined: Jan 2011
Reputation: 11
Location: Honolulu, HI
Post: #912
(2012-04-29 15:15)schumi2004 Wrote:  Is this plugin still updated?

I don't think so. The author indicated a little while back that he doesn't have time anymore, and I haven't heard anyone step up to maintain it.
find quote
sector72 Offline
Junior Member
Posts: 6
Joined: Apr 2012
Reputation: 0
Post: #913
Though the wunderground addon guys are making good progress, the addon doesn't work well with the skin that I use so I still generally use weatherplus. With that in mind, lately I've been getting some script errors when with version 3.0.1 using noaa.gov as the source.

Looks like maybe NOAA has optimized their output and is only spitting out seasonal precip types. Here's a quick patch to accomodate:

Code:
--- noaa.py.orig    2012-05-05 23:59:07.981897675 -0400
+++ noaa.py    2012-05-06 00:03:16.748459074 -0400
@@ -618,36 +618,39 @@
            else:
                outlook = "Rain Likely"
            icon += "rain"
-        elif ( snow[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Snow"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Snow"
-                icon += "chance"
-            else:
-                outlook = "Snow Likely"
-            icon += "snow"
-        elif ( freezing_rain[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Freezing Rain"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Freezing Rain"
-                icon += "chance"
-            else:
-                outlook = "Freezing Rain Likely"
-            icon += "freeze"
-        elif ( sleet[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Sleet"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Sleet"
-                icon += "chance"
-            else:
-                outlook = "Sleet Likely"            
-            icon += "sleet"        
+        elif ( snow ):
+            if ( snow[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Snow"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Snow"
+                    icon += "chance"
+                else:
+                    outlook = "Snow Likely"
+                icon += "snow"
+        elif ( freezing_rain ):
+            if ( freezing_rain[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Freezing Rain"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Freezing Rain"
+                    icon += "chance"
+                else:
+                    outlook = "Freezing Rain Likely"
+                icon += "freeze"
+        elif ( sleet ):
+            if ( sleet[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Sleet"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Sleet"
+                    icon += "chance"
+                else:
+                    outlook = "Sleet Likely"            
+                icon += "sleet"        
        elif ( int(wind[count]) > 20 ):
            icon = "windy"
            outlook = "Windy"

I suspect the 'thunder' stanza might need a similar change this winter...
find quote
hentai23 Offline
Fan
Posts: 649
Joined: Sep 2010
Reputation: 0
Location: another universe ..it would seem xD
Post: #914
i hope someone continues this addon its great , would be a real shame, or incorporate its features into wunderground , one or the other dont matter Wink
(This post was last modified: 2012-05-09 20:47 by hentai23.)
find quote
argh! Offline
Fan
Posts: 321
Joined: Jun 2011
Reputation: 0
Post: #915
I'm having some trouble getting this addon to display.

I install it, and it's listed as Enabled. But when i select Weather from the main menu, i still see the default Weather Underground forecast. I fllowed the install instructions but I still cannot see Weather Plus.. any help would be much appreciated.
find quote
sector72 Offline
Junior Member
Posts: 6
Joined: Apr 2012
Reputation: 0
Post: #916
Looks like NOAA has made some more changes that breaks a few things. Here's is a patch against weatherplus v3.0.1 to get things working again (cumulative with the patch I posted on 6 may 2012...):

Code:
--- noaa.py.orig    2012-07-07 00:17:01.658625504 -0400
+++ noaa.py    2012-07-07 00:16:53.730804446 -0400
@@ -229,7 +229,7 @@
    pattern_current_heatindex = "<td><b>Heat Index</b>:</td>[^<]+<td align=[^>]+>(.+?)\&deg\;F"

    pattern_current_block = "<data type=\"current observations\">"
-    pattern_current_icon = "<icon-link>http://forecast.weather.gov/images/wtf/([^\d\s]+).jpg"
+    pattern_current_icon = "<icon-link>http://forecast.weather.gov/images/wtf/([^\d\s]+).png"
    pattern_current_temp = "<temperature type=\"apparent\"[^>]+>(.+?)</temperature>"
    pattern_current_dew = "<temperature type=\"dew point\"[^>]+>(.+?)</temperature>"
    pattern_current_humidity = "<humidity[^>]+>(.+?)</humidity>"
@@ -239,17 +239,18 @@
    pattern_current_pressure = "<pressure type=\"barometer\"[^>]+>(.+?)</pressure>"
    pattern_current_brief = "<weather-conditions weather-summary=\"([^\"]+)\"/>"

-    pattern_current_wind = "<td><b>Wind Speed</b>:</td>[^<]+<td align=[^>]+>(.+?)</td>"
+    pattern_current_wind   = "<li><span[^>]+>Wind Speed</span>(.+?)</li>"
    pattern_current_wind_2 = "<td><b>Wind Speed</b>:</td><td align=[^>]+>(.+?)<br>"
         pattern_precip_amount = "no-repeat;\">([0-9]+)\%</td><td class=\"weekly_wind\">"
-        pattern_outlook = ": </b>(.+?)<br><br>"
+    pattern_outlook_block = "class=\"point-forecast-7-day\"(.+?)</ul>"
+        pattern_outlook = "</span>(.+?)</li>"
    pattern_sunrise = "sunrise will occur around (.+?)am"
    pattern_sunset = "sunset will occur around (.+?)pm"
    pattern_wind = "<td class=\"weekly_wind\"><img class=\"wind\" src=\"image/(.+?).png\" width=\"50\" height=\"22\" alt=\"[^\"]+\" /><br />(.+?)</td>"
    pattern_xml_high_temp = "<value>(.[0-9]+)</value>"
    pattern_xml_brief = "<weather-conditions weather-summary=\"(.+?)\"/>"    
    pattern_xml_days = "<start-valid-time period-name=\"(.+?)\">"
-    pattern_icon = "<icon-link>(.+?).jpg</icon-link>"
+    pattern_icon = "<icon-link>(.+?).png</icon-link>"

    pattern_alerts = "showsigwx.php[?]([^\"]+)\"><[^>]+>([^<]+)<"

@@ -282,7 +283,7 @@
    current_icon = icondir.get( current_icon, "na" ) + ".png"
    for count in range(0, 13-ampm):
        icon += [ icondir.get ( re.findall( "([^\d\s]+)", icons[count].split("/")[-1] )[0], "na" ) ]
-    # printlog("NOAA icons : " + ",".join(icon))
+    #printlog("NOAA icons : " + ",".join(icon))

         # enumerate thru and combine the day with it's forecast
         if ( len( icon ) ):
@@ -348,7 +349,8 @@
             precip_amount = re.findall( pattern_precip_amount, htmlSource_2 )

             # fetch forecasts
-            outlook = re.findall( pattern_outlook, htmlSource )
+        outlook_block = re.findall( pattern_outlook_block, htmlSource, re.DOTALL )
+            outlook = re.findall( pattern_outlook, outlook_block[0] )

             # fetch extra info
        pressure = re.findall( pattern_current_pressure, current )[0]
@@ -377,10 +379,11 @@
             for count in range(0, 13):
                 # make icon path
                 try :
-                  iconpath = "/".join( [ "special://temp", "weather", "128x128", icon[ count ] + ".png" ] )
+          printlog( "ICON " + str(count) + ": " + icon[count] + ".png" )
+                  iconpath = "/".join( [ "special://temp", "weather", icon[ count ] + ".png" ] )
                 except :
                   printlog("Icon is not available")
-                  iconpath = "/".join( [ "special://temp", "weather", "128x128", "na.png" ] )
+                  iconpath = "/".join( [ "special://temp", "weather", "na.png" ] )
        # printlog( iconpath )
                 # date calculation for 6 day
        year = time.strftime( "%Y", time.localtime() )
@@ -618,36 +621,39 @@
            else:
                outlook = "Rain Likely"
            icon += "rain"
-        elif ( snow[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Snow"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Snow"
-                icon += "chance"
-            else:
-                outlook = "Snow Likely"
-            icon += "snow"
-        elif ( freezing_rain[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Freezing Rain"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Freezing Rain"
-                icon += "chance"
-            else:
-                outlook = "Freezing Rain Likely"
-            icon += "freeze"
-        elif ( sleet[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Sleet"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Sleet"
-                icon += "chance"
-            else:
-                outlook = "Sleet Likely"            
-            icon += "sleet"        
+        elif ( snow ):
+            if ( snow[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Snow"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Snow"
+                    icon += "chance"
+                else:
+                    outlook = "Snow Likely"
+                icon += "snow"
+        elif ( freezing_rain ):
+            if ( freezing_rain[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Freezing Rain"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Freezing Rain"
+                    icon += "chance"
+                else:
+                    outlook = "Freezing Rain Likely"
+                icon += "freeze"
+        elif ( sleet ):
+            if ( sleet[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Sleet"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Sleet"
+                    icon += "chance"
+                else:
+                    outlook = "Sleet Likely"            
+                icon += "sleet"        
        elif ( int(wind[count]) > 20 ):
            icon = "windy"
            outlook = "Windy"
@@ -670,4 +676,4 @@
            icon += "cloudy"
            outlook = "Cloudy"
        hour_temp += 1
-        self.forecast += [ ( _localize_unit( hour, "time" ), dates[ count ], "special://temp/weather/128x128/%s.png" % icondir.get(icon, "na"), _localize_unit(temperature[ count ]), outlook, _english_localize_unit( feelslike ), precip[ count ], humidity[ count ], windir.get( wind_direction[ count ] ), _localize_unit( wind[ count ]+" mph", "speed" ), "" ) ]        
+        self.forecast += [ ( _localize_unit( hour, "time" ), dates[ count ], "special://temp/weather/%s.png" % icondir.get(icon, "na"), _localize_unit(temperature[ count ]), outlook, _english_localize_unit( feelslike ), precip[ count ], humidity[ count ], windir.get( wind_direction[ count ] ), _localize_unit( wind[ count ]+" mph", "speed" ), "" ) ]

There's still some weirdness with a missing icon or two that I haven't yet fixed (mostly because I haven't bothered trying to understand how NOAA icons get mapped to XBMC icons) but this patch should be sufficient to stop the script failure messages when using NOAA as the weather source...
find quote
sector72 Offline
Junior Member
Posts: 6
Joined: Apr 2012
Reputation: 0
Post: #917
Another small patch for the NOAA stuff. This one fixes alert-fetching and the current condition icon. Diff was generated against the patched noaa.py from my July 7 post so you'll need to apply that patch first...

Code:
--- noaa.py.jrm2    2012-07-09 23:05:37.753203712 -0400
+++ noaa.py    2012-07-09 23:57:03.228370708 -0400
@@ -252,7 +252,7 @@
    pattern_xml_days = "<start-valid-time period-name=\"(.+?)\">"
    pattern_icon = "<icon-link>(.+?).png</icon-link>"

-    pattern_alerts = "showsigwx.php[?]([^\"]+)\"><[^>]+>([^<]+)<"
+    pattern_alerts = "showsigwx.php[?]([^\"]+)\">([^<]+)<"

    # fetch alerts
    self.alerts = re.findall( pattern_alerts, htmlSource )
@@ -280,7 +280,7 @@
    # fetch icons
    icon = []
    icons = re.findall( pattern_icon, xmlSource )
-    current_icon = icondir.get( current_icon, "na" ) + ".png"
+    current_icon = icondir.get( current_icon.split("/")[-1], "na" ) + ".png"
    for count in range(0, 13-ampm):
        icon += [ icondir.get ( re.findall( "([^\d\s]+)", icons[count].split("/")[-1] )[0], "na" ) ]
    #printlog("NOAA icons : " + ",".join(icon))
find quote
vijayk416 Offline
Senior Member
Posts: 191
Joined: Apr 2011
Reputation: 1
Post: #918
Can someone please post an update to the repo that incorporates these patches? Manual patching is not for me and I imagine not for a lot of folks who would like to make use of this fine add-on.
find quote
codex70 Offline
Junior Member
Posts: 48
Joined: Feb 2011
Reputation: 0
Post: #919
(2011-12-27 04:11)ronie Wrote:  
pkscuot Wrote:wunderground isn't available as a source in Weather+ any longer. Apparently when the XBMC folks stuck the deal with Weather Underground to do the weather feed for XBMC Eden it apparently precluded any other plugin provider from using Weather Underground as a data source.

i hope you don't mind if i step in for a sec to correct this piece of information.

wundeground has provided xbmc free access to their api and this is a gesture team xbmc appreciates very much.
you can read all about it here:
http://xbmc.org/theuni/2011/12/10/welcom...derground/

the problem we had with weatherplus was the fact that it was scraping the wunderground website.

it's like, someone trusts you with the key to their front-door and we would allow someone else to throw in the window to get inside at the same time.
that just didn't feel right to us.

i have discussed our concern about this with brightsr in PM and we have agreed to work together on a way to give weatherplus access to the wunderground weather data.

it's something (besides a dozen of other things) i'm currently working on.
i have it partially working already locally, so if all goes well, weatherplus users should be able to select wunderground as their service provider again in the near future.

Is there any news on this? I love the extra functionality weather plus gives, but currently it doesn't work at all in the UK. If we could use the wunderground data then that would be perfect.
find quote
ronie Offline
Team-XBMC Member
Posts: 8,254
Joined: Jan 2009
Reputation: 108
Post: #920
(2012-09-11 10:30)codex70 Wrote:  
(2011-12-27 04:11)ronie Wrote:  
pkscuot Wrote:wunderground isn't available as a source in Weather+ any longer. Apparently when the XBMC folks stuck the deal with Weather Underground to do the weather feed for XBMC Eden it apparently precluded any other plugin provider from using Weather Underground as a data source.

i hope you don't mind if i step in for a sec to correct this piece of information.

wundeground has provided xbmc free access to their api and this is a gesture team xbmc appreciates very much.
you can read all about it here:
http://xbmc.org/theuni/2011/12/10/welcom...derground/

the problem we had with weatherplus was the fact that it was scraping the wunderground website.

it's like, someone trusts you with the key to their front-door and we would allow someone else to throw in the window to get inside at the same time.
that just didn't feel right to us.

i have discussed our concern about this with brightsr in PM and we have agreed to work together on a way to give weatherplus access to the wunderground weather data.

it's something (besides a dozen of other things) i'm currently working on.
i have it partially working already locally, so if all goes well, weatherplus users should be able to select wunderground as their service provider again in the near future.

Is there any news on this? I love the extra functionality weather plus gives, but currently it doesn't work at all in the UK. If we could use the wunderground data then that would be perfect.

well yes, as promised above, i've added a module to the wunderground addon that can be used by other addons to fetch weather data from the wunderground api.

if anyone wishes to use it, shoot me a PM and i'll help you out

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply