Drupal is a registered trademark of Dries Buytaert
Release: reCAPTCHA 8.x-3.5 Minor update available for module recaptcha (8.x-3.5). Release: Search API Solr 4.3.14 Minor update available for module search_api_solr (4.3.14). Release: ECA: Event - Condition - Action 2.1.22 Minor update available for module eca (2.1.22). Release: WebProfiler 11.2.1 Minor update available for module webprofiler (11.2.1). Usage Milestone: Entity Browser Module entity_browser crossed 100,000 active installs. Release: Editoria11y SI (SiteImprove) 3.0.0 Major update available for module editoria11y_si (3.0.0). Release: Diagnosis 1.0.3 Minor update available for theme diagnosis (1.0.3). Release: DiBa Integration 1.3.3 Minor update available for module diba_integration (1.3.3). Release: AlternativeCommerce NovaPoshta API 1.1.10 Minor update available for module basket_novaposhta (1.1.10). Module Revived: WebProfiler 11.2.0 Module webprofiler updated after 14 months of inactivity (11.2.0).

AEMET

3 sites Security covered
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.

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 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