De Lijn Real-Time Integration for Home Assistant
Hey everyone! I'd like to share a custom integration I've been working on for De Lijn — the public transport operator for buses and trams in Flanders, Belgium.
What it does
It brings real-time departure times, delays, service alerts and line badge colors from any De Lijn bus or tram stop directly into Home Assistant — so you can build dashboards, automations, or notifications around your local transit.
Key features
- Real-time departures with delays, plus automatic fallback to the scheduled timetable when live data is unavailable (night, outages)
- Line badge colors — all 4 values (background, text, border, text outline) available as sensor attributes, ready for custom Lovelace cards
- Service alerts — active disruptions and route diversions per stop
- Bilingual — destinations displayed in Dutch or French, your choice
- Stop type awareness — warns you during setup if a stop is temporary (TIJDELIJK), on-demand Flexbus, or mixed (COMBI)
- Smart stop search — search by name (groups all platforms) or by stop number (single platform)
- Efficient API usage — all configured stops are fetched in a single batch call per cycle
Sensor attributes (departure sensor)
Each sensor exposes: line, direction, destination, scheduled, realtime, delay_minutes, prediction, vehicle_id, next_departures, badge_background, badge_text, badge_border, badge_text_border, stop_type
The prediction attribute tells you whether the data is live (REALTIME), from the timetable (GEENREALTIME), cancelled (GESCHRAPT) or already passed (VERSTREKEN).
Requirements
- Home Assistant 2024.4.0+
- Free API key from portal.delijn.be → Products → Open Data Free
Installation
Available as a custom HACS integration:
GitHub - arszagi/hacs-delijn: A Home Assistant custom integration for De Lijn — the public transport operator for buses and trams in Flanders, Belgium. · GitHub
Happy to hear feedback or answer questions. Still actively developing — contributions welcome!
Kamil AvH