Skip to content

tjorim/belgiantrain

Repository files navigation

SNCB/NMBS

belgiantrain is a custom integration for Home Assistant to get the next train departures from the iRail API.

Why?

I wanted to have a sensor that shows the next train departures from the station I use to go to work. I couldn't find an integration that does this, so I decided to create one myself. I also wanted to learn how to create a custom integration for Home Assistant. This is my first custom integration. I hope you like it. If you have any suggestions or improvements, please let me know. I'm happy to learn and improve.

What?

This integration will create a sensor for each station you want to monitor. The sensor will show the next train departures from the station. The sensor will update every minute. The sensor will show the next 5 departures. The sensor will show the destination, the departure time and the delay. The sensor will show the delay in minutes.

This repository contains multiple files, here is a overview:

File Purpose  Documentation
.devcontainer.json Used for development/testing with Visual Studio Code. Documentation
.github/ISSUE_TEMPLATE/*.yml Templates for the issue tracker Documentation
custom_components/integration_blueprint/* Integration files, this is where everything happens. Documentation
CONTRIBUTING.md Guidelines on how to contribute. Documentation
LICENSE The license file for the project. Documentation
README.md The file you are reading now, should contain info about the integration, installation and configuration instructions. Documentation
requirements.txt Python packages used for development/lint/testing this integration. Documentation

How?

  1. Create a new repository in GitHub, using this repository as a template by clicking the "Use this template" button in the GitHub UI.
  2. Open your new repository in Visual Studio Code devcontainer (Preferably with the "Dev Containers: Clone Repository in Named Container Volume..." option).
  3. Rename all instances of the integration_blueprint to custom_components/<your_integration_domain> (e.g. custom_components/awesome_integration).
  4. Rename all instances of the Integration Blueprint to <Your Integration Name> (e.g. Awesome Integration).
  5. Run the scripts/develop to start HA and test out your new integration.

Next steps

These are some next steps you may want to look into:

About

A custom Home Assistant integration using pyRail

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published