Home Assistant custom integration

Departures that feel like a real departure board.

Live Västtrafik departures for buses, trams, trains, and ferries, with line colors, transport icons, platform information, and a purpose-built Lovelace card.

Journey Planner API v4HACS compatibleOpen source
LindholmenNextThenPlatform
19Bäckebol via Backa3 14:3518 14:50C
12Mölndal7 14:3922 14:54A
10Guldheden12 14:4427 14:59A
X1Partille centrum16 14:4831 15:03D
01

One integration

Configure your Västtrafik credentials once. Additional stop areas reuse them automatically.

02

One board

Group routes by line and destination, then rotate through every departure page automatically.

03

One minute fresh

Polling keeps your board current while preserving the API’s live colors and realtime estimates.

Get started

Install in a few minutes

Install through HACS for updates, or copy the integration manually into your Home Assistant configuration.

01

Install

In HACS, open Integrations, search for Västtrafik Journey Planner, and download it. You can also copy custom_components/vasttrafik_timetable into your Home Assistant config/custom_components directory.

02

Create API credentials

Create an application at developer.vasttrafik.se and subscribe it to Planera Resa v4. Keep the Client ID and Client Secret available for the first setup.

03

Add your first stop

Restart Home Assistant, open Settings → Devices & services → Add integration, and select Västtrafik Journey Planner. Search for a stop, select it, and save the departure settings.

04

Add more stops

When adding another stop, the integration reuses the credentials from your existing Västtrafik entry. You only need to search and select the new stop.

Using HACS before catalogue inclusion?

Add EHoglid/hass-vasttrafik as a custom repository, choose Integration, then search for Västtrafik and download it.

The Lovelace experience

A board built for the wall.

The bundled card follows Home Assistant’s layout height, fills each page with rows that fit, and rotates through additional pages without manual templates.

dashboard.yaml
type: custom:vasttrafik-timetable-card
entity: sensor.lindholmen_next_departure
title: Lindholmen
size: m
show_departure_after: true
lines: "10, 12, 19, 21, X1"
page_seconds: 5
xs / s / m / l / xlDensity presets from 0.75 to 2 Home Assistant grid rows.
Show departure afterKeep or hide the Then/Därefter column.
Line filtersShow only selected line numbers or names.
Automatic pagingProgress pill and page indicators, with a configurable interval.

Configuration

Useful by default, adjustable when needed.

Each stop can configure:

  • Time span from 0 to 1440 minutes
  • Platforms and direction stop-area GID
  • Maximum departures per line and direction
  • API page size and optional occupancy data
  • Optional RFC 3339 start date and time

Developers

Built with tests and CI.

Run the API tests and Ruff locally. GitHub Actions runs the full Home Assistant test setup on Ubuntu.

Development guide