Skip to content

๐Ÿ‡ช๐Ÿ‡ธ es-aesa โ€‹

CountrySpain
Registration prefixEC-
Data sourcehttps://www.seguridadaerea.gob.es/sites/default/files/aeronaves_inscritas.pdf
FormatPDF (fixed URL)
Run frequencyWeekly (Thursday, 08:10 UTC)
Depends on Mictronics for ICAO hexYes โ€” this runner does not publish ICAO hex (Mode S) addresses; registrations are resolved via RediSearch against Mictronics records (idx:aircraft:mictronics). Must run after the mictronics runner.

How it works โ€‹

The AESA (Agencia Estatal de Seguridad Aรฉrea) register PDF is downloaded from a fixed URL and parsed with pdfplumber's extract_tables() โ€” unlike some other PDF-based runners in this repo, table detection works reliably here, so no manual x-position column grouping is needed. The first row of each detected table is treated as the header; rows are zipped into dicts keyed by header text, and only rows whose first cell starts with EC- are kept. A quirk of this PDF: pdfplumber sometimes extracts Unicode hyphen variants (en-dash, em-dash, non-breaking hyphen, etc.) instead of ASCII -, so every cell value is translated through a Unicode-hyphen-to-ASCII table before use โ€” this matters both for the EC- prefix check and for the RediSearch lookup key. Every written record explicitly sets military: false โ€” this register is exclusively civil, and the explicit value ensures a stale military: true flag (from Mictronics or a prior record on a reused hex) is corrected on re-registration. The Spanish Clase (aircraft class) column is decoded through a fixed Spanishโ†’English map (e.g. AVION โ†’ Airplane). No registrant data is available in this register at all. Manufacturer, model, serial number, powerplant manufacturer, powerplant model, and Clase are all whitespace-collapsed before use, since pdfplumber sometimes represents a wrapped cell's text with an embedded newline rather than a space โ€” including mid-word (e.g. Clase values like PLANEADOR/MOTOPLANEADOR can arrive wrapped as PLANEADOR/MOTOPL + newline + ANEADOR), which is why the _CLASE_MAP lookup key and the NO DISPONIBLE serial-number placeholder are both written in already-collapsed (space-joined) form.

Columns โ€‹

Source columnImportedNotes
Matrรญculaโœ…EC-prefix; used as the Mictronics lookup key
Fecha matric.โŒPresent in source; not read by this runner
Fabricanteโœ…โ†’ aircraft.manufacturer; embedded newlines collapsed to a single space
Modeloโœ…โ†’ aircraft.model; embedded newlines collapsed to a single space
Nยบ serieโœ…โ†’ aircraft.serial_number; embedded newlines collapsed to a single space; NO DISPONIBLE placeholder is filtered, not stored
Aรฑo cons.โœ…โ†’ aircraft.manufactured_date (as YYYY-01-01); sentinel year 1900 is filtered, not stored
Marca Motorโœ…โ†’ aircraft.powerplant.manufacturer; embedded newlines collapsed to a single space
Modelo Motorโœ…โ†’ aircraft.powerplant.model; embedded newlines collapsed to a single space
Nยบ mot.โœ…โ†’ aircraft.powerplant.count
Claseโœ…Whitespace-collapsed, then decoded via a Spanishโ†’English map โ†’ aircraft.type

See specs/data-dictionary.yaml (es-aesa entry) for full column semantics and cross-source schema notes.

Example Output โ€‹

Read back the merged record for a given ICAO hex (combines this runner's data with Mictronics and any other sources that have written to the same key):

bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 3471CD | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufactured_date": "1979-01-01",
        "manufacturer": "CESSNA AIRCRAFT COMPANY",
        "manufacturer_model": "CESSNA 172 Skyhawk",
        "model": "172N",
        "powerplant": {
            "count": 1,
            "manufacturer": "LYCOMING",
            "model": "O-320-H2AD"
        },
        "serial_number": "17273683",
        "type": "Airplane",
        "type_designator": "C172",
        "wake_turbulence_category": "Light"
    },
    "icao_hex": "3471CD",
    "military": false,
    "registration": "EC-GNS",
    "source": "es-aesa"
}
bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 342107 | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufactured_date": "2004-01-01",
        "manufacturer": "AIRBUS S.A.S.",
        "manufacturer_model": "AIRBUS A-321",
        "model": "A321-213",
        "powerplant": {
            "count": 2,
            "manufacturer": "C.F.M",
            "model": "CFM56-5B2/P"
        },
        "serial_number": "2357",
        "type": "Airplane",
        "type_designator": "A321",
        "wake_turbulence_category": "Medium"
    },
    "icao_hex": "342107",
    "military": false,
    "registration": "EC-JDM",
    "source": "es-aesa"
}

Configuration โ€‹

Reads settings.json (mounted at /app/settings.json):

ParameterRequiredDefaultNotes
redis.hostโœ…โ€”Redis connection host
redis.portโŒ6379
mqtt.hostโŒโ€”Omit the whole mqtt block to skip completion-stats publishing entirely
mqtt.portโŒ1883
mqtt.usernameโŒโ€”Optional MQTT auth; omit for an anonymous broker
mqtt.passwordโŒโ€”
redis_ttl_daysโŒ14TTL applied to each aircraft:registry:{icao_hex} key written by this runner

MQTT โ€‹

Published once, at the end of a run, to SkyFollower/runner/es-aesa/statistic/{name} (all retained):

Topic suffixValueFormat
records_importede.g. 271Integer as string
last_run_ate.g. 2026-07-07T14:32:01.123456+00:00ISO 8601 UTC
last_run_statussuccess or failureString

Home Assistant autodiscovery configs are also published (retained) to homeassistant/sensor/SkyFollower_runner_es_aesa_{name}/config for each of the three stats above.