View unanswered posts | View active topics It is currently Tue May 21, 2013 1:15 pm



This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page: 1, 2  Next
 NOAA Weather Plus - A New Indigo 5 and 6 Plugin 
Author Message

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post NOAA Weather Plus - A New Indigo 5 and 6 Plugin
NOAA Weather Plus v1.1.12

(FREE Indigo Pro 5 and 6 Plugin)

Download version 1.1.12 here

WARNING: Version 1.1 changes almost all weather forecast state names to be more intuitive. This has the unfortunate side-effect of causing any Device State Change triggers based on old forecast states to no longer work and Control Page objects you may have to not appear correctly until set to show the new forecast states.

The NOAA Weather Plus plugin extends the functionality of Perceptive Automation's Indigo Pro (versions 5.0 and higher) home automation software by allowing you to create an Indigo device that contains weather information for your geographic location. Current weather conditions and a 7-day forecast for your location are gathered from the US National Weather Service (a department of NOAA, the National Oceanic and Atmospheric Administration).

Indigo Pro includes a built-in NOAA Weather plugin. However, NOAA Weather Plus goes beyond the functionality of the included NOAA Weather plugin by adding the following features.

  • Use your exact geographic latitude and longitude to gather weather information rather than needing to look up your local NOAA weather observation station name.
  • 7-day forecasts for morning and evening weather conditions.
  • Forecasts include probability of precipitation.
  • Forecasts include the weather condition icon state for use in Indigo Pro control pages.
  • Forecasts include NOAA's plain-English worded weather predictions for each morning and evenin period.
  • 7-day high and low temperature predictions.
  • Weather advisories, including start and end dates, are shown in separate device states.
  • Current wind chill factor temperature is provided based on observed wind speed in your location (if provided by NOAA).
  • Current water temperature if the NOAA weather stations at sea provides that information.
  • NOAA Weather Plus device states are backward compatible* with Indigo's included NOAA Weather plugin states, so there's no need to delete existing NOAA Weather devices. Just re-configure them to use the NOAA Weather Plus plugin.
  • Improved current condition data reliability. If a current condition is unavailable from the primary data source, NOAA Weather Plus attempts to use data from a secondary data source (the source used by Perceptive Automation's include NOAA Weather plugin).
  • NOAA Weather Plus devices refresh weather data from NOAA servers every 15 minutes rather than every 30 minutes like the included NOAA Weather plugin.

Installation

Use the download link above to download the latest version of the plugin. Once downloaded, it should automatically unzip, but if it doesn't double-click the zip file to decompress it. If you downloaded the plugin from a computer other than your Indigo server computer, move the plugin file to any location on your Indigo server. Once decompressed and moved to the computer with the Indigo server running, double-click the "NOAA Weather Plus.indigoPlugin" icon. You should be prompted to install and configure the plugin. The only global plugin configuration is the option to turn debug logging on or off (it's off by default). Simply click "Save" to continue. The plugin is installed.

Using It

Use NOAA Weather Plus by creating a new Indigo device within the Indigo client. Within the Devices section of the Indigo client, click the "New..." button. Name the device (perhaps "My Weather"). Select "Plugin" as the device Type. Select "NOAA Weather Plus" as the Plugin. Select "Weather Locale" as the Model. A configuration dialog will appear. Enter the geographic latitude and longitude coordinates of the location for which you'd like to monitor weather conditions and forecast information. (Of course, weather data is limited to that gathered by the US National Weather Service, so coordinates outside the US will either result in an error or very limited data). If you don't know your geographic coordinates, you can click on the "Find My Location Info" button (only works on the Indigo server machine) to open your web browser to Perceptive Automation's suggested location lookup site links.

Version 1.1.12 change: Added more debugging to and updated wind chill calculation algorithm. It now uses the alternate weather information for calculations if needed. Made the alternate data gathering and parsing more efficient.


* NOAA Weather Plus does not contain the following states that do exist in the included NOAA Weather plugin: dewPointString, heatIndexString, temperatureString, windString. Additionally, all measurements are rounded to a realistic (lower) level of precission to more accurately reflect measured values coming from NOAA (e.g. temperatures do not contain decimal values).


Fri Jun 22, 2012 11:34 am
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11689
Location: Texas
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Great -- thanks for contributing it!

Take a look at this API:

Code: Select all
indigo.server.getLatitudeAndLongitude()

You should be able to pre-populate the device UI with some good defaults from the results.

_________________
Image


Fri Jun 22, 2012 11:55 am
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
matt (support) wrote:Take a look at this API:

Code: Select all
indigo.server.getLatitudeAndLongitude()

You should be able to pre-populate the device UI with some good defaults from the results.


Cool! I was wondering if there was a way to get location info from Indigo. Is there a way to pre-populate that information in the device configuration data fields on a first-time setup?


Fri Jun 22, 2012 12:02 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11689
Location: Texas
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Yep. Untested, but something like:

Code: Select all
   def getDeviceConfigUiValues(self, pluginProps, typeId, devId):
      errorMsgDict = indigo.Dict()
      valuesDict = pluginProps
      (valuesDict["lat"], valuesDict["long"]) = indigo.server.getLatitudeAndLongitude()
      return (valuesDict, errorMsgDict)


That isn't quite what you want since it will always override the value, but if you check for the existence of "lat" and "long" in pluginProps first, and only do the logic if they don't exist, then I think it will work.

_________________
Image


Fri Jun 22, 2012 12:17 pm
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Excellent! I'll test it out.

Thanks!


Fri Jun 22, 2012 12:21 pm
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Yes, great addition to our plugin stable.

You might want to document what those fields are - the ones from our plugin are fairly self-explanatory but you've added a bunch and they may not be as intuitive. You might also want to check to see if the states from the old device are in your device (maybe in the deviceCreated method) and if so remove them - otherwise when a user just updates an existing one those old states will hang around not being populated. Note, however, that the states that you dropped can easily be created - they are there to provide a convenient way to display data on a control page that is more complete than just the raw data.

FWIW, our NOAA plugin only refreshes every 30 minutes because the feed we are using is only updated hourly so refreshing any more often would be pointless. Your feed is probably updated more frequently so it makes sense to refresh more often.

_________________
Jay (Indigo Support)
Image


Fri Jun 22, 2012 12:23 pm
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Thanks Jay!

That's some good feedback. Yep, further documentation on the additional fields is certainly in order. I'm not sure how big the demand is for the additional data I've included in this plugin, but I figured most of those who wanted the additional data would be able to figure out what the new fields represent.

jay (support) wrote:You might also want to check to see if the states from the old device are in your device (maybe in the deviceCreated method) and if so remove them - otherwise when a user just updates an existing one those old states will hang around not being populated.


That's a good idea. I noticed this behavior when testing. Unfortunately, I have no idea how to do that. :-) By "deviceCreated" method, do you mean the __init__ method? I don't have a "deviceCreated" method defined. Perhaps that's part of the PluginBase? How would I grab the states from the old device? Would those be in the valuedDict, or maybe device.states[<state name>]? By "remove them" do you mean assign a "- data unavailable -" value to them or do you mean delete the state from the device altogether (if the latter, what method would do that, device.removeState() perhaps)? Thanks.

Yes, I knew the included NOAA Weather plugin only refreshed every 30 minutes because the feed it used was only refreshed every hour. The XML for the feed that it uses explicitly suggests a 60 minute refresh on the 15-past the hour mark. The XML used by this plugin doesn't explicitly recommend a refresh rate, so I just set one somewhat arbitrarily.


Fri Jun 22, 2012 2:25 pm
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Actually, you don't need to call it - when the user switches the old device to the new one it should completely rebuild the state list when the device dialog is saved.

But, in any case, the deviceCreated() method (along with others) are documented in the plugin.py section of the developers guide.

_________________
Jay (Indigo Support)
Image


Fri Jun 22, 2012 3:11 pm
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Ah, good deal. Thanks for the link.


Fri Jun 22, 2012 3:25 pm
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Patch update 1.0.3 released:

fixes an issue with newly formatted NOAA weather condition URLs as of 02-Jul-2012 that caused weather condition icons not to show up properly in Indigo control pages.


Mon Jul 02, 2012 5:43 pm
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Patch update 1.0.5 released:

Fixes since 1.0.3 include workarounds for poorly formatted XML data from NOAA and changing of some XML content error messages to basic warnings in the Indigo log. This prevents SQL Logger plugin error log triggers from firing unnecessarily.


Thu Aug 09, 2012 10:47 am
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Version 1.1 Released!

See original post for download link.

WARNING: Version 1.1 changes almost all weather forecast state names to be more intuitive. This has the unfortunate side-effect of causing any Device State Change triggers based on old forecast states to no longer work and Control Page objects you may have to not appear correctly until set to show the new forecast states.

Major Changes to Version 1.1:

  • Added 9 new device states for up to 3 weather advisories (weatherAdvisory1Text, weatherAdvisory1StartTime, and weatherAdvisory1EndTime, with the ...2... and ...3... versions).
  • Changed almost all forecast state names both within the device definition and in the user interface to make it more clear what each state represents. Added code to "align" the high and low temperature forecasts with the bi-daily weather conditions.
  • Rearranged the order of many of the state values in the user interface.
  • Added code to attempt to find and download weather data from an alternate NOAA weather URL if the information doesn't exist in the primary XML data obtained. This is experimental and may not work for a number of locations.
  • Changed what is inserted into states when data is unavailable. The "- data unavailable -" message will no longer appear in states that have no data. Instead, states will be blanked out (or set to zero, if it's a numeric state) when data is unavailable.
  • Updated some error messages to indicate possible workarounds for parsing errors.


Fri Aug 24, 2012 3:13 am
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Patch update 1.1.4 released:

(See original post for download link).

Changes Since Version 1.1.3

Fixed bug that caused the observation time from the primary data source to always appear to be blank.


Mon Sep 10, 2012 11:04 pm
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Patch update 1.1.5 released:

(See original post for download link).

Changes Since Version 1.1.4

Fixed a bug that caused an error if the moreWeatherInformation data did not exist in the data feed.


Tue Sep 18, 2012 2:28 am
Profile WWW

Joined: Aug 09, 2010
Posts: 763
Location: CA
Post Re: NOAA Weather Plus - A New Indigo 5 Plugin
Patch update 1.1.6 released:

(See original post for download link).

Changes Since Version 1.1.5

Fixed a bug that would cause the runConcurrentThread to exit unexpectedly if the URL for the data was unreachable.


Fri Sep 28, 2012 3:04 pm
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 18 posts ]  Go to page: 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.