Skip to content
MagicMirrorModule for fetching REST data and displaying them on the mirror
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Module: MMM-Rest

The MMM-Rest module is a MagicMirror addon. This module collects data via HTTP calls and displays it on your mirror in a table.

Rest Displays


  1. Navigate into your MagicMirror's 'modules' folder and execute 'git clone'
  2. cd 'cd MMM-Rest'
  3. Execute 'npm install' to install the node dependencies.


2016-10-27: incompatible changes: the "suffix" and "digits" parameters are removed and replaced by a "format" parameter! Please check your config! 2018-02-02: added ranges to format parameter

Known Issues

  • had a problem with remote URLs an AJAX: changed to node_helper.js to collect data

Using the module

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

modules: [
		module: 'MMM-Rest',
		position: 'bottom_right',	// This can be any of the regions.
									// Best results in one of the side regions like: top_left
        config: {
                debug: false,
                mappings: {
                    on_off: {
                        true: 'on',
                        false: 'off',
                    temperature: {
                        1: 'cold',
                        2: 'warm',
                        3: 'HOT',
                sections: [
                    format: '%.1f<span class="wi wi-celsius"></span>',
                    url: '',
                    format: [
                        { range: [, 10], format: '<span style="color:green">%d</span>'},
                        { range: [10, 20], format: '<span style="color:yellow">%d</span>'},
                        { range: [30, ], format: '<span style="color:red">%d</span>'},
                        { string: 'HOT', format: '<span style="color:red">%d</span>'},
                        { format: '%d'}
                    url: '',
                    format: '%s',
                    mapping: 'temperature',
                    url: '',
                    format: '%d<span class="wi wi-humidity"></span>',
                    url: '',
                    format: 'Lights %s',
                    mapping: 'on_off',
                    url: '',
            output: [

Configuration options

The following properties can be configured:

Option Description
sections sections is an array of hashes for the REST endpoints to connect to
Option Description
format If it is a strint: sprintf() format
Could also be an array of hashes. The array is processed from top to bottom and first match wins. The last entry could be a default without "range". Leaving one value of the range empty means "ignore this bound".
You could use "string" instead of "range" to match the value against the parameter of the string.
mapping Map the value againt a defined mapping
url The url to call. It has to return a single integer / floating point value
mappings mappings is an hash of hashes for the mapping of values to other values
Option Description
NAME_OF_MAPPING Name of mapping will be referenced by sections -> mapping
values hash of key / values to map from / to
output control the output table for the display. Has to be a 2-dimensional array representing the rows and the columns of the output
A cell containing a '@' followed by a number represents the section id (starting by 1) of the REST Urls
updateInterval How often this refreshes

Example: 60000
Default value: 60000
initialLoadDelay How long to wait for the first load

Example: 60000
Default value: 0
animationSpeed Fadeover effect for dom updates

Example: 1000
Default value: 2000
debug Log messages to / console

Example: true
Default value: false
You can’t perform that action at this time.