Difference between revisions of "MythWeather"

From MythTV Official Wiki
Jump to: navigation, search
m (Make the notice about mythweather breakage more prominent)
(MythFrontend -> mythfrontend, link 2 other "mythfrontend" references)
(23 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<div style="border: solid 1px; border-color: #FF0000; margin: 1em; padding: 1em; background-color: #F08080; font-size: 80%">
+
[[MythWeather]] is a plugin that downloads and displays weather information.  
'''MythWeather is currently broken.''' The radar map displays, but all other displays are broken due to changes at MSNBC.  Mythweather has been replaced in the development version with a completely re-written plugin, see the development list for more information.
+
</div>
+
  
MythWeather is a plugin that will display the latest weather information.
+
==Installing MythWeather==
 +
MythWeather is part of the standard set of MythTV plugins.  For most users who have installed a pre-packaged binary copy of MythTV, the work of installing MythWeather is already done.  If you aren't compiling it from source, skip to the Configuration section.  Otherwise, read on...
  
== Features ==
+
===Requirements===
Weather info is obtained from [http://www.weather.com weather.com] and [http://weather.msn.com/ MSNBC] and displayed in four easy to read screens.
+
For those users who are compiling their copy of MythTV and the plugins, there are a few dependencies to worry about. The plugin itself does not depend on any external libraries (other than those common to all MythTV plugins). However, MythWeather uses external grabber script files that actually download the weather data it displays. These grabbers live in the <code>&lt;prefix&gt;/share/mythtv/mythweather/scripts</code> directory by default.
  
== User Screens ==
+
Currently, all of the grabbers are written in PERL. Their combined dependencies include:
=== Current Conditions ===
+
For the U.S., an icon representation of the overall weather for the current day, along with humidity, pressure, wind speed and directions, visibility, wind chill temperature and the UV index.
+
  
=== Extended Forecast ===
+
*[http://search.cpan.org/~rgarcia/perl-5.10.0/lib/Carp.pm Carp]
For the U.S., A three day extended forcast, including today(?!), tomorrow, and the next day. A short text descript along with a representative logo along with the LO and HI temperatures.
+
*[http://search.cpan.org/~ilyam/Data-Dumper-2.121/Dumper.pm Data::Dumper]
 +
*[http://search.cpan.org/~sbeck/Date-Manip-5.48/Manip.pod Date::Manip]
 +
*[http://search.cpan.org/~ferreira/Exporter-5.62c/lib/Exporter.pm Exporter]
 +
*[http://search.cpan.org/~rgarcia/perl-5.10.0/lib/File/Basename.pm File::Basename]
 +
*[http://search.cpan.org/~rgarcia/perl-5.10.0/lib/Getopt/Std.pm Getopt::Std]
 +
*[http://search.cpan.org/~rjray/Image-Size-3.1/ Image::Size]
 +
*[http://search.cpan.org/~gaas/libwww-perl-5.808/lib/LWP/Simple.pm LWP::Simple]
 +
*[http://search.cpan.org/~byrne/SOAP-Lite-0.69/lib/OldDocs/SOAP/Lite.pm SOAP::Lite]
 +
*[http://search.cpan.org/~msergeant/XML-Parser-2.36/Parser.pm XML::Parser]
 +
*[http://search.cpan.org/~khampton/XML-SAX-Base-1.02/lib/XML/SAX/Base.pm XML::SAX::Base]
 +
*[http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm XML::Simple]
  
=== Tomorrow's Outlook ===
+
If you would like to test for the required modules before trying to install MythWeather, below is a quick way to do so.  This is the same method used by the <code>./configure</code> script.  If the command runs successfully with no output, all necessary modules are installed.
Short forecast information for the following day.
+
  
=== Area Radar ===
+
cat << EOF | perl
For the U.S., a local
+
use Carp;
 +
use Data::Dumper;
 +
use Date::Manip;
 +
use Exporter;
 +
use File::Basename;
 +
use Getopt::Std;
 +
use Image::Size;
 +
use LWP::Simple;
 +
use SOAP::Lite;
 +
use XML::Parser;
 +
use XML::SAX::Base;
 +
use XML::Simple;
 +
EOF
  
== Setup Screen ==
+
If you need help installing PERL modules, check out the [http://cpan.org/misc/cpan-faq.html#How_install_Perl_modules FAQ] over at CPAN.
Three options are currently available,
+
  
Weather Units - Imperial (Fahrenheit, in, etc) and Metric (Celsius, kPa, etc).
+
===Compiling MythWeather===
 +
To compile MythWeather from source, grab a copy of the source code from the [http://www.mythtv.org/modules.php?name=Downloads&d_op=viewdownload&cid=1 MythTV downloads page] or check out a fresh copy of the plugins from [http://svn.mythtv.org/trac/ SVN].  If you're compiling the plugin yourself, I assume you are somewhat familiar with the process and won't explain the gory details of how to get your source tree set up.  For those, check out the [http://www.mythtv.org/docs/mythtv-HOWTO.html HOWTO], specifically the [http://www.mythtv.org/docs/mythtv-HOWTO-13.html Plugins chapter].
  
Location - Location of closest available city sorted alphabetically.
+
Once you have your source tree all ready to go, do something similar to the following:
 +
$ ./configure --disable-all --enable-opengl --enable-mythweather
 +
$ make
 +
$ make install
  
Aggressiveness - Choose the relative speed of your internet connection.
+
This will build the MythWeather plugin and install it using the default prefix (usually <code>/usr/local</code>).
  
Note: to save changes made to the setting you must hit the "i" key or your remote control's equivalent. "i" is the key for the on screen display information.
+
====Script Permissions====
 +
Now that you have the plug-in installed, it's best to check for the permissions on the grabber script files. This will help avoid nasty debugging in the future.  Each grabber script needs to be executable by the user that <code>[[mythfrontend]]</code> runs under.  To be safe, you can just set the permissions to <code>0755</code> for all of the <code>*.pl</code> files:
  
== Usage ==
+
# chmod -v 0755 /usr/share/mythtv/mythweather/scripts/*/*.pl
MythWeather will slideshow among the four main screens every 5 seconds or so without user intervention. The <- and -> arrows on your keyboard or key-bound remote control will move you to the previous or next screens, respectively. Pause will stop the slideshow, and a subsequent press will resume operation.
+
  
While watching MythWeather, you can use the number keys on your keyboard or key-bound remote control to enter a valid US zipcode. This will temporarily change the selected city. This feature is especially useful for the frequent traveller who wants to know the weather at his or her destination.
+
'''Note:''' ''You may need to execute the command as <code>root</code>''
 +
 
 +
====PERL in Taint Mode====
 +
If you have your <code>[[mythfrontend]]</code> configured to run as root, whenever it executes a PERL script (i.e. to update the weather information), PERL will run in [http://perldoc.perl.org/perlsec.html#Taint-mode-and-%40INC Taint Mode].  This causes problems for the grabber scripts, because Taint Mode removes '.' (the current directory) from the <code>@INC</code> array in PERL.  For more info, see {{Ticket|4954}}.
 +
 
 +
To get around this, you'll need to modify your grabber scripts slightly.  Edit the first line of the script to read:
 +
 
 +
#! /usr/bin/perl -w -I./.
 +
 
 +
This should get your grabbers working again.
 +
 
 +
==Configuration==
 +
[[Image:MythWeather-WeatherSettings.jpg|thumb|right|Main Weather Settings screen]]All configuration of MythWeather is done through the frontend.  For global configuration of the plugin, go to the '''Utilities/Setup&rarr;Setup&rarr;Info Center Settings&rarr;Weather Settings''' page.  
 +
<br style="clear:both" />
 +
 
 +
===Global Settings===
 +
[[Image:MythWeather-GlobalSettings.jpg|thumb|right|Global settings page]]
 +
 
 +
There are four options to configure on this page:
 +
#'''Seconds to display each page'''
 +
#*Defines how long each page will be displayed before moving onto the next
 +
#'''Seconds to display each page after manual page change'''
 +
#*If you happen to move between pages manually (using the left and right arrows) this kicks in. A manual page change will be displayed by this many seconds before resuming the regular rotation
 +
#'''Retrieve data in the background'''
 +
#*If this is enabled, [[mythfrontend]] will automatically download new weather data in the background.  This improves the startup time of MythWeather drastically, since it no longer will wait for the initial data retrieval.  The grabber scripts run with <code>nice</code>, so you shouldn't notice anything while watching TV.
 +
#'''Skip pages still waiting for data (Not Implemented)'''
 +
#*As the page itself indicates, this feature isn't done yet.  However, when it is, the plugin will not display pages that have no data.
 +
 
 +
===Screen Settings===
 +
The '''Screen Settings''' page allows you to define all of the screens that you want displayed while the plugin is running. You can mix and match screens to your heart's delight.  Refer to these screen shots while reading on:
  
==Gallery==
 
 
<gallery>
 
<gallery>
image:3day.png
+
Image:MythWeather-ScreenSetup-Inactive.jpg|List of '''Inactive Screens'''.  You can add these to the '''Active Screens''' by selecting them.
Image:6day.png
+
Image:MythWeather-ScreenSetup-Active.jpg|List of '''Active Screens'''.  You can modify their properties by selecting them.
image:Image-screen.png
+
Image:MythWeather-ScreenSetup-Actions.jpg|List of actions you can perform on this '''Active Screen'''.
Image:Curr cond.png
+
Image:MythWeather-ScreenSetup-Search.jpg|Search results when changing the location.
Image:MythWebWeather.png
+
Image:MythWeather-ScreenSetup-Units.jpg|Change the type of units used to display the weather information.
 
</gallery>
 
</gallery>
 +
 +
====Screens====
 +
The page allows you to choose from a list of ''Inactive Screens''.  By selecting one of these items in the list, it will be copied into the ''Active Screens'' list. 
 +
 +
There are currently seven different types of screens available:
 +
#'''Current Conditions'''
 +
#*This screen displays the most recent observations of weather.
 +
#'''18 Hour Forecast'''
 +
#*Displays a weather forecast of conditions and temperature for the next eighteen hours.
 +
#'''Three Day Forecast'''
 +
#*Displays a weather forecast of conditions and temperature for the next three days.
 +
#'''Six Day Forecast'''
 +
#*Displays a weather forecast of conditions and temperature for the next six days.
 +
#'''Static Map'''
 +
#*Displays a static map image for the configured location.
 +
#'''Animated Map'''
 +
#*Displays an animated map (radar, satellite imagery, etc.)
 +
#'''Severe Weather Alerts'''
 +
#*Displays text warnings about severe weather in the configured location.
 +
 +
====Actions====
 +
Once in the ''Active Screens'' list, you can modify the properties of the screen by selecting it.  Some screens have more actions than others, depending on what they do.  For example, the '''Animated Maps''' screen doesn't use ''Units'', so you don't have an option to change them.
 +
 +
The actions you can perform on ''Active Screens'' include:
 +
 +
#'''Change Location'''
 +
#*Allows you to change the location for the selected screen.  Selecting this action will prompt you to search for a new location.  You can enter text into the search field with your keyboard, or using the pop-up keyboard and your remote control.  Searching can usually be done with regular expressions as well.
 +
#'''Change Units'''
 +
#*Allows you to toggle between SI and English units.  ([http://en.wikipedia.org/wiki/SI SI] is metric, [http://en.wikipedia.org/wiki/English_unit English] is... well, English).
 +
#'''Move Up'''
 +
#*Moves the selected screen ''up'' one position in the ''Active Screens'' list.
 +
#'''Move Down'''
 +
#*Moves the selected screen ''down'' one position in the ''Active Screens'' list.
 +
#'''Remove'''
 +
#*Deletes the selected screen from the ''Active Screens'' list.
 +
#'''Cancel'''
 +
#*Returns you to ''Screen Setup''.
 +
 +
====Saving Your Changes====
 +
Don't forget to click on the ''Finish'' button on the '''Screen Setup''' page when you're done!  This will save all of your screen definitions and return you to the main '''Weather Settings''' page.
 +
 +
===Source Settings===
 +
[[Image:MythWeather-SourceSetup.jpg|thumb|right|Change settings for each configured weather source]]
 +
 +
This screen allows you to customize the settings for each weather source you have defined.  The '''Source Setup''' screen will only display the sources that you are using for your configured ''Active Screens''. 
 +
 +
For each of theses sources, you can configure two options:
 +
 +
#'''Source Update Timeout (seconds)'''
 +
#*Defines how long the plugin will wait for this source to provide data (in seconds)
 +
#'''Data Retrieval Interval (minutes)'''
 +
#*Defines how long the plugin will wait between subsequent data downloads (in minutes)
 +
 +
The '''Source Setup''' screen is also nice enough to provide you the credits of who wrote your configured weather source grabber and it's current version.
 +
 +
'''Note:''' ''Some grabbers will locally cache their downloaded data to limit the effect on the servers they use as a source.''
 +
 +
==Using MythWeather==
 +
Once configured, using MythWeather requires little brain-power.  When the plugin is started it will begin cycling through the screens.  If you wish to pause on a screen press PAUSE (p).  If you wish to manually move between pages, use the left and right arrows.  If you wish to manually initiate an update, press 'u'.  Thats about it, to exit press EXIT (escape). 
 +
 +
Here are some screen shots of the different screens in action:
 +
 +
<gallery>
 +
Image:MythWeather-CurrentConditions.jpg|Current Conditions screen (yes, it was very cold that day)
 +
Image:MythWeather-ThreeDay.jpg|Three Day Forecast screen
 +
Image:MythWeather-SixDay.jpg|Six Day Forecast screen
 +
Image:MythWeather-AnimatedMap.jpg|Animated Map screen (it really is animated, really!)
 +
</gallery>
 +
 +
 +
 +
==Sources==
 +
Sources are external programs which retrieve weather data.  They can be found in the scripts/ directory of the MythWeather source tree, when installed they are in <code>&lt;prefix&gt;/share/mythtv/mythweather/scripts/</code> where prefix is usually <code>/usr</code>.  If you are interested in how the sources interact with the plugin there is a README in the scripts/ directory.  Below is a list of sources currently included with MythWeather.  If you write a source feel free to provide a link to it here.
 +
 +
===World===
 +
These sources cover the globe.  If you can't find a local provider of weather data, use these instead.
 +
 +
====BBC Weather Centre====
 +
*http://www.bbc.co.uk/weather/
 +
*Files: <code>bbccurrentxml.pl  BBCLocation.pm  bbcthreedayxml.pl</code>
 +
*These two scripts provide forecast data for Current Conditions and Three Day Forecasts for almost any major city in the world.  More detailed information is available for UK cities and towns.
 +
 +
====Accuweather====
 +
*http://www.accuweather.com
 +
*File: <code>accuweather.pl</code> http://code.google.com/p/mythweather-accuweather/
 +
*You can set the response language in the file
 +
*Accu weather has  for almost any major city in the world detailed weather forecast. This script reads the accuweather forecast data for Current Conditions and Three and Six Day Forecasts.
 +
 +
===United States===
 +
These sources are all for locations in the United States.
 +
* "''Animated maps and most (if not all) of the static ones aren't listed by zip/city. Leave the search box blank and search for everything. You'll get a list of stuff by region of the US. Pick your region of the US from the search results. Took me a while to figure that one out. :)''" via [http://www.gossamer-threads.com/lists/mythtv/users/337007?#337007 Brad DerManouelian]
 +
====National Weather Service Current Observations XML Feeds ====
 +
*http://www.weather.gov/data/current_obs/
 +
*Files: <code>nwsxml.pl, NWS-Stations.xml, icons, NWSLocation.pm</code>
 +
*This script uses XML feeds provided by the National Weather Service for current observations.  The NWS-Stations.xml file describes the locations supported by this script.  You can also browse the above link to see avaiable locations.  Locations can be searched for by their station id, station name, or state abbreviation.  Searches are done using the search string as a perl regular expression.  NWS updates their observations hourly
 +
 +
====National Digital Forecast Database XML/SOAP Service====
 +
*http://www.weather.gov/xml
 +
*Files: <code>ndfd.pl, ndfd18.pl, NDFDParser.pm, NWSLocation.pm ndfdXML.pm, icons, NWS-Stations.xml</code>
 +
*Accesses the National Weather Services XML/SOAP forecast information to give data up to 6 days in advance.  It uses the same NWS-Stations.xml file and location search mechanism as the current observations script, however, since NDFD works on lat/lon
 +
 +
====National Weather Service's CAP/XML (Common Alert Protocol) Severe Weather Alert Service====
 +
*http://www.weather.gov/alerts
 +
*Files: <code>nws-alert.pl bp16mr06.dbx</code>
 +
*This scripts retrieves severe weather alerts from the National Weather Service.  Locations are codes retrieved from bp16mr06.dbx.  For an explanation of this file see http://www.nws.noaa.gov/geodata/catalog/wsom/html/cntyzone.htm.  It uses this same file to do its location searches, simply checking if each line matches the search string passed to it.
 +
 +
====Weather.com's Map Room (both static and animated images)====
 +
*http://www.weather.com/maps/
 +
*Files: <code>maps.pl, animaps.pl, MapSearch.pm, maps.xml weathercommaps.pl</code> (in dir above scripts/)
 +
*This script downloads and static and animated maps from weather.com. weathercommaps.pl was used to crawl weather.com's map room and generate the maps.xml file, which is then used for the static map source (maps.pl) and the animated map source (animaps.pl).  Location searches look at the map name, so you'll probably want to search for things like "radar", "doppler", "northeast", etc... Maps from other sites can be added easily, just follow the format in maps.xml.
 +
 +
===Canada===
 +
These sources are for locations in Canada.
 +
====Environment Canada's Weather Office====
 +
*http://www.weatheroffice.gc.ca/
 +
*Files: <code>envcan.pl ENVCANParser.pm ENVCANLocation.pm ENVCAN-Stations.xml</code>
 +
*This script downloads XML RSS feeds from Environment Canada's Weather Office site.  Location searches are powered by the <code>ENVCAN-Stations.xml</code> file, which contains a list of all defined Canadian sites.  When searching, simply look for the city or town that you're closest to.
 +
 +
 +
====Environment Canada's Satellite Imagery====
 +
*http://www.weatheroffice.gc.ca/satellite
 +
*Files: <code>envcan_animaps.pl ENVCANMapSearch.pm ENVCAN-Maps.xml</code>
 +
*This script downloads animated map images from Environment Canada's Satellite Imagery service.  The locations are all named after the regions the images cover.  So, search for stuff like 'Western' or 'Eastern' to get the best results.  If in doubt, take a look at the <code>ENVCAN-Maps.xml</code> file... it defines all of the animated maps.
 +
 +
===Australia===
 +
You can use the weather.com settings or BOM for Australia.  weather.com is the default.
 +
 +
====BOM====
 +
 +
*http://web.aanet.com.au/~auric/?q=node/16
 +
*Files: bomcurrentdat.pl bommaps.pl bomsixdaydat.pl bomanimaps.pl bomalert.pl
 +
 +
It works for a three day listing but I cannot get the animated maps working yet.
 +
 +
==More Questions==
 +
If there is a problem with this page, feel free to fix it.  Questions about using MythWeather should be directed to the mythtv-users mailing list or #mythtv-users on freenode.  Issues or bugs with the code should be directed to the mythtv-dev mailing list or #mythtv channel.
 +
 
[[Category:Plugins]]
 
[[Category:Plugins]]

Revision as of 20:54, 12 March 2011

MythWeather is a plugin that downloads and displays weather information.

Installing MythWeather

MythWeather is part of the standard set of MythTV plugins. For most users who have installed a pre-packaged binary copy of MythTV, the work of installing MythWeather is already done. If you aren't compiling it from source, skip to the Configuration section. Otherwise, read on...

Requirements

For those users who are compiling their copy of MythTV and the plugins, there are a few dependencies to worry about. The plugin itself does not depend on any external libraries (other than those common to all MythTV plugins). However, MythWeather uses external grabber script files that actually download the weather data it displays. These grabbers live in the <prefix>/share/mythtv/mythweather/scripts directory by default.

Currently, all of the grabbers are written in PERL. Their combined dependencies include:

If you would like to test for the required modules before trying to install MythWeather, below is a quick way to do so. This is the same method used by the ./configure script. If the command runs successfully with no output, all necessary modules are installed.

cat << EOF | perl
use Carp;
use Data::Dumper;
use Date::Manip;
use Exporter;
use File::Basename;
use Getopt::Std;
use Image::Size;
use LWP::Simple;
use SOAP::Lite;
use XML::Parser;
use XML::SAX::Base;
use XML::Simple;
EOF

If you need help installing PERL modules, check out the FAQ over at CPAN.

Compiling MythWeather

To compile MythWeather from source, grab a copy of the source code from the MythTV downloads page or check out a fresh copy of the plugins from SVN. If you're compiling the plugin yourself, I assume you are somewhat familiar with the process and won't explain the gory details of how to get your source tree set up. For those, check out the HOWTO, specifically the Plugins chapter.

Once you have your source tree all ready to go, do something similar to the following:

$ ./configure --disable-all --enable-opengl --enable-mythweather
$ make
$ make install

This will build the MythWeather plugin and install it using the default prefix (usually /usr/local).

Script Permissions

Now that you have the plug-in installed, it's best to check for the permissions on the grabber script files. This will help avoid nasty debugging in the future. Each grabber script needs to be executable by the user that mythfrontend runs under. To be safe, you can just set the permissions to 0755 for all of the *.pl files:

# chmod -v 0755 /usr/share/mythtv/mythweather/scripts/*/*.pl

Note: You may need to execute the command as root

PERL in Taint Mode

If you have your mythfrontend configured to run as root, whenever it executes a PERL script (i.e. to update the weather information), PERL will run in Taint Mode. This causes problems for the grabber scripts, because Taint Mode removes '.' (the current directory) from the @INC array in PERL. For more info, see #4954.

To get around this, you'll need to modify your grabber scripts slightly. Edit the first line of the script to read:

#! /usr/bin/perl -w -I./.

This should get your grabbers working again.

Configuration

Main Weather Settings screen
All configuration of MythWeather is done through the frontend. For global configuration of the plugin, go to the Utilities/Setup→Setup→Info Center Settings→Weather Settings page.


Global Settings

Global settings page

There are four options to configure on this page:

  1. Seconds to display each page
    • Defines how long each page will be displayed before moving onto the next
  2. Seconds to display each page after manual page change
    • If you happen to move between pages manually (using the left and right arrows) this kicks in. A manual page change will be displayed by this many seconds before resuming the regular rotation
  3. Retrieve data in the background
    • If this is enabled, mythfrontend will automatically download new weather data in the background. This improves the startup time of MythWeather drastically, since it no longer will wait for the initial data retrieval. The grabber scripts run with nice, so you shouldn't notice anything while watching TV.
  4. Skip pages still waiting for data (Not Implemented)
    • As the page itself indicates, this feature isn't done yet. However, when it is, the plugin will not display pages that have no data.

Screen Settings

The Screen Settings page allows you to define all of the screens that you want displayed while the plugin is running. You can mix and match screens to your heart's delight. Refer to these screen shots while reading on:

Screens

The page allows you to choose from a list of Inactive Screens. By selecting one of these items in the list, it will be copied into the Active Screens list.

There are currently seven different types of screens available:

  1. Current Conditions
    • This screen displays the most recent observations of weather.
  2. 18 Hour Forecast
    • Displays a weather forecast of conditions and temperature for the next eighteen hours.
  3. Three Day Forecast
    • Displays a weather forecast of conditions and temperature for the next three days.
  4. Six Day Forecast
    • Displays a weather forecast of conditions and temperature for the next six days.
  5. Static Map
    • Displays a static map image for the configured location.
  6. Animated Map
    • Displays an animated map (radar, satellite imagery, etc.)
  7. Severe Weather Alerts
    • Displays text warnings about severe weather in the configured location.

Actions

Once in the Active Screens list, you can modify the properties of the screen by selecting it. Some screens have more actions than others, depending on what they do. For example, the Animated Maps screen doesn't use Units, so you don't have an option to change them.

The actions you can perform on Active Screens include:

  1. Change Location
    • Allows you to change the location for the selected screen. Selecting this action will prompt you to search for a new location. You can enter text into the search field with your keyboard, or using the pop-up keyboard and your remote control. Searching can usually be done with regular expressions as well.
  2. Change Units
    • Allows you to toggle between SI and English units. (SI is metric, English is... well, English).
  3. Move Up
    • Moves the selected screen up one position in the Active Screens list.
  4. Move Down
    • Moves the selected screen down one position in the Active Screens list.
  5. Remove
    • Deletes the selected screen from the Active Screens list.
  6. Cancel
    • Returns you to Screen Setup.

Saving Your Changes

Don't forget to click on the Finish button on the Screen Setup page when you're done! This will save all of your screen definitions and return you to the main Weather Settings page.

Source Settings

Change settings for each configured weather source

This screen allows you to customize the settings for each weather source you have defined. The Source Setup screen will only display the sources that you are using for your configured Active Screens.

For each of theses sources, you can configure two options:

  1. Source Update Timeout (seconds)
    • Defines how long the plugin will wait for this source to provide data (in seconds)
  2. Data Retrieval Interval (minutes)
    • Defines how long the plugin will wait between subsequent data downloads (in minutes)

The Source Setup screen is also nice enough to provide you the credits of who wrote your configured weather source grabber and it's current version.

Note: Some grabbers will locally cache their downloaded data to limit the effect on the servers they use as a source.

Using MythWeather

Once configured, using MythWeather requires little brain-power. When the plugin is started it will begin cycling through the screens. If you wish to pause on a screen press PAUSE (p). If you wish to manually move between pages, use the left and right arrows. If you wish to manually initiate an update, press 'u'. Thats about it, to exit press EXIT (escape).

Here are some screen shots of the different screens in action:


Sources

Sources are external programs which retrieve weather data. They can be found in the scripts/ directory of the MythWeather source tree, when installed they are in <prefix>/share/mythtv/mythweather/scripts/ where prefix is usually /usr. If you are interested in how the sources interact with the plugin there is a README in the scripts/ directory. Below is a list of sources currently included with MythWeather. If you write a source feel free to provide a link to it here.

World

These sources cover the globe. If you can't find a local provider of weather data, use these instead.

BBC Weather Centre

  • http://www.bbc.co.uk/weather/
  • Files: bbccurrentxml.pl BBCLocation.pm bbcthreedayxml.pl
  • These two scripts provide forecast data for Current Conditions and Three Day Forecasts for almost any major city in the world. More detailed information is available for UK cities and towns.

Accuweather

United States

These sources are all for locations in the United States.

  • "Animated maps and most (if not all) of the static ones aren't listed by zip/city. Leave the search box blank and search for everything. You'll get a list of stuff by region of the US. Pick your region of the US from the search results. Took me a while to figure that one out. :)" via Brad DerManouelian

National Weather Service Current Observations XML Feeds

  • http://www.weather.gov/data/current_obs/
  • Files: nwsxml.pl, NWS-Stations.xml, icons, NWSLocation.pm
  • This script uses XML feeds provided by the National Weather Service for current observations. The NWS-Stations.xml file describes the locations supported by this script. You can also browse the above link to see avaiable locations. Locations can be searched for by their station id, station name, or state abbreviation. Searches are done using the search string as a perl regular expression. NWS updates their observations hourly

National Digital Forecast Database XML/SOAP Service

  • http://www.weather.gov/xml
  • Files: ndfd.pl, ndfd18.pl, NDFDParser.pm, NWSLocation.pm ndfdXML.pm, icons, NWS-Stations.xml
  • Accesses the National Weather Services XML/SOAP forecast information to give data up to 6 days in advance. It uses the same NWS-Stations.xml file and location search mechanism as the current observations script, however, since NDFD works on lat/lon

National Weather Service's CAP/XML (Common Alert Protocol) Severe Weather Alert Service

Weather.com's Map Room (both static and animated images)

  • http://www.weather.com/maps/
  • Files: maps.pl, animaps.pl, MapSearch.pm, maps.xml weathercommaps.pl (in dir above scripts/)
  • This script downloads and static and animated maps from weather.com. weathercommaps.pl was used to crawl weather.com's map room and generate the maps.xml file, which is then used for the static map source (maps.pl) and the animated map source (animaps.pl). Location searches look at the map name, so you'll probably want to search for things like "radar", "doppler", "northeast", etc... Maps from other sites can be added easily, just follow the format in maps.xml.

Canada

These sources are for locations in Canada.

Environment Canada's Weather Office

  • http://www.weatheroffice.gc.ca/
  • Files: envcan.pl ENVCANParser.pm ENVCANLocation.pm ENVCAN-Stations.xml
  • This script downloads XML RSS feeds from Environment Canada's Weather Office site. Location searches are powered by the ENVCAN-Stations.xml file, which contains a list of all defined Canadian sites. When searching, simply look for the city or town that you're closest to.


Environment Canada's Satellite Imagery

  • http://www.weatheroffice.gc.ca/satellite
  • Files: envcan_animaps.pl ENVCANMapSearch.pm ENVCAN-Maps.xml
  • This script downloads animated map images from Environment Canada's Satellite Imagery service. The locations are all named after the regions the images cover. So, search for stuff like 'Western' or 'Eastern' to get the best results. If in doubt, take a look at the ENVCAN-Maps.xml file... it defines all of the animated maps.

Australia

You can use the weather.com settings or BOM for Australia. weather.com is the default.

BOM

It works for a three day listing but I cannot get the animated maps working yet.

More Questions

If there is a problem with this page, feel free to fix it. Questions about using MythWeather should be directed to the mythtv-users mailing list or #mythtv-users on freenode. Issues or bugs with the code should be directed to the mythtv-dev mailing list or #mythtv channel.