Real-time UK train departure information integrated with the Indigo home automation system.
The UK Trains plugin connects your Indigo home automation system to the UK National Rail Darwin Live Departure Boards API, providing real-time train departure information for any UK railway station. Display departure boards, track delays, and integrate train schedules into your home automation workflows.
Originally based on Chameleon's iTravel plugin, fully rewritten and modernized for macOS Monterey+, Python 3, and Indigo 2023+.
- Real-time departure information from any UK railway station
- Automatic updates at configurable intervals (30-600 seconds)
- Visual departure boards with customizable colors and fonts
- Delay tracking with problem flags for delayed, early, or cancelled trains
- Route filtering - show only trains to specific destinations
- Calling points - display intermediate stops for each service
- Special messages from National Rail (service disruptions, engineering works)
- Multiple devices - track different stations or routes simultaneously
- Device states - use train data in triggers, actions, and control pages
- Indigo 2023.2 or later (macOS)
- Python 3.10+ (included with Indigo 2023+)
- Darwin API Key (free registration via the Rail Data Marketplace)
- Download the plugin from the GitHub releases page
- Double-click the
.indigoPluginfile to install - Indigo will prompt to enable the plugin
- Enter your Darwin API key in the plugin configuration
Breaking change in 2026.1.0: this plugin now talks to the LDBWS REST API on the Rail Data Marketplace (
api1.raildata.org.uk). Legacy SOAP/OpenLDBWS tokens no longer work — every user must register at raildata.org.uk and use the consumer key for the LDBWS Public product.
- Visit https://raildata.org.uk/ and create an account
- In the product catalogue, search for LDBWS and subscribe to "Live Departure Board" (or any of the LDBWS products)
- Accept the licence terms — approval is usually instant for the free open-tier products
- From your dashboard, click into the subscribed product and open the Specification tab — the Consumer key is shown there (this is the API key)
- Paste the consumer key into the plugin's Darwin API Key field. No other config is needed.
Don't pick Live Fastest Departure Boards — that's a separate fastest-route product that will not authenticate against the standard departure-board endpoint this plugin uses.
Existing users upgrading from 2026.0.x: replace your old SOAP token with a marketplace consumer key before the new version starts polling, otherwise every fetch will return 401.
Open Plugins → UK Trains → Configure to set global options:
- Darwin API Key - Your LDBWS consumer key from the Rail Data Marketplace
- Update Frequency - How often to refresh data (30-600 seconds, default: 60)
- Create Departure Images - Generate PNG images of departure boards
- Image Output Directory - Where to save departure board images
- Colors - Customize foreground, background, delay, and calling point colors
- Plugins → UK Trains → Create New Device
- Select "UK Train Departure Board"
- Configure the device:
- Station CRS Code - 3-letter code for departure station (e.g., PAD for Paddington)
- Destination CRS Code - Filter to only trains going to this station (or "ALL" for all departures)
- Include Calling Points - Show intermediate stops for each train
- Create Station Board Images - Generate visual departure board for this device
Station codes (CRS codes) are 3-letter codes used by National Rail:
- Paddington: PAD
- King's Cross: KGX
- Waterloo: WAT
- Victoria: VIC
- Liverpool Street: LST
Full list available at: https://www.nationalrail.co.uk/stations_destinations/48541.aspx
Each device tracks up to 10 trains with the following states:
Per Train (train1-train10):
trainXDestination- Final destinationtrainXOperator- Train operating companytrainXSch- Scheduled departure timetrainXEst- Estimated departure timetrainXDelay- Delay message ("On Time", "5 mins late", "Cancelled", etc.)trainXProblem- Boolean flag (True if delayed, early, or cancelled)trainXReason- Delay reason if providedtrainXCalling- Intermediate calling points (if enabled)
Station Information:
stationLong- Full station namestationIssues- Boolean flag (True if any train has problems)timeGenerated- Last update timestampmessage1- NRCC special messages (disruptions, engineering works)
Alert on delays at my station:
Trigger: Device State Changed
Device: London Paddington to Bristol
State: stationIssues becomes True
Action: Send notification "Train delays at Paddington"
Announce next train 10 minutes before departure:
Trigger: Schedule
Time: Daily at 08:20 (if you leave at 08:30)
Condition: Device State "train1Problem" is False
Action: Speak "Your 08:30 train to Bristol is on time"
Flash lights if train is cancelled:
Trigger: Device State Changed
Device: My Commute
State: train1Delay contains "Cancelled"
Action: Flash office lights red
Add departure board to your control page:
- Create a Status Display element
- Link to device state:
train1Destination - Add multiple status displays for different trains
- Use
trainXProblemstate to change color (red for problems)
If enabled, the plugin generates PNG images showing departure boards:
Location: ~/Documents/IndigoImages/ (or configured path)
Format: {StationCRS}_{DestinationCRS}.png
Example: PAD_BRI.png (Paddington to Bristol)
Display on iPads, dashboards, or control pages using Indigo's control page image feature.
- Check Indigo → Event Log for error messages
- Verify Darwin API key is valid via your Rail Data Marketplace dashboard
- Ensure Indigo 2023.2+ is installed
- Verify station CRS codes are correct (3 letters, uppercase)
- Check if station has services at current time (some stations have limited hours)
- Look for error messages in Indigo Event Log
- Test API key from your Rail Data Marketplace subscription page
- Check that device update frequency isn't too high (minimum 30 seconds recommended)
- API may have temporary issues - check National Rail Twitter
- Verify timezone on Mac is set correctly (BST/GMT matters for schedule calculations)
- Check image output directory exists and is writable
- Ensure font files are present in plugin bundle
- Check plugin log:
~/Library/Application Support/Perceptive Automation/Indigo [version]/Logs/
- "Invalid API Key" - Check key is copied correctly, no extra spaces
- "Station not found" - Verify CRS code is valid
- "Too many requests" - Reduce update frequency or check if multiple devices are polling same endpoint
Create multiple devices for the same departure station with different destination filters:
- Device 1: Paddington → Bristol (only Bristol trains)
- Device 2: Paddington → Oxford (only Oxford trains)
- Device 3: Paddington → ALL (all departures)
Use time-based triggers to:
- Enable departure board display only during commute hours
- Change update frequency (faster during peak times)
- Announce specific trains at specific times
- Create custom control page with departure information
- Use device states in substitution variables
- Add images to show full departure board
- Use conditional formatting based on
trainXProblemstates
For developers and contributors:
- Repository: GitHub - simons-plugins/indigo-UKTrains
- Bug Reports: GitHub Issues
- Documentation: See
CLAUDE.mdfor development setup - Tests: Comprehensive test suite with 58 unit tests and 14 live API tests
cd UK-Trains/tests
pytest unit/ -v # Unit tests
pytest integration/ -v # Integration tests (mocked)
pytest -m live_api integration/ # Live API tests (requires API key)- Original iTravel Plugin: Chameleon (Indigo Forums)
- Rewrite & Modernization: Simon (2025)
- Darwin LDB API: National Rail Enquiries
- Built with: nredarwin SOAP client
This plugin is provided as-is for use with Indigo home automation. Darwin API usage subject to National Rail terms of service.
- Indigo Forums: Plugin Support Thread
- GitHub Issues: Report bugs and request features
- Darwin API Support: Rail Data Marketplace — host of the LDBWS Public product
Version: 3.0+ (2025) Minimum Indigo Version: 2023.2 macOS: Monterey or later Python: 3.10+