Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
August 21, 2022 23:38
June 16, 2021 11:16
November 21, 2022 02:48
June 3, 2021 18:54
November 21, 2022 02:48
April 12, 2018 19:19
October 17, 2021 16:23
December 7, 2022 14:55


To warn, alert, or notify.


mqttwarn - subscribe to MQTT topics and notify pluggable services.


mqttwarn subscribes to any number of MQTT topics and publishes received payloads to one or more notification services after optionally applying sophisticated transformations.

A picture says a thousand words.


mqttwarn comes with over 70 notification handler plugins for a wide range of notification services and is very open to further contributions. You can enjoy the alphabetical list of plugins at mqttwarn notification services.

On top of that, it integrates with the excellent Apprise notification library. Apprise notification services has a complete list of the 80+ notification services supported by Apprise.


The program, running as a service, subscribes to any number of MQTT topics (including wildcards) and publishes received payloads to one or more notification services, including support for notifying more than one distinct service for the same message.

Notifications are transmitted to the appropriate service via plugins. mqttwarn provides built-in plugins for a number of services and you can easily add your own.

A more detailed blog post about what mqttwarn can be used for is available at How do your servers talk to you?.

For example, you may wish to submit an alarm published as text to the MQTT topic home/monitoring/+ as notification via e-mail and Pushover.


The handbook is the right place to read all about mqttwarn's features and service plugins.



pip install --upgrade mqttwarn

You can also add support for a specific service plugin:

pip install --upgrade 'mqttwarn[xmpp]'

You can also add support for multiple services, all at once:

pip install --upgrade 'mqttwarn[apprise,asterisk,nsca,desktopnotify,tootpaste,xmpp]'

Container image

For running mqttwarn on a container infrastructure like Docker or Kubernetes, corresponding images are automatically published to the GitHub Container Registry (GHCR).


To learn more about this topic, please follow up reading the Docker handbook.


First, create configuration and custom Python starter files mqttwarn.ini and and edit them to your taste:

# Create configuration file
mqttwarn make-config > mqttwarn.ini

# Create file for custom functions
mqttwarn make-samplefuncs >

If you are using PowerShell on Windows 10, you may find the files to be written using the UTF-16 charset encoding. However, mqttwarn works with UTF-8. In order to switch to UTF-8, please invoke this command beforehand:

$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'


Running interactively

Just launch mqttwarn:

# Run mqttwarn

To supply a different configuration file or log file, optionally use:

# Define configuration file
export MQTTWARNINI=/etc/mqttwarn/acme.ini

# Define log file
export MQTTWARNLOG=/var/log/mqttwarn.log

# Run mqttwarn

Running notification plugins

For debugging, or other purposes, you might want to directly run an individual notification plugin without the dispatching and transformation machinery of mqttwarn.

We have you covered. To launch a plugin standalone, those commands will give you an idea how to pass relevant information on the command line using JSON:

# Launch "log" service plugin
mqttwarn --plugin=log --options='{"message": "Hello world", "addrs": ["crit"]}'

# Launch "file" service plugin
mqttwarn --plugin=file --options='{"message": "Hello world\n", "addrs": ["/tmp/mqttwarn.err"]}'

# Launch "pushover" service plugin
mqttwarn --plugin=pushover --options='{"title": "About", "message": "Hello world", "addrs": ["userkey", "token"], "priority": 6}'

# Launch "ssh" service plugin from the command line
mqttwarn --plugin=ssh --config='{"host": "", "port": 22, "user": "foo", "password": "bar"}' --options='{"addrs": ["command with substitution %s"], "payload": "{\"args\": \"\"}"}'

# Launch "cloudflare_zone" service plugin from "mqttwarn-contrib", passing "--config" parameters via command line
pip install mqttwarn-contrib
mqttwarn --config='{"auth-email": "foo", "auth-key": "bar"}' --options='{"addrs": ["0815", "", ""], "message": ""}'

# Submit notification to "ntfy", using Apprise service plugin.
mqttwarn --plugin=apprise \
    --config='{"baseuri": "ntfy://"}' \
    --options='{"addrs": [], "title": "Example notification", "message": "Hello world"}'

Also, the --config-file parameter can be used to optionally specify the path to a configuration file.

Running as system daemon

Running in a development sandbox

For hacking on mqttwarn, please install it in development mode.


Thanks to all the contributors of mqttwarn who got their hands dirty with it and helped to co-create and conceive it in one way or another. You know who you are.

Project information


These links will guide you to the source code of mqttwarn and its documentation.


You will need at least the following components:

  • Python 3.x or PyPy 3.x.
  • An MQTT broker. We recommend Mosquitto.
  • Some more Python modules to satisfy service dependencies defined in the file.


We are always happy to receive code contributions, ideas, suggestions and problem reports from the community.

So, if you'd like to contribute you're most welcome. Spend some time taking a look around, locate a bug, design issue or spelling mistake and then send us a pull request or create an issue_.

Thanks in advance for your efforts, we really appreciate any help or feedback.

There are also some extensions to mqttwarn not included in the core package. Yet, they are bundled into another package, mqttwarn-contrib, see also community contributions to mqttwarn.


This software is copyright © 2014-2022 Jan-Piet Mens and contributors. All rights reserved.

It is and will always be free and open source software.

Use of the source code included here is governed by the Eclipse Public License 2.0, see LICENSE file for details. Please also recognize the licenses of third-party components.


If you encounter any problems during setup or operations or if you have further suggestions, please let us know by opening an issue on GitHub. Thank you already.




mqttwarn is currently undergoing some refurbishment and will also be ported to Python 3 during that phase. You are welcome to participate!

We outlined the tasks for the next releases within the backlog. They might be transferred into GitHub issues progressively, if applicable.

Legal stuff

"MQTT" is a trademark of the OASIS open standards consortium, which publishes the MQTT specifications.

Have fun!