Jeff.Woeber

Monitor weather with the WeatherUnderground.com API

Recommended Posts

This datasource uses the Weather Underground API to monitor weather conditions for multiple locations. This will require a Free Weather Underground API key.  This key should be added as a device properties weather.api.key

The datasource exchange locator is KT6NLM

I have an example setup to monitor Austin, TX, Jupiter, FL, and Santa Barbara, CA

5922f5806c1a0_ScreenShot2017-05-22at9_19_55AM.thumb.png.0db618ff1b34688f0d562e044ac0ebdd.png

To get started, add a new device under Expert mode and in the “Link to a URL” box add in api.wunderground.com

592301abeb8b1_ScreenShot2017-05-22at9_52_59AM.png.c545ee2fd2ff132bdedd84a20e55d465.png

 

Once the URL has been added to LogicMonitor click on “Add Monitored Instance”.  Add the weatherdeatails datasource and an instance of your choice.    In my example I used TX/austin.

5922f576d780e_ScreenShot2017-05-22at9_20_39AM.png.39b963f98a5b8c3b7591fa6a92bd2341.png

 

You can add in other locations under the instances tab.

5922f57b68ba5_ScreenShot2017-05-22at9_20_09AM.thumb.png.2daf9ce56a1d025dd4d4263b53f7199e.png

 

For a better understanding on what the Instances Values should be, a complete API URL for Santa Barbara is

http://api.wunderground.com/api/Your_Key/conditions/q/ca/santa_barbara.json

The data source is using an HTTP GET appended to the host URL

GET /api/##weather.api.key##/conditions/q/##WILDVALUE##.json HTTP/1.1

Host:##HOSTNAME##

The instance values is just the STATE/city part of the API URL.  

 

 

 


 

Screen Shot 2017-05-22 at 9.19.55 AM.png

Edited by Jeff.Woeber

Share this post


Link to post
Share on other sites

This is pretty cool, I was able to get it working with the DataSource library out on Exchange.  Has anyone tried any of the other APIs with wunderground.com?  I've been trying to get alerts (https://www.wunderground.com/weather/api/d/docs?d=data/alerts&MR=1) pulled in via an EventSource figuring the data coming over will be more of a text format rather than numbers...but haven't had much luck.

-Mitch

Share this post


Link to post
Share on other sites

@Mcooner - that's a bummer. It looks like OpenWeatherMap has a free API, but the datasources will almost certainly need to be re-written for the different API.

Edit/ Update: Since I suggested it, I went ahead and made the new one (locator code GRZDYN) using the OpenWeatherMap API (linked above.) Per the previous efforts of the illustrious @Jeff.Woeber, cities are added in a similar fashion, only using zip codes instead of city names - you will need a free API key set as property owm.api.key :

5b107c7d4af75_ScreenShot2018-05-31at3_14_17PM.png.97c97ae05ab6b34bbf6116f1e434ce01.png

5b107c9168644_ScreenShot2018-05-31at3_48_21PM.thumb.png.87446356b70eeef9295c037eab50819e.png

*FYI, the API is rate limited to 60 calls per hour, so if you have more than three cities added, you'll need to increase the polling interval from 3 minutes to something less often...

Edited by Kerry DeVilbiss
new datasource and notes

Share this post


Link to post
Share on other sites

This is very cool!  I added the weather condition datapoint to my imported copy as that is often a critical correlation item ($.weather[0].id) for site outages.  The trick will be building out a large enough legend for those (https://openweathermap.org/weather-conditions).  I am also trying to figure out how this data can be effectively shared and displayed across multiple clients without excessive manual maintenance.  May have to use the LM API to maintain dashboards, unclear yet.  It would be very helpful if you could tie this to the map widget...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now