National Rail Integration

Oops! How embarrassing. Yes, it seems I use a different integration.

It’s a different API as well (though presumably the same upstream source), so not sure if this one could be changed to include the service uid in the returned results.

I should thank you though, as your question prompted me to find a definite improvement to the data I can use in HA.

Hi Guys,

I have forked jfparis’ national rail API and modified it. I have also created a custom card for my one.

Let me know your feedback. If it receives good feedback I will submit a pull request. My method uses different API calls so it will not work with the existing setups. (Maybe it should be kept seperate).

Integration:

Card:

Your fork is to enable the card which you have created, or there are other modifications too?

1 Like

I pull arrival and departure times for each station as well as the current train location

1 Like

Cool, trying it out :+1:

Sometimes a journey sensor becomes unavailable. If I delete that sensor and try re-adding it I get “Unexpected error”, but I can still add journeys to/from those stations to other places. So it seems like a periodic problem on particular routes. Have you experienced this?

Hi Andrew

Which code base are you running? Whilst forking is totally welcome and encourage, perhaps we should fork this thread as well @plutomedia987

Agreed, because in this case I am referring Pluto’s fork. I’ve not encountered this in the original integration, although I have not run them simultaneously to be sure it would not occur

Agreed. Ill create a new thread for this. Ill have a look in to the unexpected and tag you in the new forum.

Anyone else having issues post updating to 24.12 or is it just me (or the update could be a coincidence)?

Opened an issue on Github but essentially get this error:

ModuleNotFoundError: No module named 'cgi'

Hi
Yes, one of the dependencies had an issue with the upgrade to python 3.13. I fixed it last night and pushed a new version. Did you try that before opening the issue?

1 Like

I should have checked that first shouldn’t I…

Fixed now, many thanks.

Probably. Although …
How do you install / update it? HACS (I don’t use that)?
Does it prompts you for updates?

I think I had it installed as custom repo from HACS, but I don’t believe I got an update prompt.

I just updated manually today, (but should have looked first, apologies again).

I’ve been using this successfully - thanks all for the work on it. One thing my fairly basic skills haven’t allowed me to do is to create an ‘arrivals board’ for a given station. I live near a fairly small station which doesn’t have a huge number of trains through it but they do come from a range of departure points. Has anyone been able to show planned arrivals to a given station rather than tracking them by individual departure points? If so I’d love to see some code. Thanks

Love this integration and many thanks for the markdown card CarlBird provided - helped me understand a lot about how to query the attributes.

I’m a bit of a noob and wonder if there’s an easy way to show the trains sorted not by departure time but arrival time - i.e. not show a slow train before a faster train?

Thanks again.

Hi,

I’ve started using the NationalRailUK integration.
It works for me, but I don’t know how to set up a nice departures board from my station.
Do you know where I can find some step-by-step instructions on how to do this?

Currently it looks like this:
image

TIA!