Another MVG - SBahn, UBahn, Tram und Bus für München und Umgebung

Servus in die Runde,

ich möchte euch kurz die Another MVG Integration vorstellen, mit der ihr die Abfahrtszeiten ausgewählter Haltestellen in München und dem Münchner Umland direkt im Home Assistant Dashboard anzeigen lassen könnt.

Mit etwas technischem Know-how könnt ihr diese Informationen auch auf einem Amazon Alexa Show 15 oder in OpenHASP anzeigen lassen.




2 „Gefällt mir“

Gefällt mir :slight_smile: , nur da ich nicht aus München bin, musste ich mir mal selbst was bauen da keine der Integrationen (Offiziell wie HACS) das hilfreich und sinnvoll in der Schweiz umgesetzt hat.

1 „Gefällt mir“

Wie hast Du denn diese Punktschrift erstellt ? Das hat was.

Version 2.1.0 ist released.

:warning: BREAKING CHANGES

  • YAML support is deprecated, but all YAML sensors will be automatically converted to a GUI sensor.
    → After the Update and restart of HA check if the Sensors are available in the GUI configuration. After this you can safely remove the code from your configuration.yaml.

Du to the fact that the YAML support is removed, the uniqui_id creating has been changed. This is only an internal “thing” but leads to the fact, that from now on you don’t need the doublestationnumber any more. This means that DEFAULT_CONF_DOUBLESTATIONNUMBER was removed from the config completely and CONF_DOUBLESTATIONNUMBER from the GUI configuration mask. Important for you, if you want to use the same stop (Global ID) more than once, there is no need any more to configure this option. In other words, don’t care about it. ^^

Other Changes

  • Fixed the HA deprecation warning for Detected that custom integration sets option flow config_entry explicitly, which is deprecated at custom_components/another_mvg/config_flow.py

I summarized the changes from the BETA and included them below.

Added in BETA 5

Another MVG now also displays departures for the next day if there are no or not enough results for the current day. This will be done with an additional API query if required. Since I can only request data with an offset to the next day, this offset will be calculated from the current time and the time until midnight. For this reason, it is important that the time on the computer running HA is correct.

Added also a new option Increased Limit under the Advanced Settings

This option is intended to correct missing entries after midnight if many filters are used. Use this option only if fewer entries than desired are displayed in the evening. Adjust slowly in steps of 10, as this option can lead to unnecessary additional API requests.

Added in BETA 4

  • Added S-Bahn line S5 to prepare for the new line launching in a few weeks.
  • Added a new card content-card-another-mvg-livemap.js.

The new card can be added and configured directly through the map selector, just like other cards.
Simply go to your dashboard, click on “Add Card”, search for “Another MVG”, and select the card from the results.

That’s all. In the standard configuration, it shows the complete map.
If you want to zoom in, follow the instructions in the description.
This editor is currently only available in German because I have no clue how to add language support to the card.
If there is a real need, I can create an additional card for English users.

If, for some reason, you are not able to find the card, try clearing your frontend and browser cache, or try configuring the card on your own.

type: custom:content-card-another-mvg-livemap
mode: schematic
x: "2750800"
y: "1560005"
zoom: "4.8"

Added in BETA 3

Added new Option to search the Global ID and Global ID 2 also after the initial setup.
Just click on CONFIGURE as before to edit a sensor and choose from the menu the wanted option

Apart from the changes above, the description of the fields/options has been improved to make it more clear to understand how it works.

Added in BETA 2

  • removed unnecessary entries from the translation files
  • fixed an issue in the “big” card where the line break of the destination column was not correct formatted
  • Added an option to change the format of the Departure time

You have the following 3 options (the 1st one is the default option)

  • 16:27 +2 (16:29)
  • 16:27 +2
  • 16:29

In the example, 16:27 is the scheduled departure time, the train has a delay of 2 minutes, and 16:29 is the current departure time. If only the current departure time (Option 3) is displayed, the time will be shown in red if there is a delay.

Option 1 (same as before)

Option 2

Option 3

Added in BETA 1

Added an option (disabled by default) to show a clock on the top right of the card. (same line than the title of the card)
Its a simple JavaScript clock and takes the time from the device (Mobile Phone or Browser)
The update may not happen at the exact second because its triggered by an Home Assistant card update

You can find the new option in the Advanced Settings Section

2 „Gefällt mir“

Vielen Dank! Finde die Integration top.

Gibts nen speziellen Grund, wieso der Titel für die Dashboard-View in den Sensorseinstellungen steckt? Persönlich fände ich es schöner, dass man den im Dashboard einstellen kann.

Zur Begrifflichkeit:

  • Die App trägt “MVG” im Namen. Das ist der Betreiber von Bussen, Tram-Bahnen und der U-Bahn.
  • Die Karte, die Du verwendest kommt offenbar von der S-Bahn München, die soweit ich sehen kann, nicht erwähnt wird.
  • “MVV” ist der Name des Tarifverbund und betreibt überhaupt keine Verkehrsmittel selbst. Und hat hier auch augenscheinlich keinen Beitrag bei der App.
  • Der Titel wäre also treffender etwas mit "MVG und S-Bahn München”

Wie dem auch sei: Coole Integration. Jetzt brauch ich dringend einen Monitor im Flur, damit die Kinder sehen, wann die Bahn fährt :slight_smile:

Gruß

Andy

Hi Andy

Der Titel ist dort, weil dort alles konfiguriert wird. Zumindest war das historisch so gewachsen als es nur rein über die YAML möglich war den Sensor hinzuzufügen. Ich kann es ja mal auf meine TODO setzen, so dass man den Titel in der Karte “überschreiben” kann. Sehe da zwar selbst keinen großen technischen Nutzen, außer das man die Karte so mehrmals mit verschiedenen Titeln einfügen kann, obwohl der Inhalt gleich ist. Aber sollte keine große Änderung sein.

Mit Karte meinst Du die LiveMap oder ? Das ist im Endeffekt nur ein IFrame, also die LiveMap ist lediglich eingebunden und über die Dashboard-Karte konfigurierbar, wie Du es auch im Browser machen könntest. Daten für die Abfahrten werden von dort keine ausgelesen. Kam auch erst später hinzu nachdem es das Addon schon eine Weile gab.

Ansonsten verstehe ich Deine “Sorge” nicht so ganz. Das Addon nennt sich ja “Another MVG” also hat ja MVG schon im Namen. Da dies kein offizielles Addon ist, kann ich es nicht einfach MVG oder S-Bahn München nennen. Das “Another” habe ich hinzugefügt, da es schon andere zum damaligen Zeitpunkt nicht mehr funktionierende Lösungen gab. Btw können auch normale Züge angezeigt werden wenn man “BAHN” manuell hinzufügt.

Monitor: Nimm einen OpenHASP Monitor oder einfach ein billiges Android Tablet mit Fully KIOSK, das ist dann noch einfacher.

1 „Gefällt mir“

Hallo zusammen,

Ich würde die Integration liebend gerne in mein neu eingerichtetes HA mit aufnehmen (bin noch blutiger Anfänger:)), aber ich kann die Another MVG nicht in HACS finden. Wenn ich versuche, eine weitere Repository hinzuzufügen (https://github.com/Nisbo/another_mvg), bekomme ich lediglich eine Fehlermeldung, dass dies keine valide Repository ist. Das automatische Hinzufügen funktioniert leider auch nicht. Gibt es da einen Trick? Mache ich irgendwas falsch?

Danke schon mal im Voraus.

Grüße aus München,
Daniel

Na eigentlich musst Du nur hier klicken und dort ggf die URL von deinem HA eintragen.