Skip to content

๐Ÿ‡ง๐Ÿ‡ฌ bg-caa โ€‹

CountryBulgaria
Registration prefixLZ-
Data sourcehttps://www.caa.bg/bg/category/300/17238
FormatXlsx (date-encoded filename, discovered via index page)
Run frequencyWeekly (Wednesday, 00:10 UTC)
Depends on Mictronics for ICAO hexYes โ€” this runner does not publish ICAO hex addresses; LZ- registrations are resolved via RediSearch against Mictronics records (idx:aircraft:mictronics). Must run after the mictronics runner.

How it works โ€‹

The Bulgaria CAA index page is scraped for a link matching Aircraft_Register_\d+.xlsx, then that xlsx is downloaded and parsed with openpyxl in read-only mode. The first two rows (an info line and the header row) are skipped; data starts at row 2. Columns are addressed by fixed 0-based position rather than by header name, and only rows whose registration column starts with LZ- are kept. Registrations are resolved to icao_hex in batches of 100 via RediSearch against the Mictronics index โ€” unlike the other runners in this batch, bg-caa does not run a model/type sanity check against the existing Mictronics record before writing. 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.

Columns โ€‹

Source columnImportedNotes
ะ ะตะณ. โ„– (col 0)โŒParsed row but column not read; registration comes from col 4 instead
ะ”ะฐั‚ะฐ (col 1, Excel serial date)โŒNot read
ะœะพะดะตะป (col 2)โœ…โ†’ aircraft.model
ะกะตั€ะธะตะฝ โ„– (col 3)โœ…โ†’ aircraft.serial_number
ะ ะตะณ. ะทะฝะฐะบ (col 4)โœ…LZ--prefix; used as the Mictronics lookup key
ะšะฐั‚ะตะณะพั€ะธั ะ’ะก (col 5)โœ…โ†’ aircraft.type, decoded via a category map (e.g. sailplane โ†’ Glider); unmapped values are dropped, not passed through
ะžัะฝะพะฒะฐะฝะธะต (col 6)โŒNot read

See specs/data-dictionary.yaml (bg-caa 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 451C2B | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufacturer": "CIRRUS",
        "manufacturer_model": "CIRRUS SR-22",
        "model": "Cirrus SR 22",
        "serial_number": "00488",
        "type": "Airplane",
        "type_designator": "SR22",
        "wake_turbulence_category": "Light"
    },
    "icao_hex": "451C2B",
    "military": false,
    "registration": "LZ-ALA",
    "source": "bg-caa"
}
bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 451E92 | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufacturer": "AIRBUS",
        "manufacturer_model": "AIRBUS A-319",
        "model": "Airbus A319-112",
        "serial_number": "03188",
        "type": "Airplane",
        "type_designator": "A319",
        "wake_turbulence_category": "Medium"
    },
    "icao_hex": "451E92",
    "military": true,
    "registration": "LZ-AOB",
    "source": "bg-caa"
}

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/bg-caa/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_bg_caa_{name}/config for each of the three stats above.