Brussels Public Transportation (STIB-MIVB) integration (API v2)

Hi Daniel (@nxd4n )

I wanted to reach out to you directly, as I started this journey by forking your repository with the intention of submitting a pull request.

However, as I dug deeper into the code, I ended up going much further than initially planned and significantly reworked the integration. Here is a summary of what changed:

API optimisation — the original integration was downloading the entire STIB/MIVB network on every refresh (~1 MB per call). I added server-side filtering using where=pointid in (...) which reduces the payload by a factor of ~600 (from ~1 MB to ~2 KB). Startup was also reworked to use two targeted API calls instead of downloading the full stopsByLine dataset for all lines on the network.

New sensor attributesline_type (bus/tram/metro), line_type_label (B/T/M), line_color and line_text_color sourced from the official STIB GTFS feed, message and is_boarding extracted from the real-time passingtimes field (“Ne pas embarquer”, “Ligne déviée”, “Temps théorique”).

GTFS integration — line colours and vehicle types are downloaded from the STIB GTFS feed at install time and cached, so they are always accurate and up to date without impacting the daily quota.

Options flow improvements — added the ability to remove configured stops (with automatic cleanup of entities and devices in HA), a manual GTFS refresh option, and a reconfigure step to update the API key without losing the stop configuration.

Translations — full French and Dutch translations of the setup and options flow.

CI — GitHub Actions with HACS validation and Hassfest checks.

Given the extent of the changes, I felt a pull request was no longer the right approach — the codebase diverged significantly from the original. I have therefore decided to maintain this as an independent fork going forward, giving credit to your original work in the licence file.

I hope you don’t mind, and I genuinely want to thank you for the solid foundation you built — it was a great starting point.

With sincere regards,
Kamil AvH

here is my repo: