Simple sensor-driven notifications in Discourse via Webhooks or MQTT?

AI-generated summary

In a support thread titled “Simple sensor-driven notifications in Discourse via Webhooks or MQTT?”, aria_12 seeks advice on integrating IoT sensors (e.g., motion or temperature) with Discourse to automatically post or message when thresholds are crossed. Inspired by an ESP32 + MQTT motion detection tutorial, they ask for lightweight, non-plugin solutions using webhooks or MQTT. pmusaraj recommends using scoped API keys to create posts via HTTP requests from any IoT platform, calling it a cool project. tobiaseigen follows up asking if aria_12 got it working, then suggests an alternative: configuring Discourse to accept incoming emails from IoT devices to auto-create topics or group messages as documented here tobiaseigen. The discussion centers on minimal, practical integrations using existing Discourse features rather than custom plugins.

Hi everyone, I’m trying to build a small sensor-to-Discourse integration: like having motion sensors or temperature sensors publish data to a Discourse topic (or trigger a post/private message) when certain thresholds are crossed. I was inspired by this article on using ESP32 + MQTT for motion detection and email alerts:

https://www.theengineeringprojects.com/2022/03/iot-based-motion-detection-with-email-alert-using-esp32.html

I also looked at Discourse’s webhook and plugin APIs, and a few community threads on MQTT bridges with Discourse. I’m curious: what’s the easiest way to send external IoT data into Discourse in a clean, minimal way (without building a full plugin)? Any known lightweight approaches or example setups people have used?

Your best bet is Use scoped API Keys

Once you have a key, you can make requests to Discourse that create posts from whatever platform/language you like on your IoT setup.

Sounds like a cool project, good luck!

Hi Aria! This looks interesting. Were you able to get it working?

It occurs to me you could also just have your IoT send an email to Discourse.