I built this module more by need than anything else – the Seattle area where I live has been hit by some relatively severe weather the past few days, that have caused real problems for the area. While I wasn’t caught off-guard this time, I realized that the MM weather modules I had didn’t emphasize local warnings, alerts, and weather watches. So I built a module expressly for solving that problem:
MMM-NOAAAlerts
Special Weather Statement:
Warning.png
Flood Warning:
Flood.png
USING THE MODULE
Github Link
Standard installation:
git clone https://github.com/mmtsweng/MMM-NOAAAlerts
cd MMM-NOAAAlerts
npm install
Basic configuration:
{
module: "MMM-NOAAAlerts",
position: "top_bar",
config: {
userAgent: "Magic Mirror (xxxxxxxxxxxx@gmail.com)" //Custom contact information
APIURL: "https://api.weather.gov/alerts/active?point=47.593,-122.333", //See below for other options
debug: false, // [Optional] Print extended debugging logs to the console
rotateInterval: 20*1000, // [Optional] How often to switch to the next alert/alarm
updateInterval: 30*60*1000, // [Optional] How often to ping the API for more data
}
},
NOAA provides a free API to retrieve weather alerts, which this API uses. There is no registration required.
There are multiple ways to set the forecast area, and NOAA provides through documentation if you need extensive help. But the basics are
By State: https://api.weather.gov/alerts/active?area={state}
By
Zone: https://api.weather.gov/alerts/active?zone={zone}
By Lat/Long: https://api.weather.gov/points/{latitude},{longitude}
By Grid: https://api.weather.gov/gridpoints/{office}/{grid X},{grid Y}/forecast
NOAA requires that a User-Agent header be provided. Please set your own custom agent in the config with unique contact information (the suggested header is: User-Agent: (myweatherapp.com, contact@myweatherapp.com) , so following that format makes sense.
This is still very much a work in progress. I have spent very little time styling it, and I haven’t even put together the README file yet (I’m going to steal this post, actually!). But I have had it running for the past 2 days with no major issues. So far I’ve only tested it in the top bar section. If anyone else wants to try it and provide feedback I’ll be actively improving it.