Use Hardware as Trigger for APIs (via Zapier)

Fokke Zandbergen
Nov 11, 2016 · 4 min read
Image for post
Image for post

MQTT is a machine-to-machine (M2M) protocol heavily used for the Internet of Things (IoT) because it is an extremely lightweight publish/subscribe messaging transport. The Things Network as well uses MQTT to exchange messages between devices and their online backends — or applications as we call them.

The Rise of APIs

Connecting Passive APIs

Fortunately, services like Zapier and IFTTT allow you to connect APIs even if they don’t have direct integrations with each other. Services only need to integrate with them, either by providing passive polling endpoints or actively calling webhooks on different events. These can then be used as triggers to make requests to pretty much any other APIs.

Connecting MQTT and HTTP APIs

Node-RED

IFTTT Maker Channel

Introducing MQTT2HTTP

Here’s an example:

Image for post
Image for post
  • Click Deploy.
  • Create a Zappier Zap with a Catch Hook as trigger.
    Here’s an example my test result after setting the Pick off a Child Key option to message:
Image for post
Image for post
  • Add one or more actions using the data retrieved via the hook.
    I used Create Spreadsheet Row to store the sensor data:
Image for post
Image for post
  • Forget about the MQTT2HTTP process and enjoy endless automation!
    Here’s how my spreadsheet looked a few minutes later:
Image for post
Image for post

Future Plans

Of course I still hope Zapier and IFTTT will someday add native support for MQTT and other protocols as trigger and action.

If you use The Things Network, then don’t sweat it. We’re working on some very cool stuff to make this even easier!


For more blog posts on automation and other stuff that interests me: fokkezb.nl

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store