selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitLab

Self-host mqtt2discord

v1.0.0

MQTT-to-Discord webhook bridge for topic notifications

ReleaseOpen Source
docker run --rm -it --name $app -v "$PWD/src/config.json":/usr/src/bot/config.json registry.gitlab.com/opensource-auke/mqtt2discord/mqtt2discord:latest
Updated3 years ago
Setup difficultyModerate
Requires
MQTT Broker
Docker
registry.gitlab.com/opensource-auke/mqtt2discord/mqtt2discord

What is mqtt2discord?

mqtt2discord is a small Python bridge for homelab and IoT setups: it subscribes to MQTT topics on a broker you point it at and forwards each payload into a Discord channel using a channel webhook, which means you never register a Discord bot. Routing is many-to-many — you can add as many topic entries as you like, send several topics into the same channel, or fan one topic out to several channels, and each entry can optionally push a startup message. A heartbeat option can publish a JSON health summary (version, activity, send/receive counters) to a topic at a chosen interval, with an optional timezone for those timestamps. To run it yourself you copy config.json.sample to src/config.json and fill in broker host, port, optional username/password, timezone, heartbeat and topics; then either install the requirements with pip3 and run main.py, or use the container image from the GitLab registry (also mirrored on Docker Hub) with docker run, docker compose or Docker Swarm. The latest release is v1.0.0 from May 2022 and the repository's last activity is October 2023, and no licence file or licence statement is given in the sources.

mqtt2discord alternatives

Should you self-host mqtt2discord?

mqtt2discord scores 43/100 on selfhost.directory (how scoring works) and ranks #5 of 6 in Bridges.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available.

Its closest alternative on selfhost.directory is Matrix-Telegram bridge (65/100, 1 765 stars). It scores higher overall, so compare the two before you pick. See mqtt2discord vs Matrix-Telegram bridge side by side.

Features

  • Heartbeat health-check
  • MQTT authentication
  • MQTT to Discord message relay
  • Multiple topics to multiple channels
  • Per-channel startup message
  • Timezone for heartbeat timestampsDocumented as available from version 1.0.1
  • Webhook-based delivery (no bot registration)

How to install mqtt2discord

Install mqtt2discord with Docker

docker run --rm \
  -it \
  --name $app \
  -v "$PWD/src/config.json":/usr/src/bot/config.json \
  registry.gitlab.com/opensource-auke/mqtt2discord/mqtt2discord:latest

Also documented for Docker compose (`docker compose up -d`) and Docker Swarm with the config passed as a swarm config.

How to configure mqtt2discord

  • hostHostname or IP number of the MQTT server.
  • portPort number used by the MQTT server.

    values: Usually 1883

  • usernameUser name for the MQTT server; optional depending on your MQTT server configuration.
  • passwordOnly required if username is set.
  • timezoneOptional timezone, used for the time in the heartbeat messages (documented from version 1.0.1).

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…