MagicMirror² Module to display weather forecast information from Environment Canada.
Version 1.1, August 2023 Copyright © Charles Morris
MMM-EnvCanada is a MagicMirror² Module to display Environment Canada weather forecast information. The default Weather Module has an envcanada provider to display Environment Canada data in the MagicMirror² Weather Module. However, Environment Canada provides more information than the default module can display. This module displays the text forecast, the marine wind forecast, the Air Quality Health Index, and a graphical display of the forecast for day and night. This module does not display current conditions, as the default weather module provides that function very well. Some code from the envcanada provider has been incorporated or modified and incorporated into this module.
- Navigate to the
modules
foldercd ~/MagicMirror/modules
- Clone the repository
git clone https://github.com/CharlesMorris78/MMM-EnvCanada.git
- Add the module to your MagicMirror² by copying the sample configuration below and add that to your
config.js
- Navigate to the
MMM-EnvCanada
foldercd ~/MagicMirror/modules/MMM-EnvCanada
- Update from the repository
git pull
Here's an example of a basic config for the module. See full list of available settings below under Configuration
{
module: 'MMM-EnvCanada',
position: 'top_right',
header: "Environment Canada Forecast for Picton",
config: {
siteCode: "s0000702",
provCode: "ON",
updateInterval: 10 * 60 * 1000,
language: "e",
textForecasts: 2,
showAlerts: true,
showForecastDays: 5,
marineRegion: "great_lakes",
marineSubRegion: "m0000144",
marineLocation: "Eastern Lake Ontario"
}
},
Setting | Description |
---|---|
airQualityProv |
Administrative zone code for Air Quality Health Index. If paramter is not provided, the index is not displayed.
|
airQualityRegion |
Region code for Air Quality Health Index. If paramter is not provided, the index is not displayed.
|
header |
Text for the module header. If paramter is not provided, the Environment Canada location text for the configured siteCode is used.
|
language |
The display language provided by Environment Canada: English (e) or French (f).
|
marineEndMonth |
Final month to display the Marine Forecast.
|
marineLocation |
Location for Marine Forecast. If language is f (French), must be the French language version of the location.
|
marineRegion |
The region for Marine Forecast. If set to empty string (the default) no Marine Forecast is displayed. Other paramters must be correct or no Marine Forecast will be displayed.
|
marineStartMonth |
First month to display the Marine Forecast.
|
marineSubRegion |
The subregion code for Marine Forecast.
|
provCode |
The 2-character province code for the selected city/town.
|
showAlerts |
Boolean to decide if weather warnings should be included in the forecast text.
|
showforecastDays |
The number of days to display the forecast in graphical format. If less than 3, no graphical forecast is displayed.
|
siteCode |
The city/town unique identifier for which weather is to be displayed. Format is 's0000000'.
|
textForecasts |
The number of text forecasts to display. Environment Canada provides two forecasts for each day: today and tonight. If set to 0, no text forecast is disdplayed.
|
updateInterval |
The duration of time between each attempt to refresh the forecast information, in miliseconds.
|
This is my first MagicMirror module. There probably are better ways to do some of the things I have implemented, but this represents what I have learned so far, with thanks to the authors of the envcanada provider code for the default weather module. I will respond to questions and suggestions as promptly as possible.