DB01 Alerts: Webhook and MQTT

Practical guide to receive DB01 alerts via webhook, translate them to MQTT, and visualize them in real time with Node-RED, Grafana, or your own app; decoupled and secure architecture.

domingo, 17 de agosto de 2025 • 4 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Summary

In this article you will learn how to receive edge alerts from the DB01 device via a webhook endpoint, translate those events into MQTT topics, and visualize the data in a simple dashboard using Node-RED, Grafana, or your own application. The basic pipeline is Step 1 DB01 announces BLE packets or a gateway forwards via HTTP Step 2 A minimal webhook server analyzes the event Step 3 The server publishes to an MQTT broker Step 4 A dashboard subscribes and displays alerts in real time

Architecture

Insert the webhook_mqtt_architecture.png architecture image here or use your own graphical documentation to illustrate the webhook to MQTT to dashboard flow

Why separate webhook and MQTT

Webhooks make it easy to expose a public endpoint with HTTPS and authentication and allow direct mapping of event semantics

MQTT offers lightweight fan-out to multiple consumers such as dashboards, mobile applications, and cloud rules

This separation decouples ingestion via webhook from consumption via MQTT so that each part can scale independently

Prerequisites

Have a DB01 beacon and a BLE Wi-Fi or LTE gateway capable of forwarding sensor and alert data via HTTP

A server or virtual machine with Docker or Python or Node environments available

A local MQTT broker such as Mosquitto or a managed service

Optional Node-RED for a quick dashboard

Open ports according to the configuration, for example 1883 MQTT 1880 Node-RED 8080 webhook, or adjust them in the configuration files

Topic and payload design

Use a small and consistent topic scheme to facilitate routing assets/{site}/{device_id}/alerts/{alert_type} assets/{site}/{device_id}/telemetry

Example alert payload fields without quotes

device_id: DB01-ACME-00042 ts: 1733435152 alert: TEMP_LOW temp_c: -12.6 threshold: -10.0 humidity: 68.2 rssi: -63

Example telemetry payload fields without quotes

device_id: DB01-ACME-00042 ts: 1733435152 temp_c: -5.1 humidity: 61.0 light: 12 motion: 0 battery_v: 2.87

Option A example in Python with FastAPI and MQTT publishing

Description: A FastAPI server receives POST to the webhook endpoint, analyzes the JSON body, completes or adds a timestamp, publishes to the alert topic if the body contains the alert field, or publishes to the telemetry topic otherwise

Example commands to install and run pip install fastapi uvicorn paho-mqtt and then uvicorn fastapi_webhook app --host 0.0.0.0 --port 8080

Option B example in Node.js with Express and MQTT

Description: An Express server with body parser receives POST to the webhook endpoint and publishes to the MQTT broker using consistent topics depending on whether the payload includes alert or not

Example commands npm i express body-parser mqtt and node express_webhook.js

Reduced Docker compose example

You can deploy the Mosquitto broker, webhook, and Node-RED on the same compose network by adjusting the MQTT_HOST and SITE environment variables and mapping ports 1883 and 8080 and 1880 as needed

Node-RED dashboard sketch

Add mqtt in nodes for assets/+/+/alerts/# and assets/+/+/telemetry

Parse JSON with a function node and route by msg.topic

Connect to ui_chart ui_text or a custom template to display charts and alerts in real time

Save the flow and deploy to see streaming alerts

Security checklist

Terminate TLS for the webhook using a reverse proxy or cloud load balancer

Sign webhook requests with HMAC to verify integrity and origin

MQTT users and passwords per tenant and ACLs at the topic level

Secret management via environment variables or a secrets service

Rate limiting for abusive IPs and rejection logging

Troubleshooting

If nothing arrives at the MQTT broker, check the webhook logs, verify that the JSON is valid, and that the webhook is receiving requests

If the broker rejects connections, confirm the port and credentials

If the dashboard shows outdated data, avoid using retain for alerts and control the telemetry TTL

If CPU usage is high, disable verbose logging and consider batching telemetry

Where to learn more

Consult the official EELINK website for device families and coverage

About Q2BSTUDIO

Q2BSTUDIO is a custom software and application development company specialized in enterprise solutions. We offer custom software services integrating artificial intelligence for real use cases, managed cybersecurity, and cloud deployments on AWS and Azure. Our services include business intelligence services, Power BI dashboard implementation, and AI agent development to automate processes. We are specialists in AI for businesses and in creating custom applications that combine advanced analytics, machine learning models, and security practices to ensure robust and scalable solutions.

Keywords for positioning

custom applications custom software artificial intelligence cybersecurity cloud services aws and azure business intelligence services ai for businesses AI agents power bi

Contact and services

If you would like Q2BSTUDIO to help you integrate DB01 with your corporate platform or deploy a solution with webhook and MQTT, we can offer personalized analysis, integration development, managed security, and custom dashboards. We offer consulting to integrate artificial intelligence, AI agent implementation, and business intelligence projects with Power BI to improve decision-making.

Final summary

This guide offers you a practical path to receive DB01 alerts via webhook, translate them to MQTT, and visualize them in real time. The decoupled architecture facilitates scalability, and integration with Q2BSTUDIO solutions adds additional value through custom software, artificial intelligence, cybersecurity, and cloud services for a professional and secure deployment

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.