Skip to content

New Share your ideas with the AWTRIX community. Keep your creations together in your account.

Sign in

Which AWTRIX do you have? Choose it once and the Hub shows what runs on it.

ScriptAWTRIX NG

Abfahrt – Live Departures

On an AWTRIX display
Abfahrt – Live Departures shown on an AWTRIX display
Abfahrt – Live Departures · by aljoschairmer

On your display

Live public transport departures for your stop: line colours, real-time countdown, delays, cancellations, line and destination filter.

Which AWTRIX do you have? See below where it runs, or choose your device.
Topic
Miscellaneous
Includes
Script

Runs on

  • Runs on 32×8 (TC001 & DIY) 32×8 (TC001 & DIY) version
  • Runs on 52×16 (TC002)
  • Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.

Choose your display in the next step.

Send to AWTRIX

Choose your AWTRIX

Abfahrt – Live DeparturesAWTRIX NG script

Install this script on your AWTRIX NG. Its icons and sounds are installed with it.

Your AWTRIX’s local address, for example 192.168.178.39 or awtrix.local.

The name shown in your AWTRIX script list. Use letters, digits, hyphens or underscores.

Connection & device login

Connect your phone or computer to the same network as your AWTRIX. Allow local network access if your browser asks.

Use the device’s IP address, without a page path such as /#/apps.

If your AWTRIX requires a login, the username and password fields will appear when you connect.

Sign in to the Hub to install scripts. Attached files are installed separately.

Script description

Shows the next departures of any public transport stop on your clock, with real-time data from Transitous. Works in Germany and many other countries.

What you see

On the TC001 (32×8)

  • Board layout (default): each departure gets a time line (minutes, delay like +7) and a destination line. The lines roll upwards like a station departure board. The line badge stays put within a departure.
  • Compact layout: line, destination and minutes in one row.
  • Cancellations in red, the minutes struck through.

On the TC002 (52×16)

  • Board (default): two departures at a time, each in its own row: line badge, destination, minutes, with a dotted line between the rows. When the board moves on, it turns over like an old station board with split flaps, cell by cell from the left, each letter flipping through a random one first (setting Page change: flaps or rolling rows).
  • Minutes in large digits that roll over like a counter when they count down. The delay sits small in orange next to them (+4). A cancelled train is greyed out with a red cross.
  • Line badges shaded like enamel signs, with a glint running across now and then; the line's own text colour where it reads on LEDs, long-distance trains without a colour in DB style (red on white).
  • One at a time, large: one departure per page, readable from across the room: a full-height line badge with tall, rounded letters, large minutes level with "min" and the delay next to them, the destination below, and the vehicle seen from the front (train, ICE, underground train, tram or bus in the line's colour). Its destination display runs and its headlights shine at night and when it leaves soon; it comes closer as the app appears and drives away into the distance when it leaves.
  • Lines at a glance (press the knob): each line and direction once, with its next three times, S5 Bad Homburg 3' 13' 23'.
  • Zoomed out (turn the knob left at the top of the list): a timeline of the departures, its scale fitted to them, each a mark in its line's colour.
  • LOS! When it is time to set off and the app is on screen, a pulsing red band counts down the time left (LOS! 3:42).
  • Platform in front of the destination (Gl.5, a change in orange), notices about works or diversions after it (the badge gets an orange corner), the train number of long-distance trains (ICE 579) and, if you like, a few stops on the way (über Langen, Egelsbach).
  • Destinations kept short (Südbahnhof → Südbf), your own town left out.
  • A bar along the bottom row shows for a moment where you are in the list after a turn of the knob; when the app appears, the minutes count up and the timeline's dots slide in.

On both

  • Timeline in the bottom pixel row: 1 pixel = 1 minute, every departure is a dot in its line colour (not in the large one-at-a-time view).
  • Line badges in the official line colours; where the data has none, by kind (S-Bahn green, U-Bahn blue, tram red, bus purple). Colours too dark for LEDs are made brighter, very light ones slightly darker.
  • Minutes turn red / orange / green relative to your walking time. Minutes from the timetable alone (no real-time data) are grey-white; when no new answer has come for a few minutes (no connection), all minutes turn grey.
  • More than an hour away: the time of day (05:12) instead of the minutes, so at night you see when the first train goes.
  • Long destinations scroll to the end; the app moves on only after they could be read.
  • After you set a new stop, the clock shows once which stop it found ("Gefunden" / "Found"); on the TC002 with a map pin and the town above the stop's name.
  • Clear status messages instead of an empty screen: no connection, too many requests, stop not found, no stop set, or no matching departure (with a list of what was seen).

Setup

  1. Install the script, then open the Apps tab and click the gear icon next to Abfahrt.
  2. Stop: type the name of your stop, e.g. Frankfurt Hauptwache or Offenbach Marktplatz. The script looks up the stop ID by itself and only considers stops served by your Transport modes. For a stop served only by buses, add BUS there first. You can also paste a MOTIS stop ID (e.g. de-DELFI_de:06412:1). On the TC002, if the name matches several stops, the clock asks which one: turn the knob through them, with their town, and press it (or SELECT) to take one; after 30 s it takes the first.
  3. Optional, Only lines: line filter, comma-separated, e.g. S5, U3. A bus line can be given by its number, e.g. 30.
  4. Optional, Only towards: destination filter, comma-separated, e.g. Südbahnhof or Bad Vilbel, Friedberg. With Check stops on the way switched on, trains that only pass through your destination are shown too (e.g. an S6 to Friedberg via Bad Vilbel). Both filters can be combined.
  5. Optional, Walking time: hides departures you can no longer catch.

Other settings

Setting Meaning
Transport modes MOTIS modes, e.g. add BUS. Also used to find your stop
Leave reminder With a walking time: this many minutes before you have to leave, once per departure. TC001: the app comes to the front. TC002: a notification over any app with a gong (see below), the minutes of that train blink, and LOS! counts down. 0 = off
Reminder sound (TC002) Off, a gong, or a gong and the departure read aloud (in English)
Reminder as notification (TC002) On (default): the reminder shows over any app, and a second notification follows if that train is then cancelled or 5 minutes late. Off: the app comes to the front instead
Nearby stops (TC002) Also departures from stops this many metres away, e.g. the tram stop across the road. 0 = only your stop
Departures Departures per turn (TC001: 1–5, TC002: 1–10)
Minimum per line / row Seconds each line stays at least
Scroll speed Speed of long destinations
Large minutes / Timeline Big digits, timeline row
Shorten destinations Hauptbahnhof → Hbf, Straße → Str., drops S+U and additions in brackets. TC001: also drops your own town and "Bahnhof". TC002: Bahnhof → Bf, Südbahnhof → Südbf
Language On-screen words: de (jetzt, fällt aus) or en (now, cancelled)
Days, From / Until When the app shows and loads departures, e.g. Mon–Fri from 6 to 9. A window like 22 to 2 spans midnight
Public holidays (TC002) The German public holidays of a state count as Sundays for the days. TC001: public holidays are not recognised
Refresh How often departures are loaded while the app is on screen
Layout (TC001) board or compact
One at a time, large (TC002) One departure per page in large type, see above
Page change (TC002) flap (split flaps, default) or roll (the rows roll up)
Hide own town (TC002) At a stop in Frankfurt, Frankfurt (Main) Hausen → Hausen
Via stops (TC002) off, 2 or 4 stops on the way after the destination. The answers get about ten times larger
Train number (TC002) ICE 579 in front of the destination of long-distance trains
Platform (TC002) The platform in front of the destination, where the data has it
Disruptions (TC002) Notices about a line run after its destination
Hide when nothing within (TC002) The app is hidden while the next departure is further away than this. 0 = always show

Buttons and knob

  • TC001: Middle: reload now · Left / Right: previous / next departure
  • TC002: SELECT: reload now · Left / Right: switch apps, as usual · Knob turn: through every departure loaded; turned left at the top: zoom out to the timeline, right to zoom back in · Knob press: lines at a glance, again: the board · Knob hold: board or one at a time, large

Good to know

  • Outside the days and hours you set, the app is hidden and makes no requests.
  • Requests: every minute (the Refresh setting) while the app is on screen or a leave reminder is due, every 5 minutes otherwise, and at once when it comes back on screen.
  • The stop that was found is remembered. Changing the stop or the transport modes looks it up again. If Transitous no longer knows the stop's ID (when a timetable dataset is renewed), the stop is looked up again by its name.
  • The TC001 version is built to fit ESP32 clocks without PSRAM (96 KiB for scripts). If saving fails with "not enough memory", restart the clock and save again.
  • The TC001 version reads about the next 4 departures per update, the TC002 version up to 20. If a filter leaves too few, both load up to two more batches.
  • The TC002 reads every departure with a JSON parser, so names with quotes and notices with line breaks come out right. Trains you cannot board at your stop are left out, and a notice "no service" counts as a cancellation.
  • If memory gets tight while a response arrives, the script halves its buffer and retries, then grows it back.
  • If Transitous answers "too many requests", the app keeps the departures it has and waits 5 minutes before asking again.
  • "No matching departure. Seen: …" lists the lines and destinations that were found, so a typo in a filter is easy to spot.
  • On the TC001, with a new destination filter some departures appear after a few seconds, because the script first checks which lines pass your destination. The result is remembered. The TC002 checks this in the same request, without delay.
  • For other apps (TC002): the next departure as abfahrt.line, .to, .min, .delay, .leave (minutes until you have to set off) and .time in the shared values, e.g. for a lamp in Home Assistant.

Data: Transitous. Sources and licences: transitous.org/sources. Please respect the usage policy.

Credits

  • Thanks to hi2hello and their app Abfahrt: the schedule (days, from / until), the leave reminder and showing the stop that was found were inspired by it.

More scripts in Miscellaneous

Something wrong with this script? Report it.