There is already a national rail integration in the base installation of home assistant. Truth is, this is not national rail but some company trying to sell subscriptions for their API/system
But national rail offers a soap API but you need to register (with very generous limits) I wrote an integration for home assistant. I look forward to reading your feedback
There is (it only relate to that route the instance is monitoring - you need one instance for your morning route and another one for your evening route) and there isnât (there is only one flag for cancellation and meaningful delays)
Then configure a sensor with the selector as div[class=âsingle-visit__contentâ] and index of 0
Add another sensor of div[class=âsingle-visit__timeâ] and index of 0
These should get you two sensors, first one with the bus and the second with the time.
Add more sensors with increasing indexes if you need more.
Add an automation with a time pattern trigger of say 20 seconds to update all the sensors.
Just want to say thanks for creating and maintaining this. Set it all up about a week ago now and itâs been rock solid and, more importantly, accurate. Love the perturbation inclusion, especially as itâs a whole new word for me .
Still need to sit and get my dashboard setup, for at a glances updates. Tried and failed to quickly get the html Lovelace card going but that cna be a job for the weekend.
The only odd thing about perturbations is that when it is set to true the expected departure time changes from a time to a string that is the reason for the perturbation.
I canât remember what happens with the State (main value) of the sensor. But, based on the jinja Iâve written, I do know that the âexpectedâ property (within the state attributes) is normally a dattime; however, when perturbation is true it can have a string value such as âdelayedâ.
New version of the code is now online fixing a bug when you track multiple destinations.
It changes the attributes of the sensor so automations and display code has to be refreshed. The code for the blueprint has been updated and you will need to reinstall it as well