This custom integration allows you to monitor public transport departures in Munich, Germany, directly from your Home Assistant instance. It provides real-time information about upcoming departures for selected stations, lines, and directions.
- Real-time departure information for Munich public transport
- Configurable through the Home Assistant UI
- Support for multiple stations
- Filtering by specific lines and directions
- Customizable update interval
- Sensors for next departure, all upcoming departures, and MVG messages
- Individual sensors for each selected line and direction
- Ensure you have HACS installed in your Home Assistant instance.
- In the HACS panel, click on "Integrations".
- Click the three dots in the top right corner and select "Custom repositories".
- Add the following information:
- Repository:
https://github.com/g4bri3lDev/munich_public_transport
- Category: Integration
- Repository:
- Click "Add".
- Search for "Munich Public Transport" in the HACS store.
- Click "Install" and follow the prompts.
- Restart Home Assistant.
- Download the latest release from the GitHub repository.
- Unzip the download and copy the
munich_public_transport
folder to yourcustom_components
directory in your Home Assistant configuration directory. - Restart Home Assistant.
- In Home Assistant, go to Configuration > Integrations.
- Click the "+" button to add a new integration.
- Search for "Munich Public Transport" and select it.
- Follow the configuration steps:
- Enter a search query for the station you want to monitor.
- Select the specific station from the search results.
- Choose the lines you want to track (optional).
- Select the directions you want to monitor (optional).
- Set the number of departures to display for each line/direction.
- Configure the update interval.
The integration creates the following sensors:
sensor.next_departure
: Shows the time until the next departure across all selected lines and directions.sensor.all_departures
: Provides a list of all upcoming departures across all selected lines and directions.sensor.messages
: Displays relevant MVG messages for the selected lines.- Individual sensors for each selected line and direction combination (e.g.,
sensor.u3_to_moosach
).
You can customize the integration's behavior through the Options flow:
- Go to Configuration > Integrations.
- Find the Munich Public Transport integration and click "Options".
- Adjust the lines, directions, number of departures, and update interval as needed.
- If you encounter connection errors, ensure that your Home Assistant instance has internet access.
- Check that the MVG API is operational and not experiencing downtime.
- For persistent issues, check the Home Assistant logs for more detailed error messages.
- If you're having trouble with the integration, try increasing the scan interval to reduce the load on the API.
Contributions to this project are welcome! Please fork the repository and submit a pull request with your improvements. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.
This integration is not officially affiliated with or endorsed by MVG (Münchner Verkehrsgesellschaft). Use at your own risk.