Premise XML Weather - New Version in the Files area

Motorola Premise

123

Senior Member
{Note: this file will be posted in this forum's Downloads section in the near future.}

This module utilizes XML-based data sources for weather.

There are two classes that can be used. The first is called XMLWeather. That feeds off of the NOAA XML data service. The NOAA data service is very complicated and not very easy to work with. Hence, the limited functionality of this particular class.

The second class uses The Weather Channel's XML data feed (TWCi). TWCi is very easy to work with and allows for much more functionality. This class is recommended over the NOAA-based class for general use.

Both classes expose a significant number of data elements for use by other applications. In my case, I use the CurrentConditions property of the TWCiWeather class to "speak" the weather when asked.

To install:
  1. Copy the TWCi folder (in its entirety) to the C:\Program Files\Premise\SYS\web\Images\icons\ folder. There should be a sub folder called TWCi in the Icons folder after you are done. It's very important that this gets done prior to importing the module.
  2. Import the module. Navigate to someplace under Home, right click, and select "New". Both the TWCiWeather and XML Weather classes will be available (although I would only use TWCiWeather because it's better;) ).
  3. Create an instance of the class. After the instance is created, it should automatically update the current weather based on the zip-code you've entered under "Schedule" in the Builder.
======================
John,

Thanks for this. Works great. I'm using TWCi.

Sam
======================
Minor update. Fixed a few bugs with type conversions and added zipcode to the TWCiWeather class. If you leave it blank, TWCi will use the zipcode configured in Premise under "Schedule", otherwise, the entered zipcode will be used.
======================
Sam

I got tired of the NWS changing the format used by the Forecast module, so I wrote this.

John
======================
I've started using the TWCiWeather plugin. This is great and I've learned a lot from it! I ran into an issue and I wonder if anyone has an explanation.

I noticed that when the plugin updates after its 30 minute timer expires (or when I force it to update by manually setting Update to True on the TWCiWeather object under Home in the Premise Builder) the per-day information isn't displayed in the browser but the current
conditions are. I did some troubleshooting and noticed a couple things.

First, the TWCiWeatherPlugin.RenderPlugin method is invoked each time one of the DayWeather objects is deleted in the loop near the beginning of TWCiWeather.OnChangeUpdate. This itself is not a problem; it's just inefficient. I wonder, is there a way to prevent the re-rendering while the plugin is being recomputed?

Second, and most importantly, TWCiWeatherPlugin.RenderPlugin does NOT execute during or after the addition of new DayWeather objects later in TWCiWeather.OnChangeUpdate. So the last execution of RenderPlugin happens after all the DayWeather objects were deleted, and that is why I only see current conditions displayed after an update. I found I can work around this by adding the program line
Modules.Plugins.Selectors.TWCiWeather.TWCiWeatherPlugin.UpdatePlugin=t
rue near the end of the TWCiWeather.OnChangeUpdate method. Why does
TWCiWeatherPlugin.RenderPlugin automatically when the DayWeather objects are deleted but not when new ones are created?

Frank
======================
Good catches. I'll look at the code when I get home.
 
I just want to say thanks for keeping up the great work. I've had Premise since well...it was still owned by Presmise. I thought it was the best then and I still do, even after constantly looking at everything else. This just seems to work like my brain works.

I've been unhappy with the move by Promixis to charge extra for a weather feed so I looked here. What a great find and I installed it in 15 minutes. Wife now gets to check the weather while drying her hair (flush mounted touch screen in mstrbdrm). You rock!

I'll come back here often.

Kelly
 
Welcome home, Kelly!

I've used Premise for over a year and it also 'works like my brain works'. :) If you have any Premise trivia about the 'old days', please don't hesitate to start a new topic and share them with the Premise community.
 
I use the Ambient Weather Module for my weather info, but would like easy access to the 5 day forecast..I thought this would work? Is anybody displaying 5 day forecast or have I misconfigured something?
 
Yes, I get a 5 day forecast.
Untitled-1.jpg
 
hmmm...so what does your xdo look like? pm me if you like....nice UI btw!
 
I use the TWCi and also get a 5 day forecast. My GUI isn't as pretty as Wayne's though :)

All I did was copy the icons to the applicable folder and install the TWCi weather plugin. I love the transparent icons the TWCi version has.
 

Attachments

  • TWCi_2.jpg
    TWCi_2.jpg
    94.4 KB · Views: 16
Thanks gents! This is my first time using Premise.. :)

I uninstalled and reinstalled. Works like a champ! (Nice job as usual, John!)
 
Back
Top