Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 2.3 KB

README.md

File metadata and controls

78 lines (60 loc) · 2.3 KB

MMM-HVV 🚇

MagicMirror Module that displays departure information about public transportation in Hamburg, Germany. It uses v5.hvv.transport.rest (also see hvv-rest).

Update

hvv-rest was deprecated. Even though I'm not personally using MagicMirror anymore, I updated the endpoint to db-rest to make this module somewhat working again but I'm not planning to implement anything new. But feel to share or contribute your ideas!

Preview

Installation

Clone this module into your MagicMirror's modules directory:

cd modules
git clone https://github.com/lucoel/MMM-HVV

How to use this module

Add this to your MagicMirror config.js file:

{
  /* ...your other config */
  modules: [
    {
      module: "MMM-HVV",
      position: "bottom_left",
      config: {
        station: Number
      }
    }
  ];
}

Find your station/stop ID

Using the REST API you can GET /locations.

Example

curl 'https://v6.db.transport.rest/locations?query=Feldstraße,Hamburg&results=1' -s | jq
[
  {
    "type": "station",
    "id": "694779",
    "name": "Feldstraße (Heiligengeistfeld), Hamburg",
    "location": {
      "type": "location",
      "id": "694779",
      "latitude": 53.556976,
      "longitude": 9.968714
    },
    "products": {
      // …
    }
  }
]

With this method you can also search for the (optional) direction ID.

Configuration options

Option Description Default
station required The station/stop ID where you want to start undefined
destination Only show departures for a specific direction/destination ID undefined
maxDepartureTime Maximum time until departure in minutes 20
showIcons Show line icons for every departure true
header Custom header text HVV Departures