Configuration Deutsche Bahn Integration

How can I display information from Deutsche Bahn integration in dashboard. I put the sensor in configuration.yaml but in Lovelace card I get the notification ‘Unknown’?

I’m also getting “unknown” for my sensor.

My setup in config.yaml:

sensor:
  - platform: deutsche_bahn
    from: "Stuttgart Feuersee"
    to: "Sindelfingen"

Does anyone know, what’s wrong?

Any help is appreciated!

Here is my example and it is working. Maybe because you don’t have HBF at the end.

#Deutsche Bahn
sensor:

  • platform: deutsche_bahn
    from: “ALTENGLAN HBF”
    to: “LANDSTUHL HBF”

Thanks for your quick reply.

Unfortunately your config does result in the same error:

Screenshot DB

At least I know that it must be my config. Any ideas what could be wrong or where to look for? I can’t really find anything in the logs.

No idea. Here is a screenshot from my system.

Stupid question, did you restart?

Yes, I did. :slight_smile:

I think I just found the solution to my problem. The issue was that the train station names have multiple matches.

I went to

[Deutsche Bahn: bahn.de - Verbindungen - Ihre Anfrage]

and searched for my stations. If there is a exact match the search will show the results. Otherwise it will ask you which station you meant. For me I had to choose “Bahnhof, Sindelfingen” instead of “Sindelfingen”, see:

sensor:  
  - platform: deutsche_bahn
    from: "Stuttgart Feuersee"
    to: "Bahnhof, Sindelfingen"

I still don’t understand why the config @fspatt posted is working for him but not for me though. :nerd_face:

Looks like you resolved your problem?

  1. Is there any “ready to use” frontend integration displaying the train raw data information in a nice way?
  2. How to add “10” (minutes) to “15:01” (time format/string) in Jinja?

I worked with plain entities card so far which is “okay” at best, visually not that attractive to be honest.

But at most I struggle for example with showing the actual departure time (add state_attr('sensor.train','delay') to state_attr('sensor.train','departure')) etc.