SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageTV v9 Customizations (http://forums.sagetv.com/forums/forumdisplay.php?f=57)
-   -   Weather (http://forums.sagetv.com/forums/showthread.php?t=65764)

tmiranda 11-28-2018 07:15 PM

Weather
 
1 Attachment(s)
This thread is for users who want to use the beta version of a weather plugin that can be used in the default STV now that WeatherUnderground has ceased to function.

Attached to this post is the latest developer plugin manifest that will allow you to use the latest beta. You must unzip the file and place the .xml in the install directory (where the sage executable is located) of your server. Once you do that you should go to the plugin manager and install the UI Mod "Weather using NWS and Darksky".

Note. To have the Darksky data update you must get your own API key. To do that go here and create an account. https://darksky.net/dev/register

After obtaining a key you must make a file called "darksky.properties" and place it in the install directory of your sage server. The file should have a single line in it that reads: key=XXXX where XXXX is your unique key. If you don't do this the plugin will work, but the data obtained from Darksky will only be updated when you reboot your sage server.

Usage:


Go to the configuration menu just as you did before then enter either a US Zip Code or a city name. If you enter a US Zip Code the the US National Weather Service will be used to obtain the weather information. If you enter a city name then Darksky will be the weather provider.

To enter more than one locale simply enter another Zip Code or city name in the configuration menu. Once you do that you will see the option to cycle through the various locales.

Release Notes:

VERY IMPORTANT: After installing this version check your JARs directory for duplicate jackson JARs with different versions. If you see two version of the same JAR you must stop sage, delete the older version of the jar, and restart.

The minimum Java version supported is 1.8.

Changelog for Version 0.18:
  • Pressing "Right" on the main weather menu now cycles through configured locales.
  • "Rain" is now accumulation since midnight. (For both NWS and Darksky locales.)
  • If using a Darksky locale and there is snow accumulation since midnight the accumulation will be displayed instead of rain accumulation.
  • Fixed a bug that caused the weather info in the top menu to change if more than one locale was configured and the user cycled through them.
  • Fixed a bug in the System Information menu so it now reports the version of the NWS, OWM, and Darksky jars.
  • Fixed a bug that caused a NPE if getting snow accumulation in a Darksky locales.

FAQ:
  • Do I need a Darksky key if I only use US Zip Codes? - No.

Rob23 11-29-2018 04:38 PM

Thank you! :goodjob:

jeb0921 11-29-2018 06:33 PM

Not there
 
I have restarted everything and when I go into the plugin setup the plugin isn't there.

ranger 11-29-2018 08:32 PM

I'm not seeing it listed under UI Mods. Are there any dependencies I might be missing? Running SageTV 9.10.783 with Java 8. I also have Gemstone installed and running.

jusjoken 11-29-2018 08:59 PM

Quote:

Originally Posted by ranger (Post 618063)
I'm not seeing it listed under UI Mods. Are there any dependencies I might be missing? Running SageTV 9.10.783 with Java 8. I also have Gemstone installed and running.

I cannot imagine it working well in Gemstone as i stripped out the default stv weather stuff long ago and built the weather around phoenix weather calls.

I will now need to add the NWS code to phoenix so gemstone will offer it...which tmiranda has offered the source so it should not be complex.

k

Zogg 11-29-2018 10:13 PM

I'm running the basic UI and don't see it either.

kegler 11-30-2018 07:56 AM

Quote:

Originally Posted by Zogg (Post 618071)
I'm running the basic UI and don't see it either.

I don't see it either. I am also running the basic UI.

I see that the installation files have been uploaded to bintray, but the manifest has not shown up in my SageTVPlugins.xml. Without that SageTV cannot not display it. It does not show up at http://download.sagetv.com/SageTVPlugins.xml either, so it did not get updated as expected.

The date on my SageTVPlugins.xml is 11/11/2018. When it gets updated we should see a more current date.

tmiranda 12-01-2018 07:58 AM

My bad, it should be there now.

kegler 12-02-2018 01:24 PM

When I started the thread on the WU API shutdown, I wasn't sure how much interest there would be in creating a replacement. For most, in this age of widely available mobile devices, those seem to be the goto preference. I am still a bit old school. If a major weather event is taking place I am going to sit down at my desktop where I have dozens of sites at my disposal.

But for normal day-to-day use I prefer to use Sage. Hopefully we can keep it well focused on just what is needed. IMO that is a forecasting site, a limited number of local observation sites, a zoom-able radar map and perhaps a satellite view.


Here is my list of problems/suggestions/questions/opinions.

1) Should we uninstall the Google Weather plugin? Does this impact extenders given our limited available memory? Granted this is very short term (till the end of the month). I have experienced problems displaying radar maps from time to time. I suspect this is web server related.

2) IMO the selection of a forecasting site should be separate from the selection of local observation site(s). Local forecasting sites are usually limited in number. Local observation site(s) are usually quite numerous in comparison. While I do take note of forecasting site observations, I pay more attention to sites that better reflect my local area.

3) I see you included a file ZipCodes.txt that is a list of valid zip codes and their locations (lat/long). All zip codes that are PO Boxes only were excluded, including mine. These are found mainly out in rural areas where we still have some small local post offices, but used to have our own local zip code delivery area. Nowadays we are part of a much larger zip code but the small local one often gives a much better location.

4) For some reason the location I am using for testing (Sea-Tac International Airport - use Zip 98188) does not display the correct current conditions which can be found here. I have not been able to correlate what I am seeing to anything.

5) And for some reason the above displayed conditions (with wrong values) will disappear after about 15 minutes and are replaced by what appears to be a default blank (zeroed out) record. The "Recorded:" date/timestamp goes away too. If you wait another 45 minutes the original wrong values will re-appear again and the cycle repeats (Please don't ask how I managed to discover this!!) You can reset the cycle by selecting another location and then coming back to this one.

6) When zip 98310 is used, Enetai, WA is displayed. It should show Bremerton, WA. Bremerton is an incorporated city while Enetai is a community in the area. The 98310 zip is the central one for Bremerton and includes the downtown area. This may indicate the presence of aliases in your zip code lookup.

7) Typo - "Max/Max Temp" label. I think you meant Max/Min

8) "Change Units:" "Currently Default" is part of the selection cycle and displays a null record.

9) "Options" (on the lower right hand corner) is still linked to the old Google Weather configuration. Either link to your config or remove.

10) Would like to see Sun Rise/Set times. Moon phases (%) would be nice too. Looks like you left space for them. Need sources?

11) Hourly Forecast - Nice to have but 7 days of it is not usefull. Need a config setting for number of days to display. Two days would be a good default. Simplify and shorten the identification for each segment (i.e. Sun Dec 2 11AM-12PM)

12) Would be nice to have a refresh button for observations. That was always a major irritation with the Google Weather plugin when you know the display is stale, but there is no way to get it to update.


Have you found a suitable radar mapping source? Have you been to this https://www.ncdc.noaa.gov/wct/ site?


Out here in the Pacific Northwest these are sites I use to find local observations:

https://www.wrh.noaa.gov/mso/fwxmaps/pgtsnd.php

https://www.wrh.noaa.gov/mso/fwxmaps/ksew.php

Each site has it's own XML link. This may be unique to our area. I don't know if other areas have similar maps and links. It seems each region likes to do its own thing.

Thomas Wischgol 12-02-2018 08:10 PM

Nice work, I like the detailed icons. I noticed the current temperature being off as well. Also, in order to be consistent with how the UI works overall, it would be great to be able to go back with the cursor left key. Currently, it does not seem to do anything.

jpwegas 12-02-2018 09:39 PM

I don't see the new plugin.

How do the SageTVPlugins.xml and SageTVPluginV9.xml files get updated? I thought the server polled for updates but my files are dated 2015 and 2017 currently and a restart did not change anything.

--John

tmiranda 12-03-2018 05:54 AM

Quote:

Originally Posted by kegler (Post 618135)
When I started the thread on the WU API shutdown, I wasn't sure how much interest there would be in creating a replacement. For most, in this age of widely available mobile devices, those seem to be the goto preference. I am still a bit old school. If a major weather event is taking place I am going to sit down at my desktop where I have dozens of sites at my disposal.

But for normal day-to-day use I prefer to use Sage. Hopefully we can keep it well focused on just what is needed. IMO that is a forecasting site, a limited number of local observation sites, a zoom-able radar map and perhaps a satellite view.


Here is my list of problems/suggestions/questions/opinions.

1) Should we uninstall the Google Weather plugin? Does this impact extenders given our limited available memory? Granted this is very short term (till the end of the month). I have experienced problems displaying radar maps from time to time. I suspect this is web server related.

2) IMO the selection of a forecasting site should be separate from the selection of local observation site(s). Local forecasting sites are usually limited in number. Local observation site(s) are usually quite numerous in comparison. While I do take note of forecasting site observations, I pay more attention to sites that better reflect my local area.

3) I see you included a file ZipCodes.txt that is a list of valid zip codes and their locations (lat/long). All zip codes that are PO Boxes only were excluded, including mine. These are found mainly out in rural areas where we still have some small local post offices, but used to have our own local zip code delivery area. Nowadays we are part of a much larger zip code but the small local one often gives a much better location.

4) For some reason the location I am using for testing (Sea-Tac International Airport - use Zip 98188) does not display the correct current conditions which can be found here. I have not been able to correlate what I am seeing to anything.

5) And for some reason the above displayed conditions (with wrong values) will disappear after about 15 minutes and are replaced by what appears to be a default blank (zeroed out) record. The "Recorded:" date/timestamp goes away too. If you wait another 45 minutes the original wrong values will re-appear again and the cycle repeats (Please don't ask how I managed to discover this!!) You can reset the cycle by selecting another location and then coming back to this one.

6) When zip 98310 is used, Enetai, WA is displayed. It should show Bremerton, WA. Bremerton is an incorporated city while Enetai is a community in the area. The 98310 zip is the central one for Bremerton and includes the downtown area. This may indicate the presence of aliases in your zip code lookup.

7) Typo - "Max/Max Temp" label. I think you meant Max/Min

8) "Change Units:" "Currently Default" is part of the selection cycle and displays a null record.

9) "Options" (on the lower right hand corner) is still linked to the old Google Weather configuration. Either link to your config or remove.

10) Would like to see Sun Rise/Set times. Moon phases (%) would be nice too. Looks like you left space for them. Need sources?

11) Hourly Forecast - Nice to have but 7 days of it is not usefull. Need a config setting for number of days to display. Two days would be a good default. Simplify and shorten the identification for each segment (i.e. Sun Dec 2 11AM-12PM)

12) Would be nice to have a refresh button for observations. That was always a major irritation with the Google Weather plugin when you know the display is stale, but there is no way to get it to update.


Have you found a suitable radar mapping source? Have you been to this https://www.ncdc.noaa.gov/wct/ site?


Out here in the Pacific Northwest these are sites I use to find local observations:

https://www.wrh.noaa.gov/mso/fwxmaps/pgtsnd.php

https://www.wrh.noaa.gov/mso/fwxmaps/ksew.php

Each site has it's own XML link. This may be unique to our area. I don't know if other areas have similar maps and links. It seems each region likes to do its own thing.

Good feedback. Some answers/comments:

1. Not really necessary. I haven't removed the code for the old weather plugin so you are likely to get the "nag" screen if you uninstall it.

2. I'll see if I can figure out how to do that. I am starting from zero with experience on the weather. I didn't even know there was a difference between the forecast site and the observation site.

3. You can edit the ZipCode file if you like. The NWS API works primarily by Lat/Lng and this was the best way I could find to get the Lat/Lng of various locations. If you know a better way let me know.

4. Sounds like a bug. I will investigate.

5. Sounds like a bug. The plugin automatically updates the forecast and observations every 15 minutes. Once an hour it does a "big" update (i.e. everything) and the other 3 times it just updates the local observations.

6. I'm not sure what to do about that.

7. I'll fix that.

8. Another bug. :(

9. I'll fix that.

10. If you know of sources I'll see if I can add the info.

11. I'll look into it.

12. I'll add that.

I have not found a radar mapping source. i'll have a look at NOAA.

Thanks for the testing. Can you send a logfile showing issues 5 and 8?

Tom

tmiranda 12-03-2018 05:55 AM

Quote:

Originally Posted by Thomas Wischgol (Post 618160)
Nice work, I like the detailed icons. I noticed the current temperature being off as well. Also, in order to be consistent with how the UI works overall, it would be great to be able to go back with the cursor left key. Currently, it does not seem to do anything.

Must be a bug in current temp. Sorry.

I'll add the left/back key as well.

tmiranda 12-03-2018 05:56 AM

Quote:

Originally Posted by jpwegas (Post 618165)
I don't see the new plugin.

How do the SageTVPlugins.xml and SageTVPluginV9.xml files get updated? I thought the server polled for updates but my files are dated 2015 and 2017 currently and a restart did not change anything.

--John

Those files get updated automatically. Restart the server and let it sit for 3 or 4 minutes then send a logfile. I'll see if I can help. Maybe you blocked the website? Do you have tight security settings?

davidk21770 12-03-2018 06:12 AM

Installed and working here - thanks! :goodjob:

tmiranda 12-03-2018 12:41 PM

Quick Fix
 
2 Attachment(s)
Here is a quick fix to most of the items identified. I was too lazy to package this up as a plugin, to install it:
- Make sure you already have the PlugIn installed.
- Stop sage.
- Go to the JARs folder and overwrite the nws.jar with the one attached.
- Go to the SageTV7 folder and overwrite the nws.stvi with the one attached.

Some notes:
- I have been unable to reproduce keglar's item 5 or item 8. I will need to see logs from somebody.
- If you get overzealous and press the button to refresh the data too often the API starts returning nulls for temperature. (This causes the current temperature to display as 0.) I'm not sure why, I'll look into it.

wnjj 12-03-2018 12:51 PM

Quote:

Originally Posted by tmiranda (Post 618185)
Here is a quick fix to most of the items identified. I was too lazy to package this up as a plugin, to install it:
- Make sure you already have the PlugIn installed.
- Stop sage.
- Go to the JARs folder and overwrite the nws.jar with the one attached.
- Go to the SageTV7 folder and overwrite the nws.stvi with the one attached.

Some notes:
- I have been unable to reproduce keglar's item 5 or item 8. I will need to see logs from somebody.
- If you get overzealous and press the button to refresh the data too often the API starts returning nulls for temperature. (This causes the current temperature to display as 0.) I'm not sure why, I'll look into it.


My system had issue #5 and I think #8 too. I'll see what my logs show.

wnjj 12-03-2018 01:02 PM

I have this in my log file after starting up with the newest ones:

Code:

Mon 12/3 10:51:12.242 [AWT-EventQueue-0@59c656] EXCEPTION in getValueAsObject:sage.jep.ParseException: Error in method reflection of tmiranda_nws_Forecast_getUnits of java.lang.NullPointerException for:tmiranda_nws_Forecast_getUnits(ForecastInstance)
Is this issue #5?

Checking further, this looks like it happens before it's configured since this appears after the exception: "NWS: Not yet configured."

wnjj 12-03-2018 01:38 PM

A ton of these too:
Code:

Mon 12/3 10:51:25.428 [AWT-EventQueue-0@59c656] NWS.Conversion.isMetric: null stationUnit.
Is this issue #8?

kegler 12-03-2018 01:49 PM

Tom, I've been tied up with other activities this morning. I'll load your latest code and re-generate the log info for you this afternoon after 1PM PT - if you haven't figured it out by then.

Jim


All times are GMT -6. The time now is 03:21 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.