MagicMirror on the Wall
Tags: codeproject, nerdproject, projects, technology
Published: 2020-08-25 21:13:30

---
title: MagicMirror on the Wall
published: true
date: 2020-08-25 09:00:00 UTC
tags: CodeProject,NerdProject,Projects,Technology
canonical_url: 
---

So lately, my wife and I have been going through a spending a lot of time organizing different elements of our lives. Specifically Covid-19 has created a situation where our lives are very different than what we are used to previously. And it has caused us to re-evaluate the tips and tricks we used to organize our lives.

One such change has been the need to coordinate and communicate more with regard to the family calendar and a variety of other information about our lives. So I decided if we were going to bring back “The family bulletin board”, that I wanted it to integrate with our digital footprint and tools to make life easier.

After doing some research, I settled on [MagicMirror](https://magicmirror.builders/), mainly because of articles like [this](https://smartbuilds.io/smart-mirror-touchscreen-raspberry-pi/). And I had a spare monitor, with a Raspberry Pi 3 lying around the office, so I figured why not. The plan was to implement the initial prototype and get it working in my office, and then invest in something better for my wife to help manage everything.

So I have to admit, this was surprisingly easy to setup. And did not require much in the way of effort. I was even able to automate pushing updates to this device pretty easily. So if you are looking for a cheap option for getting something like this working, I recommend MagicMirror.

Here’s the current state of the PoC:

![](https://lh3.googleusercontent.com/4_qGgrm0fdldoJYyewtKtKo_VW3J6cZ3Fc-snYyvBlL46PF-mNRPOMVVSReFf_CS46ZRLa5yKndCd7I_SF9XuujHrpfqevBQavXFl4Kz-yV8ftLIUlDK6wga7sC11knk41SmzXOe_kiqHukz6DUHbBChoFraFQ-EJzFXEuXo4ICvfYownAs1x20RHcDp8rHOMVIA7HzaphiAVabvMrVgPO5i3groiuhgTVwjoG12Lth22sLNhSwNN9ia6VJ-AxbJ0NOIFLgRVvAgVkmKM36m6H_Z-M7_KU0fcNvB6ROyazFbpxdKEAJROMN4kqKY8nA68gK1TPjo0lL5UH7niSHjO5uyWaDkvpbhuGH9fbbpJQJkoQeoWGZ0sawxRgeRT9hrgMQv2-fpOySETNTd3cmrxYdHdacw1Q74CbT2P6s4kFI2ima03exWgUQ_ucs6Cedmhoa6vMakK0AgCCkw6VPBtFbtULityoQ2HhbIfqIW5wLK01aw1SCKmXwNePZT6VPH7j76qvCcJbjIftjqogTFJO0i2PHlZAmpM7Eagt36ozac_tBAGeHQY5EnXsf-3PARWsCEHlCd-YAWu-k7zAz9z2LiysPGINSY9Vw1GyfeT1c1-TTw7T_iiUmY4KInSqv-qNSgOhFFLey6g6dea9CAuTh_NUD9KnMZxJtNlVVqw7wah0gB9ES6l6FFC94hig=w1270-h952-no?authuser=0)

So for a walk through, I went through the following steps:

- Download [Raspbian](https://www.raspberrypi.org/downloads/raspberry-pi-os/)OS, and flash the Micro SD card using [Etcher](https://www.balena.io/etcher/).  
- Put the Micro SD into the Raspberry Pi and boot it up. From there you will get a step-by-step wizard for configuring wifi and setting up passwords, etc.  
- From there, I executed the manual installation methods found [here](https://docs.magicmirror.builders/getting-started/installation.html#manual-installation).

That was really it for getting the baseline out of the box. From there I had a nice black screen with holidays, date/time, and a few other widgets. From there the next step was to install the widgets I cared about. You can find a list of the 3rd party widgets [here](https://github.com/MichMich/MagicMirror/wiki/3rd-party-modules).

Now I wanted MagicMirror to load up on this monitor without me having to do anything, so I followed the steps [here](https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror). I did make some additional modifications from here that helped to make my life easier.

The one problem I ran into was the process of updating the device. I could have just remoted into the device to execute updates to config files, and other scripts. But for me, this was frustrating, I really want to keep configurations for this kind of stuff source controlled as a practice. So I ended up creating a github private repo for the configuration of my MagicMirror.

This worked fine except for the fact that every time I needed to update the mirror, I had to push a file to the device, and then copy it over and reboot the device.

So instead what I ended update doing was building a CI/CD pipeline that pushes changes to the magic mirror.

So what I did was the following:

- Create a blob storage account and container.
- Create a ADO pipeline for my GitHub repo.
- And added only one task to my repo:

```
- task: AzureCLI@2 inputs: azureSubscription: '{Subscription Name}' scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az storage blob upload --connection-string $BLOBSTORAGE -f configdev.js -c test -n configdev.js'
```

Now whenever I push an update to the master branch, a copy of the config file is pushed directly to blob storage.

Now came the problem of how do I get the device to pull down the new config file. If you look at the instructions about for making Magic Mirror auto start, it mentions an mm.sh file, which I updated to be the following:

```
cd ./MagicMirrorcd configcurl -0 config.dev.js https://...blob url.../config.jscp config.dev.js config.jscd ..DISPLAY=:0 npm start
```

Now with this update the magic mirror will pick up a fresh config on every restart. So all I have to do is “sudo reboot” to make it pickup the new version.

I’m going to continue to build this out, and will likely have more blog posts on this topic moving forward. But I wanted to get something out about the beginning. Some things I’ve been thinking about adding are:

- Examine the different types of widgets
- Calendar integration
- Google Calendar integration
- To Do Integration
- Updating to shut off at 8pm and start up at 6am
- Building ability to recognize when config has been updated and trigger a reboot automatically