This is an integration for the national rail API into home assistant. This allows you to have a schedule of the train at your station in your home assistant.
- Register with national rail to get an api token here
This repo is HACS compatible and can be added in to the custom repositories in HACS
- Copy the custom_components/nationalrailuk folder into your config/custom_components folder and restart home assistant
- Find the crs code for your origin and destination station using the National Rail website. If you live in Weybridge and commutte to Waterloo, the codes are WYB and WAT
- You need to add 2 integration for for monitoring your morning journey WYB to WAT and one for your evening route WAT to WYB
- This should create 2 sensors
sensor.train_schedule_wyb_wat
andsensor.train_schedule_wat_wyb
A custom card for this integration can be found here: https://github.com/plutomedia987/lovelace-nationalrail
National Rail limits API call to five million requests per four week railway period. An update every minute for a 4 week period would require 40,320 request. You could therefore have 124 those sensors.
We are currently refreshing once every 15 minutes in normal conditions but starts updating every minutes if we are within 5 minutes of the planned departure time or if the train is delayed
Please raise questions in the thread on the home assistant forum