Skip to content
A module for the Magic Mirror to display Barcelona TMB metro train and bus times
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is a module for the MagicMirror² to display Barcelona's TMB bus times


Go to your MagicMirror's modules folder and execute git clone

Using the module

alt text

To use this module, add the following configuration block to the modules array in the config/config.js file:

var config = {
    modules: [
            module: 'MMM-TMB',
            position: "bottom_right",   // This can be any of the regions.
            config: {
                // See below for configurable options

Configuration options

Option Description
appId Required Your TMB API appID. If you don't have one, you can request one here.

Type: string
Default value: none
appKey Required Your TMB API appKey. If you don't have one, you can request one here.

Type: string
Default value: none
busStopCode Required The 6 digit bus stop code to monitor. You can get it from your bus stop or find it here.

Type: string
Default value: none
busLine Optional The bus line nuber to retrieve only this line's info.

Type: string
Default value: none
maxEntries Optional The maximum number of buses to display.

Possible values: 1 to 10
Default value: 5
refreshInterval Optional How often to check for the next bus.

Type: int
Default value: 30000 milliseconds (30 seconds)
warningTime Optional Time for colored alarm.

Type: int
Default value: 600 seconds (10 minutes)
blinkingTime Optional Time for blinking alarm, must be less or equal than warningTime.

Default value: 300 seconds (5 minutes)
You can’t perform that action at this time.