This is a module for the MagicMirror².
This module displays Weather Warnings from the UK Met Office.
This module will also send notifications of Weather Warnings for use by other modules.
- Navigate into your MagicMirror's
modules
folder and executegit clone https://github.com/maloakes/MMM-UKMOWeatherWarnings
. A new folderMMM-UKMOWeatherWarnings
will appear.
To use this module, add a configuration block, similar to this example, to the modules array in the config/config.js
file:
var config = {
modules: [
{
module: 'MMM-UKMOWeatherWarnings',
config: {
// See below for configurable options
region: 'sw',
apiBase: 'http://www.metoffice.gov.uk/public/data/PWSCache/WarningsRSS/Region/',
}
]
}
Option | Description |
---|---|
apiBase |
Required UKMO Weather Warnings feed URL Type: string e.g. http://www.metoffice.gov.uk/public/data/PWSCache/WarningsRSS/Region/ |
region |
Required UKMO Weather Warnings Region Type: string See table below, e.g. sw |
updateInterval |
Optional Update interval Type: int (milliseconds) Default 900000 milliseconds (15 minutes) |
retryDelay |
Optional Retry delay Type: int (milliseconds) Default 5000 milliseconds (5 seconds) |
tableClass |
Optional Size used for table Type: string Default small |
colored |
Optional Whether to color the warning symbol or display level as character Type: boolean Default true |
broadcastCurrent |
Optional Whether to send notifications for current warnings Type: boolean Default false |
broadcastForecast |
Optional Whether to send notifications for warnings during forecast period Type: boolean Default false |
broadcastListSize |
Optional Size (i.e. number of days) of the forecast list Type: int Default 5 |
useTestData |
Optional Whether to use test data instaed of the live feed Type: boolean Default false |
testUrl |
Optional URL of the test data file Type: string e.g. http://localhost:8080/modules/MMM-UKMOWeatherWarnings/public/warns.json |
backgroundMode |
Optional Whether to run in background mode, only sending notifications Type: boolean Default false |
delta |
Optional Look ahead delta for current warnings Type: int (minutes) 0 |
Code | Region |
---|---|
os | Orkney & Shetland |
ta | Central, Tayside & Fife |
he | Highlands & Eilean Siar |
gr | Grampian |
st | Strathclyde |
dg | Dumfries, Galloway, Lothian & Borders |
ni | Northern Ireland |
wl | Wales |
nw | North West England |
ne | North East England |
yh | Yorkshire & Humber |
wm | West Midlands |
em | East Midlands |
ee | East of England |
sw | South West England |
se | London & South East England |
This module can send notifications of weather warnings. The module can be run in background mode to send the notifications without displaying the data itself.
Example payload item;
{ level: "A", color: "orange", type: "Snow" }
Notification | Payload |
---|---|
WEATHER-WARNING-CURRENT |
Highest level alert for the current period |
WEATHER-WARNING-FORECAST |
Array of highest level alert for each day of forecast period |
Test data can be generated, since we don't get warnings all of the time.
- Navigate into your MagicMirror's
modules/MMM-UKMOWeatherWarnings/testing
folder. - Execute
node createDummyWarnings.js
- A file,
warns.json
will be generated in your modulespublic
folder - Edit your config.js file to set
useTestData
andtestUrl
- Start/Restart your mirror