Deutsche Bahn integration - How to add several sensors

So the usual: I am new at home assistant and therefore do not have too much experience with yaml file configuration.

I am trying to setup the “Deutsche Bahn” integration with several connections. Therefore I would like to have several train connections which I then can integrate into my frontend.

If I add only one connection via the following code, everything works fine:

sensor: 
  - platform: deutsche_bahn
    from: "Berlin Hbf"
    to: "Braunschweig Hbf"
    only_direct: true

However how do I add two such connections? The integration page does not specify how this is done. I tried like this:

sensor: 
  - platform: deutsche_bahn
  
    from: "Berlin Hbf"
    to: "Braunschweig Hbf"
    only_direct: true

    from: "Braunschweig Hbf"
    to: "Berline Hbf"
    only_direct: true

But that gives me (of course) only an error that I have multiple keys. So what is the correct syntax for this operation?

Perhaps as a side remark, the fact that from and to is written in bold is not my fault. The text in the yaml file is of course formatted correctly.

Add the line “- platform deutsche_bahn” again before the second sensor.

An FYI … I am not sure if this concerns the very same integration you are talking about but I am pn 2022.8.1 and cannot see DB integration
Deprecate the Deutsche Bahn by frenck · Pull Request #76286 · home-assistant/core (github.com)

2022.7.7
that’s unfortunate

Seeing the above related github entries it will be removed in 2022.11

thanks so much, that did the trick.
The decaprication is of course unfortunate

It states that it is removed because of webscraping? I dont understand, are not all of these plugins like weather or other train timetable based on such techniques or what is the difference? And why is this frowned upon? Will there be a replacement?

I haven’t dealt with it yet, but that will be legal reasons, copyright I think. Other techniques could then be APIs.

Do you know if there will be an alternative? How do I find out?

Maybe open a new topic here, or ask on discord.

Or on github, it’s a core integration.

But only used by 192 installations.

If you use HACS: