Skip to content

MQTT Examples

Brian Wente edited this page Aug 11, 2026 · 1 revision

MQTT Examples

Enable the optional MQTT transport:

transports: {
  mqtt: {
    enabled: true,
    url: "mqtt://127.0.0.1:1883",
    topic: "messagecenter/messages",
    username: "",
    password: ""
  }
}

Home Assistant can publish the same normalized schema used by REST:

action: mqtt.publish
data:
  topic: messagecenter/messages
  payload: |-
    {
      "id": "storage-warning",
      "type": "system.storage",
      "source": "home-assistant",
      "title": "Storage running low",
      "body": "The mirror has less than 10% free space.",
      "urgency": "attention",
      "retention": "untilAcknowledged"
    }

MQTT and REST have identical deduplication, retention, expiration, and attention behavior. Keep broker credentials in private MagicMirror configuration and do not commit them to Git.

Clone this wiki locally