Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

aemet

3 sites Security covered
View on drupal.org

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.

Activity

Total releases
5
First release
Jan 2025
Latest release
1 year ago
Release cadence
1 day
Stability
40% stable

Release Timeline

Releases

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