I do use Belgian public transport and it would be nice to have this integrated into home assistant (mostly the irail.be api)
That way i can glance in the morning if the car or the train is faster.
@thibmaek Really nice that you are picking this up and trying to get this working. I don’t know any python.
As the 2 mentions above. point 1,2 and 3 would be nice to have. I’m looking for a way to calculate the total travel time between 2 station with delays so I can easily see if the train or car (via the waze platform) is faster to work at the moment of departure.
OK! This already uses a connection between 2 stations but the specific question was what the state value should be: the total time it takes? Amount of delay on this connection etc. etc.
I’d link everything else that is relevant data as an attribute since you can only have 1 state field for a sensor.
Ideally for me the total time it takes (including the delay). So probably just like the waze travel time sensor where you get the time it takes to get to a certain location.
iRail is great i used to do a student job for them.
But you might want to check out the official data from the nmbs.
As of today, you can request the official GTFS real-time feeds of SNCB! This is great news: our real-time feeds were only a scraped version of what was announced on their websites. If you now want to rely on a high-quality data feed of train disturbances and train delays, you can rely on their new feeds. Request this over here:
Traceback (most recent call last):
File “/home/cereal/home-assistant/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/home/cereal/home-assistant/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/cereal/.homeassistant/custom_components/sensor/nmbs.py”, line 144, in update
next_connection = connections[“connection”][0]
TypeError: ‘int’ object is not subscriptable