MaMi - Magic Mirror
Aaaand… after a long, tiring, but exciting process, we have built a magic mirror. Hang on a second… Your magic mirror in not magic yet. So… let’s blow some magic into MaMi.

How to build the magic mirror

After we have hardware built for our magic mirror, now  make sure your electrics are connected. Safely connected. We have just a single power supply cable coming in and it is connected to the chocbox. Chocbox splits power into two sources – for both LED and the monitor. If you’ve bought a right monitor, it has a USB connection, which you can use to provide power to the Raspberry Pi. We have already connected LEDs here and the Raspberry Pi has been connected to the monitor through HDMI.


Here it goes, beautiful Raspbian OS. Keep moving, we are close!

Now, open the terminal clone my Github repo.

$ git clone

And… come in to the world of magic:

$ cd mcmagicmirror

Magic Mirror uses Mysql to persist data. To run Mysql we use docker and docker-compose. Install Docker first

$ curl -sSL | sh

Luckily, python is installed in Raspbian by default. So we have pip in place already. To install docker-compose we use pip:

$ pip install docker-compose

Run Mysql

$ sudo docker-compose up

Here we go… We have database up and running.

Leave this tab open, please, and open another one. Now let’s try to start application

$ ./

And it failed… I know… It is not perfect… Yet! So, next, we need to insert configuration data for the dashboard. Open internet browser and type:

http://localhost:8000/admin/   (don’t forget slash at the end!)

Login using credentials with username: admin, password: mcadmin and open “Config” page. There you need to set up:

  • tfl.key – register for it at TFL API portal
  • – TFL API portal, same as above
  • openweather.key – register at open weather API
  • newsapi.key – register at news API
  • national_rail.station_code – find your station code at National Rail page
  • nationalrail.token – Trains live data comes from National Rail. Register here to get your token
  • apple.password – icloud password to display your calendar. You need to disable two factor authentication.
  • – apple id to display your calendar. Same as above

Another part of configuration is in the file ‘config.ini’.

  • icloud.calendar.days_to_display – number of how many days would you like to see in the calendar.

You have already registered at news API.  You can get the news sources you want to see in the dashboard there. It is possible to add multiple sources separated by coma. For ex. “the-sport-bible,bbc-sport”. You can set whatever you want for world, technology and sport news. Additionally, you can set how many items you would like to see in total.

  • tfl.bus.exclude=235 – it is possible to exclude some buses which are not relevant for you.

Now let’s make it accessible just from home wifi. To get the network interfaces defined, type:

$ ifconfig

Then find ‘inet’ at ‘wlan0’ section and this is your LAN IP. Now open the file ‘mcMagicMirror/’. Add LAN IP to allowed hosts:

Mirror application is accessible in your wifi zone now.

Configuration is done. Now if you just run:

$ python3 runserver

Open ‘’ in your browser and get your dashboard. In order to have a full screen you can use a browser plugin.

Quick user guide

You can access the admin page from a phone, laptop or any device  in your WIFI zone. Just use the LAN IP we found out above. You can hit these URLs(you can guess what they do):

  • http://<YOUR.LAN.IP>:8000/turn-on-led
  • http://<YOUR.LAN.IP>:8000/turn-off-led
  • http://<YOUR.LAN.IP>:8000/disable-alarm

Alarm clock

As we know MaMi has an amazing alarm clock. If you go to admin page we talked before, in the Dashboard section click “config”. Here you can set:

  • alarm.time – it enables alarm clock. When the time comes the mirror enables youtube playlist and LED lights. It gets back to normal once the playlist is finished.
  • youtube.playlistId – playlist id you want to have as your alarm clock playlist. For ex.:, the ID is ‘PL5SddC9I_hiFIFwngP44c6uEz6roo7BHW’


If you go to admin page we talked before, in the Dashboard section click “notes”. You can keep anything you want here. I use it for my english vocabulary.

Steps to build Magic Mirror

What we did:

  1. Found out what are the features and motivation under the project here.
  2. Built hardware – the mirror and electrics here.
  3. Added LED lights here.
  4. Installed software for mirror to become magical here.

Congratulations, we have built the magic mirror – the beauty which is useful and fits into modern home design.

MaMi - Magic Mirror