Weather.gov National Digital Forecast Database (NDFD) REST Web Service


#1

1) Give a description of the problem
I’ve done some searching in this community and it seems most use Weather Underground to retrieve weather data. I’m wondering if anyone has been able to use the REST service offered by the National Weather Service instead. I’ve done this using the JSON features in Tasker for Android, but have no idea how to duplicate the results for Smart things. I’m a beginner who is still learning my way around.

Here’s the documentation for the service: https://graphical.weather.gov/xml/rest.php

Here’s a web front end they created to demonstrate the service and generate the XML response: https://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXML.htm

2) What is the expected behavior?
The piston would run on a schedule. Say twice daily. It needs to pull hourly forecast data. For example, the predicted snowfall for the next 48 hours (in inches). The REST service returns an XML file containing an array of hourly amounts. These hourly amounts should be summed (i.e. the total predicted snowfall over the upcoming timeframe) and that sum should be stored in a variable. Then, that variable could be used to do a variety of things. Each time the query runs, the variable is updated. So you’re basically getting a rolling snapshot of predicted snowfall over the next two days. You could then do something like send an alert if the predicted snowfall is greater than 2 inches, etc. This is just one example.

3) What is happening/not happening?
I haven’t even started. My hope is someone has played around with this API already.