Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

AEMET

3 sites Security covered Drupal 10–11
View on drupal.org

This module displays weather information for Spanish locations by integrating with the Spanish Meteorological Agency (AEMET). It allows you to add blocks showing weather data for specific municipalities, leveraging AEMET's OpenData API.

Shows Weather information from spanish locations integrating with AEMET, the Spanish Meteorological Agency. Recommended for sites that shows information of specific cities or towns from Spain.

This module is NOT an official one and uses AEMET data from their OpenData API.

Features

  • Allows adding a block showing weather information for a specific municipality.
  • Provides services to perform requests to AEMET. This service can scale according to future requirements of Drupal sites.

Requirements

It is needed having an API key from Aemet. It can be requested at the Aemet OpenData page.

How to use

After installing Aemet, it is needed to add the API key at Configuration -> Web Services > Aemet

To show the weather information, go to 'Block Layout' and add the Block named 'Aemet Weather: Hourly prediction':

To configure the block, it is needed to specify the municipality code.

This code must be obtained from the INE municipality list. For any location, the code is build by joining the values of the columns CPRO and CMUN.

For example, the code for Albacete can be obtained by joining 02 and 003: 02003

After that , the block with the weather information must appear.

Real-Time block configuration

To display real time information from AEMET in sites with anonymous page cache, it is recommended using the AJAX block module. This module allows adding a specific block via AJAX, with possibilities of caching and automatic refresh.

Extending

To customize the output of the municipality weather block, it is possible replacing the weather-info SDC.

Also, there is a service that allows getting the hourly weather for a specific province, the aemet.client service. For example, is possible getting the hourly weather prediction for a municipality by running this code:

      $aemetClient = \Drupal::service('aemet.client');
      $prediction = $aemetClient
        ->predictionsSpecific()
        ->getMunicipalityPredictionHourly('02003');

In case more endpoints from AEMET OpenData are needed feel free opening an issue.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 5
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
2.0.1 Stable 10–11 Feb 3, 2025
2.0.0 Stable 8 Feb 3, 2025
2.0.0-rc1 Pre-release 10–11 Jan 31, 2025
2.0.0-beta1 Pre-release 10–11 Jan 30, 2025
2.x-dev Dev 10–11 Jan 30, 2025