da4throux / MMM-Paris-RATP-PG

Local transport in Paris (RATP) module for MagicMirror² https://github.com/MichMich/MagicMirror/
MIT License
14 stars 6 forks source link

MMM-Paris-RATP-PG

MagicMirror MichMich module to display transportation information for Paris (bus, metro, tramway, RER, autolib & velib) and rain risk in the coming hour for a configured list of stations/ destinations.

Forked from MMM-HH-LocalTransport see more detailed information on georg90 blog.

Presentation

A module to display:

Screenshot -needs to be updated with eBike later-on

screenshot

API

It is based on the open REST API from Pierre Grimaud https://github.com/pgrimaud/horaires-ratp-api, which does not require any configuration / registration. It uses a non documented API from Meteo meteofrance for the rain within an hour prediction It uses the Open Data from Paris City for Autolib, and Velib

Install

  1. Clone repository into ../modules/ inside your MagicMirror folder.
  2. Run npm install inside ../modules/MMM-Paris-RATP-PG/ folder
  3. Add the module to the MagicMirror config
        {
            module: 'MMM-Paris-RATP-PG',
            position: 'bottom_right',
            header: 'Connections',
            config: {
            }
        },

specific configuration

Becareful, configuration changes will only be taken in account once the server side (not only the browser) is restarted. Three different kind of objects are in the configuration:

Config Example:

config: {
    debug: false,
    lineDefault: {
      hideTraffic: [
        "le trafic est interrompu entre Aulnay et Aeroport Charles de Gaulle 2 TGV de 23:00 à fin de service jusqu'au 16/03/18. Bus de remplacement à dispo. (travaux de modernisation)",
            "Trafic normal sur l'ensemble de la ligne.",
            "le trafic est interrompu entre Nanterre-Prefecture et Cergy/ Poissy de 21:30 à fin de service jusqu'au 16/02/18. Bus de remplacement à dispo. (travaux)",
      ],
      conversion: { "Trafic normal sur l'ensemble de la ligne." : 'Traffic normal'},
      updateInterval: 1 * 2 * 60 * 1000,
    },
    lines: [
      {type: 'buses', line: 38, stations: 'observatoire+++port+royal', destination: 'A', firstCellColor: '#0055c8'},
      {type: 'buses', line: 91, stations: 'observatoire+++port+royal', destination: 'A', firstCellColor: '#dc9600'},
      {type: 'buses', line: 91, stations: 'observatoire+++port+royal', destination: 'R', firstCellColor: '#dc9600', lineColor: 'Brown'},
      {type: 'rers', line: 'B', stations: 'port+royal', destination: 'A', label: 'B', firstCellColor: '#7BA3DC'},
      {type: 'traffic', line: ['rers', 'B'], firstCellColor: 'Blue', lineColor: 'green'},
      {type: 'metros', line: '6', stations: 'raspail', destination: 'A', label: '6', firstCellColor: '#6ECA97'},
//    {type: 'pluie', place: '751140', updateInterval: 1 * 5 * 60 * 1000, label: 'Paris', iconSize: 0.70}, //not working as of sept 2020
//    {type: 'autolib', name: 'Paris/Henri%20Barbusse/66', label: 'Barbusse', lineColor: 'green'},
//    {type: 'autolib', name: 'Paris/Michelet/6', label: 'Michelet', utilib: true, backup: 'Paris/Henri%20Barbusse/66'},
      {type: 'velib', stationId: 14111, label: 'Cassini', velibGraph : false, keepVelibHistory: true},
      {type: 'velib', stationId: 6018, label: 'Assas', velibGraph: true, keepVelibHistory: true},
        ],
},

v2.7