Skip to content
Magic Mirror module for Pasadena Transit information. Real-time Pasadena Transit bus departures.
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
screenshots
.gitignore
LICENSE
MMM-PasadenaTransit.css
MMM-PasadenaTransit.js
README.md
gen_stops_dict.js
node_helper.js
package.json
pt_helper.js
stops.json
stops.txt

README.md

Module: Pasadena Transit

This MagicMirror module shows real-time departures of Pasadena Transit buses. Magic Mirror module for Pasadena Transit information. Real-time Pasadena Transit bus departures.

The module is designed to pull the estimated time of arrival of the bus based on the stop codes provided in the config file. Multiple stops can also be added by adding multiple MMM-PasadenaTransit blocks in the config file

Screenshot of MMM-PasadenaTransit

Dependencies

This module requires a list of stop ids and stop names with their corresponding stop_codes (shared between LA Metro and other agencies in the LA area). The list is currently contained as a JSON formatted in stops.json.

Should there be any update in the future, this list can be regenerated by downloading Pasadena Transit's static GTFS feed, copy stops.txt to same directory then run

node gen_stops_dict.js

Installation

Go to your MagicMirror's Module directory:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/pbuabthong/MMM-PasadenaTransit.git

Install npm packages:

cd MMM-PasadenaTransit
node install

Using the module

First, add the following to the modules array in the config/config.js file:

modules: [
    {
        module: 'MMM-PasadenaTransit',
        position: 'top_right', // This can be any of the regions.
        config: {
            stopCode: [your stop code #1],
        }
    }, 
    {
        module: 'MMM-PasadenaTransit',
        position: 'top_right', // This can be any of the regions.
        config: {
            stopCode: [your stop code #2],
        }
    }
]

Stop code

The stop codes can be looked up either via Google Maps or http://rt.pasadenatransit.net/rtt/public/ (the code is shared with LA Metro and other agencies in LA Metro area).

Note that currently, the stops on the opposite side of the street have different stop_codes. If you want the modules to show buses from both direction, please create another config with the stop_code of the opposite stop

Example

The following shows an example config file for showing the ETAs of buses from both directions at the intersection of Lake Ave & San Pasqual St

modules: [
    {
        module: 'MMM-PasadenaTransit',
        position: 'top_right',
        header: 'Northease corner',
        config: {
            stopCode: 13681 ,
        }
    }, 
    {
        module: 'MMM-PasadenaTransit',
        position: 'top_right',
        config: {
            stopCode: 5234,
        }
    }
]

Screenshot of Pasadena stop code lookup

Configuration options

Option Description
stopCode stop_code (shown as 'Stop #' in Pasadena Transit map A.
Expected Value type: int.
header Header of the module block (optional: default to the name of the bus stop).
Expected Value type: string.
updateInterval Time between updates, in seconds. To protect API abuse, this module automatically limits this value to a minimum of 10.
Expected Value type: int.

Planned Features

  • Support multiple stops
  • Shows both direction from a single intersection (the stop code of the opposite stops is already in stops.json
You can’t perform that action at this time.