UTA departures in Home Assistant

Show the next bus or train at your stop on a Home Assistant dashboard, a smart display or in an automation. Every stop page has a ready-made setup to copy.

What you get

Next departure

Minutes until the next bus or train leaves your stop, as a number you can use in automations, like a reminder to leave. It shows as unavailable when nothing is coming in the next three hours.

Departures

The next three as text, for a dashboard card or a smart display: Green to West Valley: 12 min · Green to West Valley: 27 min · Green to West Valley: 42 min

Set it up

  1. 1

    Find your stop

    Search for it, or tap it on the live map. For TRAX, FrontRunner and the S-Line, search the station name: each platform is its own stop, one per direction.

  2. 2

    Copy the setup

    On the stop's page, open Home Assistant, then Show the setup, and copy it. It already has the stop's name, number and data address.

  3. 3

    Paste it into configuration.yaml

    If the file already has a rest: section, add the entry under it instead of adding a second rest: key.

  4. 4

    Restart and add a card

    Restart Home Assistant, then add the two sensors to a dashboard. They update once a minute.

The data

Each stop's next departures (up to ten, three hours ahead) are in a small JSON file that is rewritten every 30 seconds. Stops are spread over 64 files; the stop's page shows the exact address, which ends in /live/stops/<n>.json.

In that file, stops["<stop number>"] lists departures as [route, destination, time, kind, vehicle, delay, direction]. route and destination point into the file's routes and heads lists, time is in Unix seconds, kind is 0 for a tracked vehicle, 1 for the schedule and 2 for a trip that isn't being tracked, and delay is in seconds. Route rows are [id, label, color, text color, mode, slug, name].

Use it fairly

  • Check at most once a minute; the files change every 30 seconds.
  • Personal dashboards, displays and automations are welcome. For anything bigger, use UTA's official GTFS and GTFS-realtime feeds directly.
  • Times come from UTA's feeds and can be wrong. Confirm with UTA when it matters.
  • High Valley Transit and University of Utah stops aren't in these files yet.