Budapest Public Transportation stop information

Hi @zbeez ,

please note that some stations are with F, others without it.zbeez

In your case the station is BKK_F02295 (as shown attached)

Hi @amaximus,

first of all: thank you very much for the fast answer! Appreciate it.
I changed it back to the station with the letter “F”

platform: bkk_stop
name: "bkkxu"
stopId: "BKK_F02295"
minsAfter: 25
wheelchair: true
bikes: true
ignoreNow: False

and now I’m getting the same error as I initially started with. :frowning:

Logger: homeassistant.components.sensor
Source: custom_components/bkk_stop/sensor.py:114
Integration: Sensor (documentation, issues)
First occurred: 8:27:35 PM (3 occurrences)
Last logged: 8:27:35 PM

Error adding entities for domain sensor with platform bkk_stop
Error while setting up bkk_stop platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 607, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 715, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 526, in _async_write_ha_state
    extra_state_attributes = self.device_state_attributes
  File "/config/custom_components/bkk_stop/sensor.py", line 114, in device_state_attributes
    bkkjson += ",\"bikesallowed\":\""+ bkkdata["data"]["references"]["trips"][tripid]["bikesAllowed"] + "\""
TypeError: can only concatenate str (not "bool") to str

The sensor naturally doesn’t show because of that.

Could you please upgrade the integration to newest version 2.0.1 and get back to me with results?

That sorted the issue! It works now smoothly and the sensor is immediately recognised.

Thank you very, very much for the immediate action on this. I use this integration quite a few times, so I missed it. Now my world is complete again :joy:

I’m glad it’s working now for you.

1 Like

Hi amaximus,

I don’t know why but for me the lovelace says, that the card doesn’t exist, but it is setup from HACS.
Do you have any idea what could be the problem?

Never mind, it just started to work somehow :slight_smile:

Thank you!

Hi amaximus,

I hope somebody will help. I tried with and without HACS but the js is not working or I missed something (I tried from HACS repository the js not loaded after that, I uploaded the js directly to the folder and added it to resources). The sensors work correctly with the information, but the UI design didn’t appear.

Did you install the associated card from HACS? Once you install it, you’ll have to add it to the resources and restart HomebAssitant. Then you can add the card to your dashboard.

Hello,

Really like this integration and the custom card.
As a new feature could you add to the card (or integration) the option to filter out not only routes but also destinations (headsign). This could be useful for trains as at train station the directional stops are not pulled apart like there are for bus stops.

Hello,

could you please send me a sensor configuration I could test on with one or two headsigns? Also provide details on expected results.

Thanks.

  - platform: bkk_stop
    name: 'Budafok_vasutallomas'
    stopId: 'BKK_005503129'
    minsAfter: 90
    wheelchair: true
    inPredicted: true
    apiKey: XXXXXXXX
    routes:
      - S36
      - G43

In this sensor configuration for both lines there is two headsign available. I’m only interested in train with headsign “KƑbĂĄnya-Kispest” as destination (and not “SzĂ©kesfehĂ©rvĂĄr” or “TĂĄrnok”). So I want the possibility to filter according headsign as well (as an option like we are able to filter routes).

@nbai777 new version 2.8.0 [1] adds support for headsigns filtering.

[1] Release Add support for headsigns filtering · amaximus/bkk_stop · GitHub

Works like a charm, thank you.

Hi Everyone!

Is it possible to extract the number of minutes until the next departure of a given veichle as a numerical value? I thought that it must be some attribute of the sensor, but nothing is specified, the sensor groups the other attributes based on the minutes.

The whole idea would be that if I could extract the numerical value into a template sensor, then Assist would know the departures. Then I could create an automation so that when I ask Assit “when will the next subway go?”, it could answer “it will go in X minutes and Y minutes”, where X and Y are the continuously updated minutes data of next two departures.

Thanks for the help!

The minutes until the departure time is the ‘in’ attribute, see lines:

Thank you, it works!
I created the template like this if anyone interested:

{{states.sensor.bkk_pottyos.attributes.vehicles[X].in}}

If X=0, it displays the minutes until the next departure, if X=1, the departure after that and so on. bkk_pottyos is the name of the original sensor created for the station.