Premise [download] Module: Weather Underground Driver

Motorola Premise

123

Senior Member
index.php
File Name: Module: Weather Underground Driver
File Submitter: 123
File Submitted: 03 May 2012
File Updated: 03 May 2012
File Category: Premise
Author: 123
Contact: Support Topic or PM
Version: 1.3

Weather Underground Driver reports weather data collected by Weather Underground. It can report weather in Imperial or Metric units and in three languages (English/Spanish/FrenchCanadian, others are possible). It can display weather icons in any one of 12 different styles (9 standard Weather Underground styles plus 3 custom styles created by Chuck Lyons). Current conditions, a Ten-Day forecast, and Weather Alerts, are presented in Premise Browser. MiniBrowser is also supported but less information is displayed.

There are two zip archives involved; ensure you download and install both. Wunderground_V1.3.zip contains the driver and full documentation. Wunderground_Icons.zip contains twelve sets of 38 weather icons.

The WeatherUnderground driver reports approximately 55 weather parameters in the following categories:
  1. Location
  2. Current Conditions
  3. Moon
  4. Almanac
  5. Ten-Day Forecast
  6. Weather Alerts
Here are the reported parameters; you can create a PropertyChange script for any parameter.


-- Location --
  • City, State, Country
  • TimeZone Name and Offset
-- Current Conditions --
  • Observation Date and Time
  • Last Updated
  • Temperature
  • Summary
  • Barometric Pressure and Direction
  • Wind Speed, Gust, and Direction
  • Humidity
  • Heat Index and Wind Chill
  • Visibility
  • UV Level
  • Dew Point
  • Icon Code
-- Moon --
  • Illumination and Age
-- Almanac --
  • Temperature High and Low
-- Daily Forecast --
  • Day, Month, Day Name
  • Forecast Time
  • Temperature High and Low
  • Forecast Summary
  • POP
  • Humidity (Avg/Max/Min)
  • PPC (All/Day/Night)
  • Snow (All/Day/Night)
  • Wind Speed, Direction, and Max Speed
  • Day Icon Code
  • Verbal Day Summary
  • Night Icon Code
  • Verbal Night Summary
-- Alert --
  • Type and Description
  • Date and Time
  • Expiry Data and Time
  • Message, Phenomena, and Significance

Click here to download this file
 
This driver has been working well for me for over two months. I hope it works equally well for others.

I noticed that some of the data, retrieved from Weather Underground, can be reported using a non-numeric "NA" string indicating the information was unavailable. In the driver's documentation, I supplied an example of a PropertyChange script that tested if the value is numeric prior to proceeding with a calculation. Keep this in mind when writing your own scripts otherwise you run the risk of testing if temperature "NA" is greater than 80, or similar nonsensical comparison, and Premise will, of course, cause the script to halt at the offending line.

Weather Underground does not consistently use "NA", or at least it do not when I was developing the driver a few months ago, and I've seen "N/A" reported (for Humidity). They also use "-9999" to report an unavailable value. Again, keep this in mind when using the driver's properties and do not assume values will always be numeric.
 
Thanks for posting. I was going to add Google weather to my jQuery UI, but it only has a 3 day forecast.
 
The attached diagram displays the driver's object's and properties. On this day (May 3, 2012) Grand Rapids, MI is experiencing severe weather with no less than four Weather Alerts. Grand Rapids doesn't know it but it makes for a great example of the driver's ability to report multiple Weather Alerts.

Eagle-eyed folks might notice that the driver lists 11 days. The eleventh day does not contain any data. It is a vestigial remnant, dating back to when Weather Underground delivered 11 days of weather data for Canadian cities (now all cities get 10).
 

Attachments

  • WUG_Diagram.png
    WUG_Diagram.png
    73.7 KB · Views: 17
Premise Browser view of weather in Grand Rapids.
 

Attachments

  • WUG_GrandRapidsMichigan_Weather.png
    WUG_GrandRapidsMichigan_Weather.png
    68.8 KB · Views: 7
Premise Browser view of weather when a weather icon is clicked. In this case, the current day's weather icon (either day or night) was clicked. The day's descriptive weather forecast is displayed in the central pane.
 

Attachments

  • WUG_GrandRapidsMichigan_Daily.png
    WUG_GrandRapidsMichigan_Daily.png
    72.6 KB · Views: 3
Premise Browser view of Weather Alerts. This dialog box is displayed when the red "Weather Alert" message is clicked.
 

Attachments

  • WUG_GrandRapidsMichigan_Alerts.png
    WUG_GrandRapidsMichigan_Alerts.png
    52.6 KB · Views: 5
Your usual awesomeness 123. Installed and rethemed. Works absolutely perfectly. Only thing I haven't been able to figure out is how to change the text color in the Conditions panel. Everything else worked flawlessly.
 

Attachments

  • PremiseWeatherScreen.jpg
    PremiseWeatherScreen.jpg
    56.1 KB · Views: 10
Nice! I like that 50's Retro-Future look!

The color of the font in the Conditions pane is hard-coded and not governed by a Selector.

I used a TABLE element to organize the property labels and values into two even columns. As a result, the TABLE refused to inherit the CSS properties of the DIV it is residing in (the Conditions pane; governed by a Selector) and I had to resort to using inline CSS. Let me know if you know of a way to force the TABLE to inherit the DIV's CSS.

To alter the hard-coded font color, navigate to:
Modules > WeatherUnderground > DisplayManager > DisplaySummary

Go to line 8 and change the color to whatever works best for you. This line governs the appearance of the text for detailed Current Conditions.

sHTML = sHTML & ("<table border=0 STYLE=""Color:white;font-family:Tahoma;font-size:10pt;font-weight:normal;line-height:15px;"">" & vbcrlf)

Repeat the modification on line 83.This line governs the appearance of the text for a descriptive daily weather forecast.

FYI: As it stands, the font size is maxed out for the given space. If you increase it, the TABLE expands in height and the last row gets cropped by the DIV.


PS
Given that you have it up and running, you've confirmed my installation instructions are effective. :)
 
Back
Top