Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Next departure "unknown" #5

Open
tinkerberlin opened this issue Aug 3, 2022 · 3 comments
Open

Next departure "unknown" #5

tinkerberlin opened this issue Aug 3, 2022 · 3 comments

Comments

@tinkerberlin
Copy link

Hi there,
this might be a simple config problem/mistake on my side... however, I'm trying to add four connections. However, only one connection is working (U6 > Alt Mariendorf). All the other entries are displaying "unknown". I've pasted my config.yaml entry below.
Thanks for your help!!
image

@tinkerberlin
Copy link
Author

Any help possible?
Thanks!

  # BVG
  - platform: bvg_berlin_public_transport
    stop_id: "900000089303"
    direction:
      - "Henningsdorf"
    name: "S25 > Henningsdorf"
  - platform: bvg_berlin_public_transport
    stop_id: "900000089301"
    direction:
      - "Alt-Mariendorf"
    name: "U6 > Alt-Mariendorf"
  - platform: bvg_berlin_public_transport
    stop_id: "900000089303"
    direction:
      - "Teltow Stadt"
      - "Südkreuz"
    name: "S25 > Teltow Stadt / Südkreuz"
  - platform: bvg_berlin_public_transport
    stop_id: "900000089301"
    direction:
      - "Alt-Tegel"
    name: "U6 > Alt-Tegel"

    # https://github.com/ryanbateman/bvg-sensor

@amrutprabhu
Copy link

amrutprabhu commented Nov 3, 2022

You can set the walking_distance: 0. If you check the description, If the time to your station is not possible to catch the train, it will not display it. by default, it is 10, if not set.

It works for some, but for many stations I could not get it working.
e.g this worked for the following


- platform: bvg_berlin_public_transport
  name: Alex > S+U Hauptbahnhof - 2
  stop_id: "900000100031"
  direction: 
     - "Hauptbahnhof"
  walking_distance: 0

- platform: bvg_berlin_public_transport
  name: Alex > S+U Hauptbahnhof - 3
  stop_id: "900000100707"
  direction: 
     - "Hauptbahnhof"
  walking_distance: 0

but dint work for

- platform: bvg_berlin_public_transport
  name: "Alex > Ruhleben - 2"
  stop_id: "900000100031"
  direction: 
    - "Ruhleben"
  walking_distance: 0

- platform: bvg_berlin_public_transport
  name: "Alex > Ruhleben - 3"
  stop_id: "900000100707"
  direction: 
    - "Ruhleben"
  walking_distance: 0

@amrutprabhu
Copy link

I figured it out.
I went through the code and figured this out.
You need to chose your direction based on the output of this URL

https://v5.bvg.transport.rest/stops/{stop id}/departures?duration={ cache duration}

find all the directions from the output JSON, choose the direction you want, and add to the direction property.

eg. for Alexanderplatz,

curl https://v5.bvg.transport.rest/stops/900000100731/departures\?duration\=90 | jq '.[].direction'
- platform: bvg_berlin_public_transport
  name: "Alex > Ruhleben "
  stop_id: "900000100731"
  direction: 
    - "Ruhleben"
  walking_distance: 0

Works !!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants