NWS Weather Information Driver

Hello,

I wanted to have a good morning greeting play at 7AM each morning which gave a weather forecast for the upcoming day - I had planned on doing this using Rules Engine. The challenge I had however was finding a reliable driver which gave a weather forecast (not just alerts) that I could use within the greeting. With this in mind, I set about creating my own...

Apologies if I am duplicating efforts that someone else has already done, I just couldn't find anything that worked for me.

Some of the key points of my driver:

  1. The driver pulls the forecast from the National Weather Service API (API Web Service) so no API keys are required.
  2. The driver uses the longitude and latitude settings from the hub (settings -> hub details) to determine the location and thus get the correct forecast.
  3. The driver stores a bunch of data within Current States that can be used, but the most interesting one (at least for my use case) is ** weatherSummaryString** which is a human readable weather forecast that can be used in TTS situations for example.

Here's the direct link to the driver for importing purposes - https://raw.githubusercontent.com/b69ca/hubitat-drivers/main/nws-weather-info.groovy

Once you import the custom driver code, create a new device using the driver and then use Refresh to pull the latest forecast. The returned data (and populated properties) should look like this -

With this working, it's possible then to use this information in Rules Engine similar to the following:

Hopefully this is of use to someone...

8 Likes

Similar to:

Same source data at the very least. :slight_smile:

1 Like

Very cool. I did something similar in webCoRE, which has baked-in weather attributes. It triggers the first time that I walk into the kitchen or living room each morning. The Sonos speakers are sometimes grouped throughout the house, so I had to ungroup each day.

Weather Piston

1 Like