Home automation edition
Home Assistant News

Reporting the local stack, from radio to automations.

Guide · Projects

Magic Mirror with Home Assistant: how to build one

A smart mirror is a monitor behind two-way glass. The glass reflects the room and the panel shows through it, so text appears to float where the screen is lit and the wall behind it is dark. The software question is separate from the optical one, and it has a settled answer: MagicMirror² runs the display, and Home Assistant feeds it — through a community module that renders your own templates, through MQTT, or through REST calls. There is no official Home Assistant MagicMirror integration; the integrations page at home-assistant.io/integrations/magicmirror/ returns 404. Every working setup is one of the community paths below.

This guide covers what to install, which module to pick for which job, and the four or five details that break builds. It stays on the software side, because the mirror stack is where the surprises are.

Animated demo of MagicMirror 2 running, with clock, calendar, weather and news modules laid out on a dark background
MagicMirror² running its default module layout. Source: MagicMirror² project

What runs on the glass

MagicMirror² is an open source modular smart mirror platform. It is modular in the literal sense: the screen is a set of independent modules — clock, calendar, weather, news — laid out in regions (top left, top right, bottom bar) that you configure in a single JavaScript file. It wraps a local Electron app, which the project describes as "So no more web server or browser installs necessary": the mirror is not a web page in kiosk mode, it is a desktop application that draws to the screen directly. Source: MagicMirror² repository.

The project lives at magicmirror.builders, with documentation at docs.magicmirror.builders, a forum at forum.magicmirror.builders and a Discord at discord.gg/J5BAtvx.

Hardware that is actually supported

This is the first place people go wrong. Electron, the app wrapper, supports Raspberry Pi 2, 3, 4 and 5 only. Pi Zero and Pi 1 are not supported. For those boards upstream suggests running MagicMirror² in server-only mode and pointing your own fullscreen browser at it from something else. Source: requirements.

Two more requirements from the same page: you need the latest full Raspberry Pi OS (a desktop environment is mandatory, because Electron needs one, so Raspberry Pi OS Lite will not work), and Debian "Buster"-based releases are no longer supported. The Node.js version requirement is listed on the release page rather than pinned in the documentation, so check it against the release you install.

For a new build, a Raspberry Pi 5 is the straightforward choice: it is on the supported list and it has headroom for a screen full of modules. Check Raspberry Pi 5 on Amazon for price and stock; the board is widely available from specialist resellers too, usually cheaper.

The optical part, briefly

The stack is one-way mirror glass or acrylic over a monitor. Brightness matters more than resolution: the effect works because the panel is brighter than the reflected room, so a dim screen in a bright hallway reads as a grey rectangle, and a bright screen in a dim hallway reads as text on black. Dim the room or brighten the panel, in that order.

Installing MagicMirror²

The only officially supported install path is the manual one. The old automatic installer was moved out of core into a community repository in early 2020, so ignore any guide that tells you to run it. The manual steps from the documentation:

  1. Install Node.js on the Raspberry Pi.
  2. git clone https://github.com/MagicMirrorOrg/MagicMirror.git
  3. cd MagicMirror
  4. node --run install-mm
  5. cp config/config.js.sample config/config.js
  6. node --run start

Source: installation guide. One gotcha is worth planning around: the install-mm step takes roughly ten minutes on a Pi 3 and roughly twenty-five on a Pi 2, and it prints very little to the terminal while it works. People assume it has hung, kill it, and end up with a half-installed tree. Let it finish.

Wiring Home Assistant to the mirror

Because there is no official integration, the link is made one of three ways: a module that speaks Home Assistant's websocket API, a module that subscribes to MQTT, or a module that exposes an HTTP API for Home Assistant to call. They solve different problems, and a real build often uses two of them.

Option A — MMM-HomeAssistantDisplay (start here)

MMM-HomeAssistantDisplay is the most active of the Home Assistant display modules found: around 130 GitHub stars, last push 2026-03-16. Its design is the reason to pick it. You write a Jinja2 template in the module's config, Home Assistant renders it, and the returned HTML is displayed on the mirror — so every template function, entity attribute and formatting trick you already use in a dashboard is available on the glass, evaluated on the Home Assistant side where the data lives.

It connects over Home Assistant's websocket API, which means state changes appear immediately rather than on a polling interval. It reconnects automatically when the connection drops, and it only re-renders the sections whose watched entity actually changed — worth knowing if you plan six sections on one screen. It can also hide or show itself based on an entity state or a template result, which is the clean answer to "only show the laundry block while the washer is running".

Install: git clone https://github.com/wonderslug/MMM-HomeAssistantDisplay.git into your modules/ directory, then npm install inside it. The default module title is "Home Assistant". It adds custom CSS classes to the module and to each section and embeds Material Design icons, so the output can be styled to match the rest of the mirror.

The connection needs a long-lived access token, created under your Home Assistant profile, then Security, then Long-lived access tokens. Treat that token like a password: it grants API access to your instance, and it is the reason the mirror must not be reachable from the internet.

Option B — MMM-MQTT (protocol-agnostic)

MMM-MQTT (around 63 stars, last push 2026-10-24) subscribes to MQTT topics and shows the payload. It is the right pick when the mirror should not depend on Home Assistant at all, or when your devices already publish to a broker.

Install from your MagicMirror/modules directory: git clone https://github.com/ottopaulsen/MMM-MQTT, then cd MMM-MQTT and npm install. Configuration is a mqttServers[] array with address, port (1883 by default), optional user and password, and optional TLS via ca, cert and key. Each subscription takes a topic plus presentation options: label, suffix, decimals, sortOrder, maxAgeSeconds, row, broadcast and colors thresholds.

maxAgeSeconds is the detail worth stealing for any sensor row: when a value stops updating, the module dims it. On a mirror that runs for months, a stale sensor that still shows a number is worse than no number, and this is a free staleness indicator. Note that Home Assistant publishes state over MQTT only when the MQTT integration is set up and its state topics are configured; the module reads whatever topics you point it at.

Option C — MMM-Remote-Control (control the mirror from Home Assistant)

MMM-Remote-Control (around 605 stars, last push 2026-11-01) is the most-used control module, and it points the other way: it lets other devices drive the mirror. It provides a browser UI plus a RESTful API, so anything that can open a URL can shut the mirror down or hide and show modules. It also ships a PWA mode and can render a QR code on the mirror for phone pairing.

Install: cd ~/MagicMirror/modules, git clone https://github.com/Jopyth/MMM-Remote-Control, cd MMM-Remote-Control, npm ci --omit=dev.

That API is what a Home Assistant rest_command or a dashboard button hits to blank the screen. Home Assistant's rest_command integration is the built-in way to call a URL: it takes url (templatable), method (get, patch, post, put or delete), headers, payload (a template), username and password, timeout (10 seconds by default) and verify_ssl (true by default), and the service appears as rest_command.<service_name>. See the rest_command documentation for the full schema. Point the command at the mirror's LAN address, give it a timeout short enough that a sleeping mirror does not stall an automation, and call it from a script rather than from ten different automations.

Other modules, and why they are not the pick

Three more Home Assistant-adjacent modules turn up in searches, all with lower activity: leinich/MMM-homeassistant-sensors shows Home Assistant sensors directly (around 66 stars, last push 2021-07); ambarusa/MMM-HomeAssistant (around 52 stars, last push 2026-08); and Tom-Hirschberger/MMM-MQTTbridge (around 29 stars, last push 2025-12), which makes the mirror itself an MQTT device in both directions. The last one is interesting if you want Home Assistant to know the mirror's state as well as feed it; the first is effectively unmaintained.

Gotchas

  • Never expose the mirror to the internet. Upstream is explicit: secrets live in config.js, so do not expose MagicMirror² directly. If you need remote access, put it behind a reverse proxy with authentication, HTTPS and strict network access controls. A long-lived Home Assistant token sitting on that machine raises the stakes.
  • Raspberry Pi OS Lite will not work on the panel machine, because Electron needs a desktop environment. Server-only mode on a Pi Zero is the documented workaround, with a separate browser stick driving the screen.
  • Do not interrupt install-mm. Ten to twenty-five minutes of near-silence depending on the board; interrupting it leaves a broken install.
  • There is no integration to wait for. If a guide tells you to add MagicMirror under Devices and services, it is describing a module install badly.

Where this fits in your setup

A mirror is a display surface for the same entities you already watch, so build the data side first. If your dashboards are still ad hoc, start with the Home Assistant dashboard guide. If you have not chosen the machine that runs Home Assistant yet, the trade-offs are in Home Assistant on a Raspberry Pi. And the wider index of Home Assistant guides lives in the Home Assistant section.

FAQ

Can Home Assistant talk to MagicMirror without a cloud account?

Yes. Every route described here runs on your own LAN: the MMM-HomeAssistantDisplay module opens a websocket to your Home Assistant instance, MMM-MQTT subscribes to your broker, and MMM-Remote-Control exposes a local HTTP API that rest_command can call. None of them needs Nabu Casa or any third-party service.

Which MagicMirror module should I use for Home Assistant sensors?

Use MMM-HomeAssistantDisplay if you want Home Assistant to do the formatting: it renders Jinja2 templates on the Home Assistant side and pushes the HTML to the mirror over the websocket API. Use MMM-MQTT if your devices already publish to MQTT and you would rather keep the mirror independent of Home Assistant.

How do I make the mirror show an alert only when something is happening?

MMM-HomeAssistantDisplay can hide or show itself based on an entity state or a template result, so a washer-done block can appear only while the washer is running. With MQTT you publish to a topic only when the alert is active, and leave the topic empty otherwise.

Can I run a smart mirror on a Raspberry Pi Zero?

Not with the standard install. MagicMirror2 wraps the display in Electron, which upstream supports only on Raspberry Pi 2, 3, 4 and 5. For a Pi Zero or Pi 1 the documented workaround is server-only mode, where the Pi runs MagicMirror2 and a separate fullscreen browser drives the panel.

How do I blank the mirror or switch scenes from Home Assistant?

Install MMM-Remote-Control on the mirror and give Home Assistant a rest_command that calls its API. A dashboard button or an automation can then hide and show modules, or shut the mirror down, with a single HTTP request on your LAN.

Is it safe to expose MagicMirror2 to the internet for remote access?

No. Upstream warns that secrets live in config.js and says never to expose the mirror directly to the internet. If you need remote access, put it behind a reverse proxy with authentication, HTTPS and strict network access controls.

We publish a daily brief on Home Assistant, Zigbee, Z-Wave and Matter releases. Read the latest.

As an Amazon Associate, HA News earns from qualifying purchases.

Primary sources
MagicMirror² installation guide; MagicMirror² requirements; MMM-HomeAssistantDisplay; MMM-MQTT; MMM-Remote-Control; Home Assistant rest_command