/bkk_stop

HomeAssistant custom component for Budapest public transportation

Primary LanguagePython

hacs_badge

Buy me a coffee

BKK Stop Information custom component for Home Assistant

Providing also a custom state card for legacyUI.

This custom component and custom card shows Budapest Public Transportation (BKK) line information departing in the near future from a configurable stop.

Installation

The easiest way to install it is through HACS (Home Assistant Community Store), search for BKK Stop Information in the Integrations.

If you are not using HACS, download the files from custom_components/bkk_stop into your $homeassistant_config_dir/custom_components/bkk_stop.

Once downloaded and configured as per below information you'll need to restart HomeAssistant to have the custom component and the sensors of bkk_stop platform taken into consideration.

Configuration:

Define sensors with the following configuration parameters:


Name Optional Default Description
name N - sensor of bkk_stop type to display
stopId N - StopId as per go.bkk.hu
apiKey N - API Key to BKK data as per opendata.bkk.hu
maxItems Y 0 Number of items to consider. 0 disables this feature
minsAfter Y 20 Number of minutes ahead to show vehicles departing from station
wheelchair Y false Display vehicle's wheelchair accessibility
bikes Y false Display whether bikes are allowed on vehicle
colors Y false Display BKK's default color for the line and the text
ignoreNow Y true Ignore vehicles already in the station
entity_id Y `` Used instead of name for automatic generation of entity_id
inPredicted Y false Calculate time in as per estimated arrival time, when available
routes Y `` List of routes to consider. Those not listed will be discarded
headsigns Y `` List of headsigns to consider. Those not listed will be discarded. Useful for trans stations
minsBefore Y 0 Skip vehicles departing from station in minsBefore minutes, e.g. while walking to the station. Use non-positive value!

On begining of June the test API key has been revoked, therefore to use this integration you'll have to create an account at opendata.bkk.hu, generate an API key for yourself and set that in the integration configuration.

Example

platform: bkk_stop
name: 'bkk7u'
stopId: 'BKK_F00940'
minsAfter: 25
wheelchair: true
apiKey: !secret bkk_apikey
routes:
  - 287
  - 114
  - 213

Lovelace UI

There is a Lovelace custom card related to this component at https://github.com/amaximus/bkk-stop-card.

Legacy UI

Custom state card is provided for presenting data on legacy UI. Pls see the legacyUI directory structure for example.

Lovelace UI:
bkk_stop Lovelace example