Skip to content

alex-jung/ha-departures

Repository files navigation

Public Transport Departures

hacs_badge GitHub Release GitHub License

This integration provides real-time information on upcoming departures across various public transport modes, including buses, subways, trams, and more.


Data source

The Public Transport Departures uses Transitous as data source.

Supported countries

With the latest version (>= 3.0.0) of ha-departures, the integration now supports public transport departure information across a wide range of countries worldwide, thanks to the integration of the Transitous API.

Users can access departure data from transit systems in the following regions:

Countries
  • Albania
  • Australia
  • Austria
  • Belgium
  • Bermuda
  • Bosnia and Herzegovina
  • Brazil
  • Bulgaria
  • Canada
  • Chile
  • Colombia
  • Croatia
  • Cyprus
  • Czechia
  • Denmark
  • Egypt
  • Estonia
  • Ethiopia
  • Finland
  • France
  • Germany
  • Greece
  • Hong Kong
  • Hungary
  • Iceland
  • India
  • Indonesia
  • Ireland
  • Israel
  • Italy
  • Japan
  • Korea
  • Kosovo
  • Latvia
  • Liechtenstein
  • Lithuania
  • Luxembourg
  • Malaysia
  • Mexico
  • Moldova
  • Monaco
  • Montenegro
  • Netherlands
  • New Zealand
  • North Macedonia
  • Norway
  • Oman
  • Poland
  • Portugal
  • Puerto Rico
  • Romania
  • Serbia
  • Singapore
  • Slovakia
  • Slovenia
  • Spain
  • Sweden
  • Switzerland
  • Thailand
  • Türkiye
  • Ukraine
  • United Arab Emirates
  • United Kingdom
  • United States

Installation

HACS Installation (recommended)

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual Installation

  1. Using the tool of choice open the folder for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components folder there, you need to create it.
  3. In the custom_components folder create a new folder called ha_departures.
  4. Download all the files from the custom_components/ha_departures/ folder in this repository.
  5. Place the files you downloaded in the new folder you created in step 3.
  6. Restart Home Assistant

Configuration

Start integration dialog

The configuration of integration is made via Home Assistant GUI

  1. Open Settings / Devices & services
  2. Click on Add Integration button
  3. Search for Public Transport Departures
  4. Click on integration to start configuration dialog

Configure a hub configuration

Step 1 - Choose a location and radius to search

image

Step 2 - Choose a stop

Please select one stop location from the list

image

Step 3 - Choose the connections

You will get list of connections provided by the API for selected stop. Select all connection(s) you are interesting in and click on Submit

image

Step 4 - Define a name of new hub configuration

Choose a name for your new hub configuration

Warning

Duplicate names to existing hubs are not allowed!

image

After Submit a new Hub will be created incl. new sensor(s) for each connection you selected in previous step:

image

Reconfigure an entry

You can any time add or remove connections to existing hub's (stop locations)

image

Just click on ⚙️ icon, select or deselct the connections and click on Submit, Integration will add new connections to the integration. The status of removed connections will be changed to not provided.

Usage in dashboard

Option 1 (ha-departures-card)

Screenshot

Documentation of this card please s. repository

Option 2 (show departure time)

Add a custom template sensor in your configuration.yaml

sensor:
  - platform: template
    sensors:
      furth_197:
        friendly_name: 'Fürth Hauptbahnhof - Bus 179 - Fürth Süd(time only)'
        value_template: "{{ (as_datetime(states('sensor.furth_hauptbahnhof_bus_179_furth_sud'))).strftime('%H:%m') }}"

Add entity (or entites) card to your Dashboars(don't forget to reload yaml before)

type: entities
entities:
  - entity: sensor.furth_197
    name: Fürth Hauptbahnhof - Bus 179 - Fürth Süd
    icon: mdi:bus

image

Option 3 (with time-bar-card)

You can use other cards like time-bar-card to visualize remaining time to the next departure. card yaml configuration:

type: custom:timer-bar-card
name: Abfahrten Fürth-Hbf
invert: true
entities:
  - entity: sensor.furth_hauptbahnhof_u_bahn_u1_furth_hardhohe
    bar_width: 30%
    name: U1 - Hardhöhe
    guess_mode: true
    end_time:
      state: true
  - entity: sensor.furth_hauptbahnhof_bus_179_furth_sud
    bar_width: 30%
    name: 179 - Fürth Süd
    guess_mode: true
    end_time:
      state: true

Result looks like there:
ezgif-3-136a167cd5

☕ Support My Work

If you enjoy my work or find it useful:

Buy Me a Ko-fi


About

Home Assistant custom component to get departure times of public transport in more as 60 countries.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors