A Home Assistant integration for the Realtime Trains next-generation API (data.rtt.io). Brings live UK train departures, platform information, formation data and per-service tracking into Home Assistant, with sensible defaults, deep attributes for dashboards, and one-line automation triggers for the things people actually want to know.
"Has my train been cancelled? Has the platform changed? Is it running late? Is it at the platform yet?" — answered without leaving Home Assistant.
- Searchable station picker. Pick a station by name ("Clapham Junction") — no CRS or TIPLOC codes required. The integration caches the full RTT station list and exposes it through a type-to-search
SelectSelectorin the config flow. - Rich departure sensors. Each monitored station exposes the next N departures as timestamp sensors plus dedicated sensors for delay, cancellations, platform changes, and a live status enum (
scheduled/approaching/arriving/at_platform/departing). - Service tracker. Follow a single train by headcode (e.g.
1L40) and date — useful for "the train I'm meeting someone off" or for observing a journey you're about to make. - Know-Your-Train & formation. Where the API key is entitled, rolling-stock formation, coach letters, per-coach facilities (wifi, power, quiet, toilet, wheelchair, buffet, …), leading class and stock branding are exposed as attributes.
- Token-aware. Surfaces the entitlements returned by
/api/infoand respectshistoryRestriction/historyRestrictToDays/namespaceRestrictionso the integration never wastes requests on disallowed queries. - Rate-limit aware. Reads
X-RateLimit-Limit-*/X-RateLimit-Remaining-*headers on every response, exposes them as diagnostic sensors, and serialises polls across all monitored boards under one account so a multi-station setup never bursts against the limit. - Smart polling. Boards poll on a configurable cadence (default 90 s). When a tracked service is live, the cadence adapts; when services are off-run / cancelled / far in the future, the cadence relaxes.
- Services (actions).
realtime_trains.get_departures,realtime_trains.get_service,realtime_trains.find_stationandrealtime_trains.refresh_nowgive scripts and dashboards on-demand lookups. - Translations & diagnostics. Full English translations, a
diagnosticsdownload with redacted tokens for support, and a repair flow when a token expires or is revoked.
- Register for an API token at https://api-portal.rtt.io. See API credentials.
- Install via HACS: add this repository as a custom repository (category Integration), then install Realtime Trains.
- Restart Home Assistant.
- Settings → Devices & Services → Add integration → Realtime Trains.
- Paste your token. The integration validates it against
/api/infoand shows your entitlements before saving. - Add Departure board or Service tracker sub-entries from the integration's device page.
Detailed walk-through: Getting started.
- Getting started
- API credentials
- Entities reference
- Services reference
- Automation recipes
- Architecture
- FAQ & troubleshooting
- Home Assistant 2025.8.0 or newer.
- A Realtime Trains next-generation API token from https://api-portal.rtt.io. The legacy
api.rtt.ioandsecure.realtimetrains.co.ukendpoints are deprecated and not supported.
This integration is server-side software running on the user's own Home Assistant instance. The RTT token is stored in Home Assistant's encrypted config entry store and is only ever sent to data.rtt.io. No token is shipped with the integration, and no traffic is proxied through any third-party service. See API credentials for the rationale.
MIT — see LICENSE. Data © Realtime Trains; this integration is an independent client and is not affiliated with Realtime Trains.