[Custom Component] OEBB Austria next journeys

Hello,

Sharing custom integration to retreive next departures from a certain stop in Austria.
I am using it with local public transport, but in principle it should work also with trains/buses.

oebb-fahrplan

It is my first custom integration for home assistant, so any feedback is highly appreciated. :slight_smile:
Each journey is implemented as a dedicated timestamp sensor.
What I did not manage to do for the moment:

  • Grouping / relating entities
  • Show on a card as a list both the departure time as a “static” info (I have saved in attributes) and the state Solved via templating and glance card

home-assistant-oebb

1 Like

Hey, nice :ok_hand: this looks super convenient.
How’s your experience with train delay information from the API?

It would be super helpful to get a quick setup tutorial on the repository. Mainly:

  • where to install the repository into
  • how to get oebb stop ID
  • maybe add it to hacs if that’s possible. I have never done this so nevermind if a bunch of work ^^

Hey,

the integration looks nice, but I am unable to install it.
Could you please share some instructions?

Thank you

I managed to install it now via HACS and it works really nice. As the API even provides the delay info, I slightly modified the code to add this info too. Only issue I have, is that only journeys within the next hour are shown and I can’t find a way to extend the timewindow.

Thats how it looks in my dashboard now.

Many thanks for this integration! :+1:

2 Likes

Hey airman,
great work! Can you share your change to the code? And how do I get the attributes information into the tiles?

Hey,

you just need to add the last line to the sensor.py
This adds the field “rt” to the sensor attributes. In case of a canceled or delayed train, info will be there.

Cheers

        else:
            self.attributes = {
                "startTime": data["journey"][self.idx]["ti"],
                "startDate": data["journey"][self.idx]["da"],
                "lastStop": data["journey"][self.idx]["lastStop"],
                "line": data["journey"][self.idx]["pr"],
                "rt": data["journey"][self.idx]["rt"],
1 Like

Hi guys! Thank you very much for the integration! Does it work with OeBB only? Is there a way to integrate Westbahn schedule as well?

Hi,

for my understanding, this should work even with the default config.

Hey guys

I am having trouble with that integration. It seems like it has problems with some of the stations. I am trying to integrate it with “Krems an der Donau Bahnhof” which has the evaID 1230101, and I keep getting “Unavailable”. I have the suspicion that this happens due to the fact that this evaID is one char longer than your default, because that works. Not sure though.

It works with the examples. But as soon as I enter my own evaID it does not.

S.

Hi,

the evaID shouldn’t be the problem, I am using 1231205 and I am getting results. From what I have observed, only departures within the next hour are shown, maybe in combination with dirInput there is no matching departure…

Hey Oliver,

Sonofabitch! That is correct, it DOES only show connections for the next hour. I am actually looking for trains from Krems to Heiligenstadt, and there is only one per hour… And the sensor.xxx always created themselves new when I used the original ones it seems…

Damn. That pretty much cost me a day. Thanks Oliver, very much appreciated!!!

S.

P.S. Now it would be interesting to see why with this API we only get one hour in advance… I scoured the sensor.py, I also added the platform, but I did not find anything which limits to an hour.