Kodi Community Forum

Full Version: Weather.NOAA (aka National Weather Service)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
This Kodi plugin fetches weather reports from the National Weather Service https://www.weather.gov (eg NOAA).  
NOAA  provides weather forecasts for the USA only

https://github.com/randallspicher/weather.noaa

Available from main Kodi repo for Matrix, or latest (beta) releases can be pulled from my repo, (using either the Matrix or the Leia version)
Note weather.gov only provides weather forecasts for USA. The forecasts can be extremely localized (use the map-click feature from the weather.gov website to get the latitude/longitude for the exact location you want the forecast for.)

weather.gov provides separate forecasts for Days and Nights, rather than just one per day. It also provides much more verbose forecasts. It requires skin support to make use of the additional features.

Features:
  • Provides a hyper-localized weather forecast.
  • Provides separate "Daytime" and "Nighttime" forecasts (that is how the NWS do their forecasts)
  • Provides a more detailed, verbose textual daily forecast (requires skin support)
  • Provides the NWS weather icons, which contain a lot more info than the kodi built-in icons (example, split icons for when the weather changes during the forecast, and % rain or % snow indicators, etc) (requires skin support)
  • Provides the NWS weather emergency alerts (requires skin support)
  • Provides access to various NOAA weather satellite imagery.

Latest beta version (Matrix):
https://github.com/randallspicher/randal....10-b5.zip
This looks interesting. Can you provide details as to exactly how to enter the info in the configuration fields. Thanks.
(2021-03-25, 20:00)wags1 Wrote: [ -> ]This looks interesting. Can you provide details as to exactly how to enter the info in the configuration fields. Thanks.
Go to https://forecast.weather.gov, and find your location on the map. (The map will show a colored area for the forcast coverage block) Make a note of lat= and lon= values from the url after you click on the map.  (only needed up to 4 decimal places).  You probably can use google maps as well, although weather.gov will outline the actual forecast area.  Note, if you actually live in Canada, or Mexico, or Europe, etc, NWS will not work for you. It is for USA only.

In Matrix, the Latitude,Longitude will bring up 2 dialogs (one for Latitude, and a Second for Longitude).   In the continental US, Latitude will be a positive number, likely somewhere between 38.0000 (southern coast) and 48.0000 (Washnigton, Minnisota).   Latitude will be a negative number somewhere in the range of  -70.0000 (east coast) to -123.000 (west coast)  2 or 3 decimal places are probably sufficient to select the specific forecast area you want, I usually use 4 myself.

If it's the first location you've added, you should see a popup right away asking you to select your preferred weather station for the current conditions (probably the nearest local airport).  And it will automatically look up everything else it needs (such as your weather alert zone,  radar, etc, which are mostly hidden fields).  You can also click the "Selected Station" option in the settings if you later change your location (latitude,longitude), or just want to pick a different current-weather source (if the first weather station you pick isn't returning data, or give crappy data for the "current conditions", you may need to choose a second option)

You can also then change the Location Display Name if you don't like the one that weather.gov found for you. (weather.gov just seems to pick some nearby weather radio broadcast station as the location name)

The Radar map is automatically selected (the NWS radar station that is responsible for your local forecast).  There used to be better looking radar maps, but weather.gov changed their radar data and stopped providing most of the maps as simple images (changing to a complicated multi-layered mess that is too complicated for kodi to deal with)

If you also want some additional maps, you can go the the advanced settings, and select some satellite imagery.  In Matrix, it will give you a pop-up to select the satellite view and image type, with some nice descriptions. In Leia there's just 2 rotating selectors with the sector code and map type code. (I may back-port that map selector update down to Leia in the future), Matrix also has a larger selection of available satellite images to choose from.

Note as well there are 2 api options (seen in the advanced settings).  api.weather.gov has the most complete data, but sometimes that api goes on the fritz, or stops getting updated on the server, and you can switch to forecast.weather.gov instead (forecast.weather.gov only provides current conditions, and a daily (well, twice daily) forecast, the hourly forecasts and alerts always comes from api.weather.gov.  Note that in normal operation, if api.weather.gov fails to return a response, it will automatically fall back to forecast.weather.gov.
Your repos gives me '404' errors.
(2021-03-26, 05:01)jawilljr Wrote: [ -> ]Your repos gives me '404' errors.

I had the same issue. Just go to GitHub and grab the zip file for his repo (make sure you pick the right one, Leia or Matrix) and use install from zip file and install his repo that way.
(2021-03-26, 05:07)wags1 Wrote: [ -> ]
(2021-03-26, 05:01)jawilljr Wrote: [ -> ]Your repos gives me '404' errors.

I had the same issue. Just go to GitHub and grab the zip file for his repo (make sure you pick the right one, Leia or Matrix) and use install from zip file and install his repo that way.
Thanks...willt ry tomorrow.
@randallspicher Thanks for the info. I put in lat and long based on Google maps for my house as you indicated but I get some failed to parse and failed to fetch messages in the log. Doesn’t seem to be working for me. I’m running Matrix public release.
(2021-03-26, 05:24)wags1 Wrote: [ -> ]@randallspicher Thanks for the info. I put in lat and long based on Google maps for my house as you indicated but I get some failed to parse and failed to fetch messages in the log. Doesn’t seem to be working for me. I’m running Matrix public release.

What are the actual error messages?
does your location (in the settings)  say somethings like   40.1234,-70.1234  (latitude in the 40s, longitude in -70s? )

sounds like I may need to revamp how that's entered if it's giving people trouble. (maybe make it a pop-up dialog where latitude and longitude are entered separately)
(2021-03-26, 05:01)jawilljr Wrote: [ -> ]Your repos gives me '404' errors.

seems the editor pasted in some extra stuff to the end of the url when I pasted them in for some reason.   I've edited to remove the extra bits, so should open up the github page properly now.
Works as described.
But for ex-Europeans in America Smile, upon switching to Celsius, the user gets a mix of values on different scales. The "now" temp in Overview switches to C, but anything Forecast, Daily, Hourly remains in F.
(2021-03-26, 08:27)randallspicher Wrote: [ -> ]
(2021-03-26, 05:24)wags1 Wrote: [ -> ]@randallspicher Thanks for the info. I put in lat and long based on Google maps for my house as you indicated but I get some failed to parse and failed to fetch messages in the log. Doesn’t seem to be working for me. I’m running Matrix public release.

What are the actual error messages?
does your location (in the settings)  say somethings like   40.1234,-70.1234  (latitude in the 40s, longitude in -70s? )

sounds like I may need to revamp how that's entered if it's giving people trouble. (maybe make it a pop-up dialog where latitude and longitude are entered separately)
Here are the relevant log entries. Please note I entered the data as per your example that you provided above - "for example:   "-73.4215,44.3928"  (4 decimal places is sufficient)"

2021-03-25 23:13:26.340 T:13433    INFO <general>: Python interpreter stopped
2021-03-25 23:13:35.486 T:13037    INFO <general>: WEATHER: Downloading weather
2021-03-25 23:13:35.488 T:13443    INFO <general>: initializing python engine.
2021-03-25 23:13:36.299 T:13443   ERROR <general>: failed to parse json: https://api.weather.gov/points/-75.7224,49.5705
2021-03-25 23:13:36.299 T:13443   ERROR <general>: failed to fetch : https://api.weather.gov/points/-75.7224,49.5705
2021-03-25 23:13:36.500 T:13443   ERROR <general>: failed to parse json: https://api.weather.gov/alerts/active/zone/
2021-03-25 23:13:36.500 T:13443   ERROR <general>: failed to fetch : https://api.weather.gov/alerts/active/zone/
2021-03-25 23:13:36.506 T:13443   ERROR <general>: failed to get proper alert response https://api.weather.gov/alerts/active/zone/
2021-03-25 23:13:36.662 T:13443   ERROR <general>: failed to parse json: https://api.weather.gov/stations//observations/latest
2021-03-25 23:13:36.662 T:13443   ERROR <general>: failed to fetch : https://api.weather.gov/stations//observations/latest
2021-03-25 23:13:36.667 T:13443   ERROR <general>: failed to find weather data from : https://api.weather.gov/stations//observations/latest
2021-03-25 23:13:36.667 T:13443   ERROR <general>: None
2021-03-25 23:13:36.667 T:13443   ERROR <general>: failed to parse json: 
2021-03-25 23:13:36.667 T:13443   ERROR <general>: failed to fetch : 
2021-03-25 23:13:36.667 T:13443   ERROR <general>: failed to find weather data from : 
2021-03-25 23:13:36.667 T:13443   ERROR <general>: None
2021-03-25 23:13:37.270 T:13443   ERROR <general>: failed to retrieve weather data from : https://forecast.weather.gov/MapClick.ph...tType=json
2021-03-25 23:13:37.270 T:13443   ERROR <general>: {'success': False, 'message': 'There was an error with your request'}
2021-03-25 23:13:37.270 T:13443   ERROR <general>: failed to parse json: 
2021-03-25 23:13:37.271 T:13443   ERROR <general>: failed to fetch : 
2021-03-25 23:13:37.271 T:13443   ERROR <general>: failed to find proper hourly weather from 
2021-03-25 23:13:37.272 T:13443    INFO <general>: CPythonInvoker(55, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/weather.noaa/default.py): script successfully run
2021-03-25 23:13:37.662 T:13443    INFO <general>: Python interpreter stopped
My guess is that this is an issue with correctly entering the lat/long. I'll work on it a bit more and see if I can figure it out.

Update - Using the NOAA weather map I get the following for my location, 40.57N 75.71 w. If I enter that as 40.57,-75.71 into your addon it pulls up weather for Wellsboro, NY which is nowhere near my location in PA. If I use google maps I get, 40.5701,-75.7229. If I put that in again it pulls up Wellsboro, NY. The only way I have found to fix it is to put in 40.5701,-75.7229 in both the first entry and then the second entry in the configuration screen. Once you put it into the second entry then it pulls up the correct list of local forecast locations. It's not clear to me what the first entry in the configuration is actually doing but clearly you need to enter the correct lot/long in both entries.
For clarity, what I'm referencing above is that each location in the app configuration screen seems to have 3 entries:
1 - Latitude,Longitude(to 4 decimal places)
2 - Fetch Forecast Zone and Station
3 - Location Display Name
Your addon doesn't work at all for me?

Using official Matrix, I tried to install your Matrix repo.  I get a pop-up when I try to install the zip that says "failed do to an invalid structure".

So I grabbed the weather.noaa zip.  That installed ok.  I'm in the USA and found my location on the map by entering my zip code where the site provides a search.  There was no little red square like you said but there was a green one.  I copied my lat lon coordinates to the 4th decimal in the configuration separated by a comma as shown in your example. 

I was not presented with "a popup right away asking you to select your preferred weather station for the current conditions (probably the nearest local airport).  And it will automatically look up everything else it needs (such as your weather alert zone,  radar, etc)."  I wasn't presented with anything but I do see 'fetch forecast zone and station' but selecting it does nothing.  I selected 'OK' and returned to the config but still 'fetch forecast zone and station' does nothing.

I entered my lat lon into the 2nd location field as another poster suggested but that didn't make any difference either.  After all the failures, I selected the 'USE' option in the add-on just for the heck of it and went to the Kodi main page Weather tab of my Silvo Aeon Nox skin.  Although it shows I'm using NOAA as my weather service, all my info is identical to the multi weather add-on I've been using.  There is nothing new except the logo for NOAA showing it's in use.  I see none of the detailed screenshots you posted, any options... nothing.

So, I changed my skin to default Estuary thinking my skin simply doesn't support it.  That didn't make any difference either.  I also toggled api.weather.gov vs forecast.weather.gov.  That didn't help either.

Do you see anything in my procedure that I did incorrectly?  Does the Kodi default Estuary skin support your add-on?  I have to believe it works somehow, someway, due to your screenshots.  I have no intentions of using a skin that supports this but I'm curious which skin you used to present this?  Thanks for your contribution and efforts to share this with us.
(2021-03-26, 14:52)wags1 Wrote: [ -> ]
(2021-03-26, 08:27)randallspicher Wrote: [ -> ]
(2021-03-26, 05:24)wags1 Wrote: [ -> ]@randallspicher Thanks for the info. I put in lat and long based on Google maps for my house as you indicated but I get some failed to parse and failed to fetch messages in the log. Doesn’t seem to be working for me. I’m running Matrix public release.

What are the actual error messages?
does your location (in the settings)  say somethings like   40.1234,-70.1234  (latitude in the 40s, longitude in -70s? )

sounds like I may need to revamp how that's entered if it's giving people trouble. (maybe make it a pop-up dialog where latitude and longitude are entered separately)
Here are the relevant log entries. Please note I entered the data as per your example that you provided above - "for example:   "-73.4215,44.3928"  (4 decimal places is sufficient)"

2021-03-25 23:13:37.270 T:13443   ERROR <general>: failed to retrieve weather data from : https://forecast.weather.gov/MapClick.ph...tType=json
2 things:
1.  it needs to be entered as <Lattiude>,<Longitude> into the settings.  Unless you happen to live in Antarctica, you appear to have put in longitude,lattitude.
I'm afraid I typed in the number backwards in my example.  (I've edited to to correct)
2.  latitude 44.3928,  longitude -73.4215 is somewhere in northern quebec (Canada) which is outside the NWS coverage area (US only)

I really think I'll split that up in the settings instead of making it one string, due to the confusion.
(2021-03-27, 20:07)brazen1 Wrote: [ -> ]Your addon doesn't work at all for me?

Using official Matrix, I tried to install your Matrix repo.  I get a pop-up when I try to install the zip that says "failed do to an invalid structure".

So I grabbed the weather.noaa zip.  That installed ok.  I'm in the USA and found my location on the map by entering my zip code where the site provides a search.  There was no little red square like you said but there was a green one.  I copied my lat lon coordinates to the 4th decimal in the configuration separated by a comma as shown in your example. 

I was not presented with "a popup right away asking you to select your preferred weather station for the current conditions (probably the nearest local airport).  And it will automatically look up everything else it needs (such as your weather alert zone,  radar, etc)."  I wasn't presented with anything but I do see 'fetch forecast zone and station' but selecting it does nothing.  I selected 'OK' and returned to the config but still 'fetch forecast zone and station' does nothing.

I entered my lat lon into the 2nd location field as another poster suggested but that didn't make any difference either.  After all the failures, I selected the 'USE' option in the add-on just for the heck of it and went to the Kodi main page Weather tab of my Silvo Aeon Nox skin.  Although it shows I'm using NOAA as my weather service, all my info is identical to the multi weather add-on I've been using.  There is nothing new except the logo for NOAA showing it's in use.  I see none of the detailed screenshots you posted, any options... nothing.

So, I changed my skin to default Estuary thinking my skin simply doesn't support it.  That didn't make any difference either.  I also toggled api.weather.gov vs forecast.weather.gov.  That didn't help either.

Do you see anything in my procedure that I did incorrectly?  Does the Kodi default Estuary skin support your add-on?  I have to believe it works somehow, someway, due to your screenshots.  I have no intentions of using a skin that supports this but I'm curious which skin you used to present this?  Thanks for your contribution and efforts to share this with us.
The basic functionality is supported by any skin that does weather.  It's only some of the advanced features such as using the NWS icons (the ones you see on the forecast.weather.gov website), the detailed descriptive text forecasts, and weather alerts that need special skin support (weather.noaa supplies some additional data that other weather plugins don't have) In most skins, it will not appear any different, aside from you will see "Thursday", "Thursday Night", "Friday", "Friday Night" as individual forecasts, instead of just "Thursday", "Friday". And you will not see both a "High" and "Low" temperature for a single "day" forecast item (there will be either just a high, or just a low depending on if its the daytime forecast or nighttime forecast.

The only skin currently supporting the extra features is the lyrebird.rmod skin that I added those features to.  (lyrebird.rmod is a fork of lyrebird, which was a fork of Mimic).

That being said, you should have seen a pop-up asking for you to pick your local weather station (for the current weather).  Especially when you click on "fetch forecast zone"   If your not seeing that, there's probably some error messages in the log about it.  (most likely caused by confusion on how to enter the latitude,longitude)
Pages: 1 2 3