Custom Home Assistant integration that keeps your dashboards up to date with arrivals and departures from the official Avinor data feed.
Data source: Flydata fra Avinor – https://partner.avinor.no/tjenester/flydata/
- Overview
- Repository Structure
- Features
- Installation
- Configuration
- Flight Details (Airlabs)
- Companion Lovelace Card
- Example Dashboard Card
- Troubleshooting
- Release Notes
- Attribution
- Polls Avinor's API on a recommended three-minute cadence and exposes the results as Home Assistant sensors.
- Includes Norwegian and English translations so the integration fits natively into your UI.
- Ships with tests that validate API parsing, helping future contributors keep behaviour stable.
custom_components/avinor_flight_data/– Home Assistant integration package.docs/assets/example_afd.png– Example Lovelace card screenshot used in documentation.tests/– Unit tests covering the API parsing logic.
Integration
- Select from 300+ airports using a searchable dropdown.
- Choose arrivals or departures per sensor instance and control the time window (default: -1/+7 hours).
- Automatic refresh every three minutes, aligned with Avinor guidance.
Lovelace Card (separate repository)
- Responsive table layout that hides irrelevant columns for arrivals.
- Converts UTC timestamps to local time for readability.
- Translates status codes and airport identifiers into human-friendly labels.
- In Home Assistant, open HACS → Integrations → ⋮ → Custom repositories.
- Add
https://github.com/WickedGhost/avinor_flight_dataas typeIntegration. - Install Avinor Flight Data from HACS.
- Restart Home Assistant.
- Navigate to Settings → Devices & Services → Add Integration → search for "Avinor Flight Data".
- Follow the configuration flow to pick an airport, direction, and time window.
| Option | Description | Default |
|---|---|---|
| Airport | Any Avinor airport (searchable list). | none |
| Direction | A (arrivals) or D (departures). |
D |
| Time from | Hours back from now to include in results. | 1 |
| Time to | Hours forward from now to include in results. | 7 |
| Airlabs API key | Optional API key used for flight details. | none |
Each configured sensor reports the flight count as its state and exposes detailed flight data through the flights attribute.
This integration can optionally fetch details for a specific flight from the Airlabs Flight API: https://airlabs.co/docs/flight
- In Home Assistant, go to Settings → Devices & Services.
- Find Avinor Flight Data.
- Open Configure / Options.
- Enter your key in the airlabs_api_key field.
- Submit/save.
The key is optional. If you don’t set it, you can still call the service by passing api_key in the service data.
You can call this service from Developer Tools → Services, or from an automation.
Minimal example (IATA flight id):
service: avinor_flight_data.get_flight_details
data:
flight_iata: DY123Override the configured key (useful for testing):
service: avinor_flight_data.get_flight_details
data:
api_key: YOUR_AIRLABS_KEY
flight_iata: DY123Notes:
- Provide at least one of:
flight_iata,flight_icao, orflight_number. - On Home Assistant versions that support service responses, the service returns the Airlabs
responseobject.
Repository: https://github.com/WickedGhost/avinor-flight-card
Install via HACS (Frontend)
- HACS → Frontend → ⋮ → Custom repositories → add the card repository as
Lovelace. - Install Avinor Flight Card and restart if prompted.
- Ensure the resource
/hacsfiles/avinor-flight-card/avinor-flight-card.jsis listed under Settings → Dashboards → Resources. - Edit your dashboard and add the "Avinor Flight Card" from the picker.
Manual YAML alternative
type: custom:avinor-flight-card
entity: sensor.avinor_osl_d
title: Oslo Departurestype: custom:avinor-flight-card
entity: sensor.avinor_OSL_A
title: Ankomster OSL- Card missing from the picker: clear browser cache or add the card resource manually.
- Integration not listed: verify HACS installed it and restart Home Assistant.
- Empty sensor state: check the entity in Developer Tools → States and confirm the selected window includes flights.
- Resource 404 errors: confirm the path
/hacsfiles/avinor-flight-card/avinor-flight-card.jsexists after installation.
- 0.2.1
- Split the Lovelace card into its own repository.
- Updated HACS/Hassfest workflows to meet current validation requirements.
- Refreshed documentation for the new repository layout.
- 0.2.0
- Ensured Python 3.10 compatibility during integration setup.
- Hardened API error handling for timeouts, HTTP failures, and connection issues.
- Cached the airport list for 24 hours to limit external requests during setup.
- Respected options overrides (time window) after reload.
- Escaped HTML in the Lovelace card and added initial API parsing tests.
"Flydata fra Avinor" – https://www.avinor.no/
