Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

England Bus Tracker

England Bus Tracker

Live bus tracking for England on your Home Assistant dashboard — powered by the Department for Transport's free Bus Open Data Service.

HACS Custom License: MIT Data: BODS OGL v3.0


England Bus Tracker turns the government's open bus data into a live map, a departure board and smart "leave now" notifications in Home Assistant. There's no paid API and no daily call limit — you register once for a free Bus Open Data Service (BODS) key, tell it which stop you use, and it does the rest.

It's designed to be honest about what it knows: arrival times are computed from each bus's live GPS position against the published timetable (the raw feed doesn't provide predictions), and the card clearly distinguishes a live, tracked bus from a timetabled one.

Coverage: local bus services across England, outside London. London buses are published through Transport for London's own system, not BODS, so they are not included. See Coverage for detail.

England Bus Tracker on a Home Assistant dashboard

Two stops side by side. Left: a village stop (map zoom 14) with a single Liverpool-bound 487 and the platform-sign ladder. Right: a town centre (map zoom 12), zoomed wide enough to show two operators' 471/472 services and their route lines. Notice the destinations — the village stop shows tidied names (Liverpool, Ness Gardens), while the town view still shows the raw feed names (Cook Street, Castle Street), exactly what the destination aliases below clean up.

Features

  • Live vehicle map — every tracked bus on your route as a route-coloured badge showing its number and destination, updating on your chosen interval.
  • Computed arrival times — ETAs at your stop worked out from the bus's live position and the timetable, with a live/scheduled indicator and delay.
  • Companion card — a zero-YAML visual card (departure board, map and a rail-style "platform sign" ladder). See England Bus Tracker Card.
  • Watch a bus — arm a specific departure and get staged notifications (armed → live → leave now, based on your walking time), with a ready-made automation blueprint.
  • Service anomaly detection — a local watchdog that flags when a route is timetabled to run but nothing is transmitting, catching gaps the official feeds never report.
  • Route lines on the map — where an operator publishes route geometry, the road-following line is drawn automatically (see the FAQ).

Coverage

This integration reads the Bus Open Data Service (BODS), which covers local bus services across England outside London. A few honest notes:

  • London / TfL is not included. Transport for London publishes its bus data through a separate system (the TfL Unified API), not BODS, so this integration cannot see London buses.
  • Scotland and Wales are out of scope. BODS is an England service.
  • Quality varies by operator. Live positions, destinations and route geometry are published by the operators themselves, so completeness differs from one operator to the next — and improves automatically as they add data.

Requirements

  • Home Assistant — developed and tested on 2026.7; a recent release is recommended.
  • A free BODS API key — register at data.bus-data.dft.gov.uk (see below).
  • HACS — for installation.

Installation

Via HACS (custom repository)

  1. In HACS, open the three-dot menu → Custom repositories.
  2. Add https://github.com/davidh62/england-bus-tracker with category Integration.
  3. Find England Bus Tracker in HACS and install it.
  4. Restart Home Assistant.
  5. Go to Settings → Devices & Services → Add Integration and search for England Bus Tracker.

Manual

Copy custom_components/uk_bus_tracker into your Home Assistant config/custom_components/ directory and restart.

The integration's internal domain is uk_bus_tracker; the product name is England Bus Tracker.

Getting a BODS API key

  1. Create a free account at data.bus-data.dft.gov.uk.
  2. Open your account page and copy your API key.
  3. Paste it into the integration when you add it (it's remembered for any further monitors you add).

Setting up a monitor

The setup is stops-first — you start from the bus stop you actually use, and the routes are discovered for you:

  1. Enter your stop code(s). Each monitor watches one or more stops (for a bus station, that's usually a couple of stands).
  2. Choose the routes you care about from those found at your stops.
  3. Name the monitor something friendly (e.g. "Home stop", "Heswall").
  4. Optionally tidy destination names with aliases (e.g. show Liverpool instead of the raw Hood Street).

The Destination display names screen

Renaming raw stop-derived destinations to the names people actually use. Leave any blank to keep the original.

Finding your stop code

Every UK bus stop has a code. Two easy ways to find yours:

  • Google Maps — tap the bus-stop pin; the panel shows a short stop code (e.g. merawamg). Paste that in.
  • bustimes.org — search your stop; the stop page shows both the short code and the longer official ATCO code. Either works.

Colouring the badges

Each route's map badge can be recoloured to match its operator's livery — set a fill, border and text colour per route (for example a yellow fill with a grey border and black text for an Arriva-liveried 487).

The Badge colours screen for a route

A note on colour names, for anyone new to web colours. You can type either a hex code (like #1565c0) or a standard colour name. Colour names are always a single word with no spaces — so it's darkgrey, not dark grey, and lightblue, not light blue. Your spell-checker may underline darkgrey as a typo; that's the correct spelling here. Both British and American forms work for greys (grey and gray). If a badge comes out blank, a space in the colour name is the usual culprit — or just use a hex code, which never gets autocorrected. Full list: CSS named colours.

Using it on a dashboard

The easiest route is the companion card, which needs no YAML — England Bus Tracker Card.

Prefer to build your own? Every entity is discoverable by attribute (route, stop code, live flag, delay, destination) so you never have to hardcode an entity ID. Recipe examples for a departure board and a map are in docs/dashboard-recipes.md.

Data, licensing & attribution

This integration uses data from the Bus Open Data Service and NaPTAN, published by the Department for Transport.

Contains public sector information licensed under the Open Government Licence v3.0.

This attribution is a condition of using the data and must be retained.

Disclaimer

England Bus Tracker is an independent project and is not affiliated with, endorsed by, or connected to the Department for Transport or any bus operator. Arrival times are our own estimates, calculated from live positions and timetables — they are not official operator predictions, and the underlying data can be delayed, incomplete or inaccurate. Do not rely on this integration for time-critical journeys. Use it at your own risk.

FAQ

Why is there no route line on my route? Route lines are drawn only where the operator publishes road-following geometry to BODS. Where they don't, no line is shown — deliberately, rather than drawing a misleading straight line between stops. If an operator starts publishing geometry later, the line appears automatically on the next weekly data refresh.

A franchise/operator is changing on my route — do I need to do anything? No. The integration tracks routes by number and destination, not by operator, so a change of operator is handled automatically. New timetable data flows in on the weekly refresh.

Does it work in London? No — see Coverage. London bus data lives in TfL's separate system, which this integration doesn't read.

Contributing

Bug reports and feature requests are welcome via Issues. Pull requests are welcome too.

Licence

MIT © davidh62

Acknowledgements

  • The Department for Transport for the Bus Open Data Service and NaPTAN.
  • The Home Assistant and HACS communities.
  • Built with the assistance of Claude (Anthropic).

About

Live England bus tracking for Home Assistant, powered by the DfT Bus Open Data Service (for the card: Companion Lovelace card for the England Bus Tracker integration)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages