Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


MagicMirror Module to control a led strip attached to a Raspberry Pi


This module is specifically meant for the Raspberry Pi system, using SPI and a LPD8806 or WS2801 LED strip. It may be compatible with other LED strips, but this has not been tested.

Buy the LPD8806 LED Strip here and learn how to connect it here

If using Raspbian, you will need to enable SPI:

sudo raspi-config

then navigate to Advanced options and enable SPI

Module installation

Clone the module and npm install:

cd ~/MagicMirror/modules
git clone
cd MMM-PiLights
npm install

Add the module config to ~/MagicMirror/config/config.js

modules: [
        module: 'MMM-PiLights',
        config: {
            ledCount: 64,
            type: 'ws2801', // 'ws2801' or 'lpd8806'
            bus: 0, 
            device: 0,
            brightness: 1.0 // between 0.0 and 1.0

Module Configuration Options

Option Type Default Description
ledCount Integer 64 Number LEDs on your strip
type String ws2801 The LED strip type, either 'ws2801' or 'lpd8806'
bus Integer 0 The SPI bus number for your LED strip
device Integer 0 The SPI device number for your LED strip
brightness Float 0.0 The LED strip brightness (between 0.0 and 1.0)

Trigger from another module

If you're developing a module and want to trigger a light sequence, here's an example of what you'd use in your module:

this.sendNotification('PILIGHTS_SEQUENCE', 'blue_pulse');

My other MagicMirror module is able to trigger light sequences with notifications: MMM-IFTTT

Trigger from a endpoint

The GET endpoint is pretty simple:


From the command line:

curl -X GET "http://yourmagicmirror/PiLights?sequence=blue_pulse"

Available Sequences

  • white_pulse
  • blue_pulse
  • lightblue_pulse
  • red_pulse
  • green_pulse
  • orange_pulse
  • pink_pulse

More to come later.


MagicMirror Module to control a led strip attached to a Raspberry Pi




No releases published


No packages published

Contributors 4