Custom addon: Transport for Ireland

I have created a custom addon and custom card that display real-time arrival information about buses and trains in Ireland, like the following:

tfi-card

You can get the addon here: GitHub - seanblanchfield/seans-homeassistant-addons

The addon runs an instance of my TFI-GTFS project, which queries the Transport for Ireland servers over their GTFS API (a pretty complex API optimised for bulk-syncing of transport fleet data to Google Maps) and exposes real-time arrival information for specific stops over a simple REST API.

In addition, the addon queries that REST API and populates Home Assistant entities with the results.

I’ve also included a custom card to display upcoming real-time arrivals for a specific transport stop, which is pictured above.

All feedback and PRs are welcome!

3 Likes

Hi,
First of all I think this is a brilliant idea and I would really like to integrate it in my installation. I have a problem though, which is that I have a Core installation in a docker container. Would someone be able to help me creating a docker version of this integration? I am pretty new in home assistant and docker and I am still learning.

Thanks in advance

Hi Tom,

This addon is basically an extension of my TFI-GTFS project, which you can run as a Docker container. The readme file has instructions on how to do that.

Once you have that running, you’ll have a server with a REST API that can be queried, but no UI. For the UI, you can follow the instructions in the addon readme to install the tfi-gtfs-card.js custom card. When you add this card to a dashboard you should provide the URL to the docker container as the “API URL” and a stop number to query the docker container with. The card configuration looks like this:

image

The combination of an API URL and a stop number tells the custom card to call the docker container every “refresh interval” seconds for new info. Note: You won’t be possible to select anything in the “Stop Entities” dropdown because you will not be running the addon (which is responsible for populating the Home Assistant entities with arrival information).

If anyone is interested, it wouldn’t be too hard to create a version of the addon that accepts a URL to an external Docker container instead of running its own internal instances of the TFI-GTFS server, but which otherwise works the same way and populates HA entities. I might create this myself if there is interest and if I can find the time. But in the meantime, the steps above should work for you.

I use HAOS and get this error when I try and install your addon. Do you have any idea as to what the cause could be?

Failed to install add-on
The command ‘/bin/ash -o pipefail -c python3 -m pip install -r requirements.txt’ returned a non-zero code: 1

I’m sorry, but there’s not much to go on there. Is there any other output in the logs, maybe in the supervisor or host logs?

@lazlo66x I encountered this problem myself tonight and fixed it. Something seems to have changed in the base Home Assistant addon image that required me to change how I installed python dependencies. It seems to be working for me now, if you care to try again.

Thank you, installs fine. Wil try and play around with it. Cheers

1 Like

Thank you so much for creating this Sean, it’s been a pain to get the Dublin Bus working for the past year and now I can finally integrate it in my Dashboard. All set up is perfect and easy to follow!

1 Like