Skip to main content

4.7 - The weather

The Weather element shows the weather for a place: today and the following days. No script, no call to a third-party site from the visitor's browser: the site reads the forecast and keeps it for an hour.

What is shown

For each day:

  • a sky icon;
  • the high and low temperatures;
  • the rain, in millimetres;
  • the wind, its direction and its gusts. From 70 km/h, gusts are written in bold;
  • the reliability of the forecast, in five dots (see below).

The shape follows the space: cards side by side at full width; in a narrow column, the days follow one under the other, and today stays as a card. Under the days, the update time and the forecast source, with its licence: this credit is required.

Settings

On the element line:

SettingWhat it does
PlaceAn address or a town. The site finds its position once and keeps it.
Weather titleEmpty: "Weather".

Behind the element gear:

SettingWhat it does
Title on screenShown or hidden. Hidden, it is still read by screen readers.
Number of days3, 4 (default), 5 or 7, today included.
"See all 7 days" buttonShown by default. Below the module's days, it opens the whole week in a window, which closes with the cross, with Escape or with a click outside it. It does not appear if the module already shows 7 days.
Week button textEmpty: the text from the site language.
ReliabilityShown by default. A score from 1 to 5 per day: how well the 51 variants of the European model (ECMWF) agree, on the high temperature and on "rain or not".
Icon colourThe site accent colour (default), or weather colours: yellow sun, grey cloud, blue rain, purple storm, light blue snow, green wind. The shades change in dark mode.
Forecast sourceOpen-Meteo (default), Météo-France (served by Open-Meteo) or MET Norway. See below.
Latitude, longitudeOptional. A position entered here comes before the place.
Météo-France key (weather warnings)Optional. See below.

Which source to choose

  • Open-Meteo: the default source, with gusts. Free for a site without ads or subscriptions (town hall, association, personal site). A business site takes an Open-Meteo subscription, or chooses MET Norway.
  • Météo-France: the AROME and ARPEGE models, served by Open-Meteo, on the same terms. They cover about four days: beyond that, the days come from Open-Meteo, and the credit under the days says so.
  • MET Norway, the Norwegian Meteorological Institute: free for everyone, businesses included. It does not give gusts.

Reliability also comes from Open-Meteo, on the same terms: a business site without a subscription hides it.

If the chosen source does not answer, another one takes over. If none answers, the last forecast kept is still used, for one day at most.

Météo-France weather warnings

Optional, for every site, businesses included. With a key, a banner shows above the forecast when the département of the place is on a yellow, orange or red warning: the colour, each hazard (high winds, rain and flooding, thunderstorms, river floods, snow and ice, heatwave, extreme cold, avalanches, waves and coastal flooding), its times, and a link to the Météo-France bulletin. On green, or without a key, nothing is added. Mainland France only.

Getting the key

The key is free. The Météo-France portal screens may change: the steps below describe them as they were in October 2026.

  1. Create an account on the Météo-France API portal, portail-api.meteofrance.fr, and confirm it with the email you receive.
  2. In the API catalogue, choose Données Publiques Vigilance (Bulletin Vigilance), then Souscrire (subscribe), with the application offered.
  3. Generate a token of the API Key type. For the validity duration, enter 0: the key never expires. With the duration offered by default, it stops working after an hour.
  4. Copy the key straight away: it is shown only once.
  5. Paste it into the Weather element, behind the gear, in Météo-France key (weather warnings), then save.

Opus reads the warning map at most once every fifteen minutes for the whole site, however many modules there are.

If the banner is missing while a warning is in force, look at the page source: Opus writes the reason there in a comment, for example vigilance : reponse 401 for a refused or expired key.

Good to know

  • The position of the place is looked up only once, as for the map. For a place that is badly found, give the latitude and longitude.
  • The update time follows the site time zone, set in the Global Configuration.
  • The icons are named for screen readers, and the reliability is spelled out ("4 out of 5").
  • The week window opens without a script, through a recent browser feature: on a browser older than 2024, the button does nothing.
  • A template can change each icon shade through its CSS tokens, for example --opus-meteo-soleil and --opus-meteo-soleil-sombre.

To go fast

In Choose a layout, under Or a single element, the Weather brick places the element on its own, with London as the sample place, to replace with your own.

Up to date for Opus 1.5.930.