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.
It is my first custom integration for home assistant, so any feedback is highly appreciated.
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
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.
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.
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.
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…
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.