Skip to main content

Environment Canada Data Source

The Environment Canada (EnvCan) data source retrieves weather observation data from the Canadian Weather Service's public API. It connects to Environment Canada's historical climate data service using a station ID and progressively downloads hourly weather observations, including temperature, humidity, wind speed, pressure, and other meteorological measurements. The data source automatically advances through time periods as data becomes available, building a historical record from the configured start date forward.

This data source is commonly used for weather-correlated energy analysis, building performance monitoring, agricultural monitoring, and any application where accurate local weather data from Canadian weather stations is needed.

Overview

PropertyValue
ModulemangoAutomation-EnvCan
ProtocolEnvironment Canada XML
DirectionPolling
Typical UseCanadian weather station data collection

Prerequisites

  • An Environment Canada station ID for the weather station you want to monitor. Station IDs can be found by navigating to Environment Canada Historical Data Search, searching for a location, and extracting the StationID= parameter from the resulting URL.
  • Network connectivity from the Mango server to Environment Canada's web services (internet access).

Configuration

Data Source Settings

SettingDescription
NameA descriptive name for the data source.
Station IDThe numeric station identifier from Environment Canada's climate data service.
Update periodHow frequently the data source checks for new data from the weather station.
Data start timeThe date from which to begin collecting data. This applies when any point on the data source has no existing history when polling begins.
important

The data source advances its internal time pointer only when it successfully finds temperature data for the station. If the data start time is set to a period before the station was active (or the station has no temperature data), the data source will not advance and will appear stuck. Set the data start time to a date when the station was known to be reporting.

Data Point Configuration

Each data point maps to a specific weather attribute from the station's observations.

SettingDescription
AttributeThe weather measurement to store in this point. Select from the available attributes for the configured station.

Available weather attributes typically include:

AttributeDescriptionData Type
TemperatureAir temperatureNumeric
Dew Point TemperatureDew pointNumeric
Relative HumidityRelative humidity percentageNumeric
Wind DirectionWind direction in degreesNumeric
Wind SpeedWind speedNumeric
VisibilityVisibility distanceNumeric
Station PressureAtmospheric pressure at station levelNumeric
HumidexHumidex value (combined heat and humidity index)Numeric
Wind ChillWind chill factorNumeric
WeatherWeather condition description (e.g., "Clear", "Rain")Alphanumeric

The exact attributes available depend on the instruments installed at the selected weather station. Not all stations report all attributes.

Common Patterns

Weather-Correlated Energy Analysis

Pair the Environment Canada data source with building energy data (from eGauge, Modbus power meters, or SQL databases) to correlate energy consumption with outdoor temperature and weather conditions. This enables degree-day analysis, identifies weather-dependent energy patterns, and supports energy model calibration.

Building Performance Monitoring

Use outdoor temperature data from Environment Canada to evaluate HVAC system performance. Compare indoor temperatures (from building sensors) against outdoor conditions to calculate heating/cooling efficiency and detect equipment degradation over time.

Agricultural Monitoring

Farmers and agricultural operations can use Environment Canada data to track growing degree days, frost events, humidity levels, and precipitation patterns. Create event detectors to alert on frost warnings or extreme temperature conditions.

Historical Weather Data Collection

Set the Data start time to a date in the past to progressively backfill historical weather data. The data source will work through the historical record, downloading data hour by hour until it catches up to the current time. This is useful for populating Mango with weather data that predates the system installation.

Multi-Station Coverage

For large geographic areas or applications requiring data from multiple locations, create separate Environment Canada data sources for each station. This provides a network of weather monitoring points that can be compared or aggregated.

Troubleshooting

Data Source Appears Stuck (Not Advancing)

  1. The most common cause is that the Data start time is set to a period when the station was not reporting temperature data. The data source requires temperature data to advance its time pointer.
  2. Verify the station ID is correct and that the station was active during the configured start period.
  3. Try advancing the Data start time to a more recent date when the station is known to have been reporting.

Missing Attributes

  1. Not all weather stations report all attributes. If a specific attribute is not available for your station, it will not appear in the attribute selection or will return no data.
  2. Some attributes (such as Humidex and Wind Chill) are only reported during certain seasons or weather conditions.

Slow Data Collection

  1. The data source downloads historical data incrementally, one time period per poll cycle. If you need to backfill a large amount of historical data, be patient -- the process is intentionally gradual to avoid overwhelming Environment Canada's servers.
  2. Reducing the Update period will cause more frequent requests, speeding up the backfill process. However, be mindful of not sending excessive requests to the public API.

No Data for Recent Periods

  1. There is typically a delay between when weather observations are taken and when they become available through the API. Current-hour data may not be available yet.
  2. Check that the station is still active and reporting. Some stations are decommissioned or experience outages.

Network Connectivity Issues

  1. The data source requires internet access to reach Environment Canada's web services. Verify that the Mango server can access climate.weather.gc.ca.
  2. If the Mango server is behind a proxy, ensure the proxy allows outbound HTTP connections to Environment Canada's domain.