This custom integration for Home Assistant provides real-time information about public transportation in Sofia, Bulgaria, using data from the official Sofia Traffic website.
- Real-time arrival information for buses, trams, and trolleybuses in Sofia
- Support for multiple bus stops
- Updates every 60 seconds
- Sensors showing minutes until next vehicle arrival
- Make sure you have HACS installed in your Home Assistant instance
- Navigate to HACS in your Home Assistant frontend
- Click on "Integrations"
- Click the three-dot menu in the upper right corner
- Select "Custom repositories"
- Add the URL of this repository and select "Integration" as the category
- Click "Add"
- Find and install the "Sofia Transit" integration
- Copy the
sofia_transit
folder from this repository to yourconfig/custom_components
directory - Restart Home Assistant
- In Home Assistant, go to Settings > Devices & Services
- Click + Add Integration and search for "Sofia Transit"
- Enter the bus stop IDs as a comma-separated list (e.g., "1234,5678")
- You can find these IDs in the URL when checking a stop on https://www.sofiatraffic.bg/
After configuration, the integration will create sensors for each public transport line at the specified bus stops. Each sensor shows the minutes until the next vehicle arrives.
Sensor naming format:
sensor.sofia_transit_stop_id_prefix_number
- For example:
sensor.sofia_transit_1234_TM6
for tram line 6 at stop 1234
- For example:
A
- BusTM
- TramTB
- TrolleybusN
- Night line
Note: Metro lines are not included in the initial version of this integration.
- If you're experiencing issues with the integration, check the Home Assistant logs for error messages
- The integration refreshes its authentication tokens automatically, but sometimes the Sofia Traffic website may have service interruptions
Contributions to improve the integration are welcome! Please feel free to submit pull requests or open issues on the GitHub repository.