The gateway has two weather drivers: Weather (Switzerland, France, Belgium), based on the free prevision-meteo.ch service, and Meteo Matics, based on the paid Meteomatics API. This article helps you choose between them and gives three ready-to-use examples: outdoor temperature to the BMS, sun protection according to the cloud cover, and frost or wind alerts.
Checked against: firmware r9347. Licences: both drivers are licensed features (contact support@weble.ch); Meteomatics also needs a Meteomatics account. Level: HVAC and shading integrators.
| Weather (Switzerland, France, Belgium) | Meteo Matics | |
|---|---|---|
| Data source | prevision-meteo.ch (free service) | Meteomatics API (paid account, request quota) |
| Coverage | Localities of Switzerland, France and Belgium | Any point given by latitude and longitude |
| Data | Current conditions, daily forecast for the next days, hourly forecast (temperature, humidity, wind, precipitation, cloud cover…) | More than 100 parameters (temperature, wind, radiation, sunshine duration…), at a chosen time (now, now+3H, tomorrow…) |
| Addresses | Created automatically, all at once | You create only the addresses you need |
| Refresh | Every 8 to 18 minutes, not configurable | Polling per address; each refresh is one request on your quota |
| Gateway category | Other | IoT |
| Values | Read-only | Read-only |
Choose Weather for a site in Switzerland, France or Belgium that needs the usual values (temperature, wind, cloud cover, forecast of the next days). Choose Meteo Matics outside these countries, for parameters the free service does not give (solar radiation, for example), or when you need a precise time horizon.
Both are forecast services refreshed every few minutes: they are not a substitute for a local sensor where safety is involved (wind alarm of blinds, frost protection of a plant).
Create the gateway (Insert gateway › Weather (Switzerland, France, Belgium)), search the Locality in the search dialog and start it. All addresses are created automatically with the prefix %weather:; the complete list is in Weather.
| Address | Content |
|---|---|
%weather:current_condition_tmp |
Current outdoor temperature (°C) |
%weather:current_condition_humidity |
Current relative humidity (%) |
%weather:current_condition_wnd_spd, %weather:current_condition_wnd_gust |
Current wind speed and gusts |
%weather:fcst_day_0_tmin, %weather:fcst_day_0_tmax |
Today's minimum and maximum; fcst_day_1_… for tomorrow |
%weather:fcst_day_<d>_hourly_data_<h>H00_TMP2m |
Temperature forecast for day <d> at hour <h>; other fields: RH2m, WNDSPD10m, WNDGUST10m (km/h), APCPsfc (mm), LCDC / MCDC / HCDC (cloud cover, %) |
%weather:fcst_day_<d>_sunshineAverage |
Estimated share of clear sky for the day, in %, computed by the gateway from the three cloud layers |
Create the gateway (Insert gateway › Meteo Matics), fill Username and Password of the Meteomatics account, and Latitude / Longitude of the site (for example 46.9481 and 7.4474). Both coordinates are required. Then insert one address per value. The address builder has a Date list (now, today, yesterday, tomorrow, custom), an Operator with a delta, and a Parameters list where you search the parameter by name.
The address name has the form %meteomatics:<date>/<parameter>:
| Address | Value |
|---|---|
%meteomatics:now/t_2m:C |
Temperature at 2 m now, in °C |
%meteomatics:now+3H/t_2m:C |
Temperature in 3 hours |
%meteomatics:now/wind_speed_10m:ms |
Wind speed at 10 m now, in m/s |
%meteomatics:today/sunshine_duration_1h:min |
Sunshine duration |
One address returns one value. Several parameters separated by commas (now/t_2m:C,wind_speed_10m:ms) create one child address per parameter, with a single request for all of them.
Polling and quota. Set Polling in milliseconds on each address. Each refresh is one request counted on your Meteomatics account: 900000 (15 minutes) to 3600000 (1 hour) is enough for a forecast. Group the parameters with the same polling in one address to save requests. The Statistics tab of the address table shows the usage of the account (%meteomatics:statistics/...); reading these addresses also counts as a request.
Many controllers need the outdoor temperature for their heating curve. Create a route:
| Parameter | Value |
|---|---|
| Source | %weather:current_condition_tmp (or %meteomatics:now/t_2m:C) |
| Destination | an analog value of the BACnet gateway, or a KNX group address of type temperature (DPT 9.001), for example 1/4/0 |
The value is sent at each refresh where it changes. To keep the history, set Log on the source address (see Logging & history).
Goal: enable the automatic sun protection of the blinds (a KNX group address, here 2/1/10) only on days that are forecast as mostly sunny. Create a route from %weather:fcst_day_0_sunshineAverage to 2/1/10, with this function in Source value:
function sunProtection(v, src, dst, options){
var clear = Number(v)
if(v === null || v === "" || isNaN(clear)) return // no forecast: nothing is sent
return clear >= 60 ? 1 : 0 // 1 = automatic sun protection enabled
}
Adjust the threshold (60 %) to the site. With Meteomatics, use a cloud cover or radiation parameter of the Parameters list instead, with the same function.
Frost forecast by e-mail. Route %weather:fcst_day_1_tmin (tomorrow's minimum) to an SMTP address such as facility@example.com:Frost forecast. Tick only the value trigger, so that a restart does not send the e-mail again, and use this function:
function frostAlert(v, src, dst, options){
var tmin = Number(v)
if(v === null || v === "" || isNaN(tmin) || tmin > 0) return // nothing to send
return "Frost forecast for tomorrow: minimum " + tmin + " °C."
}
The e-mail is sent when the forecast minimum changes and is at or below 0 °C.
Strong wind. The same pattern applies to %weather:current_condition_wnd_gust (or %meteomatics:now/wind_speed_10m:ms, in m/s): return a text or a command above the threshold, nothing below. Use it for information or as an additional protection, never as the only wind protection of exterior blinds: keep a local wind sensor for that.
| Symptom | Cause and fix |
|---|---|
| Weather: no address after the start | The locality was not chosen in the search dialog, or the gateway cannot reach the Internet. Check the gateway log. |
| Meteo Matics: every address fails | Latitude / Longitude empty, or wrong credentials. |
| Meteo Matics: a value never changes | Polling is 0 on the address: set a polling. |
| Meteo Matics: the account runs out of requests | Raise the polling, group parameters in one address, and check the Statistics tab. |
The log shows missing license |
The gateway has no licence for the weather driver. |