When Giovanni mentioned Pushover recently I was sold because of its support for iOS and Android. I had been using Prowl and a bit of NMA, but was unhappy with the distinct interfaces to those services. I quickly assembled a Python program to push notifications from MQTT to Pushover for my phone call detection in openHAB, and I thought "that's it". I was wrong.


A few hours after I'd finished, Ben modified the code to create similar programs: one for sending out notifications from MQTT via SMTP, another to notify XBMC. We then decided to consolidate these targets into a single program, and thought "that's it". We were wrong. ;-)

One thing led to another, and during a three hour drive home on Friday I dreamed up something better and more flexible. In a literal all-night session I created mqttwarn which, beware, has meanwhile mutated into a feature-packed monster.

mqttwarn subscribes to any number of MQTT topics (with wildcards) and hands incoming messages off to plugins you configure to handle them. For example, you could have a topic monitor/home which sends alerts to your e-mail address, and another called phone/calls which notifies your smartphone via Pushover.

Notifications are sent to targets. A target is a combination of a service (e.g. Twitter, Pushover, SMTP, XBMC, etc.) and an "account" on that service. So, for example, suppose you wish to notify missed phone calls to yourself and your spouse, mqttwarn will do that. You could, at a later stage, also decide to log those to a file; no problem.

mqttwarn will also attempt to decode incoming messages from JSON. If that succeeds, you can transform the message before it's sent out. This allows us, for example, to interesting notifications for OwnTracks (formerly MQTTitude).

There's a wee bit of common ground between mqttwarn and Node-RED; With appropriate JavaScript knowledge you'd probably slap up something similar in no time. I couldn't.

Do have a look at mqttwarn; I hope you enjoy it.

PS: at this point in time, I'm obsoleting all previous MQTT to "insert-something-here" I've ever written. :-)

See also:


blog comments powered by Disqus