IntegrationNode-RED Modbus Example
Threshold Alert — Notify When a Register Exceeds a Limit
Trigger an alert when a Modbus register value crosses a threshold — an email, a Telegram message, or a webhook. This example monitors a temperature register and sends an alert when it exceeds 80°C, with a cooldown to avoid alert storms.
What you need
- Node-RED v3+
- node-red-contrib-modbus installed
- An email or HTTP endpoint to receive the alert
Flow Overview
Poll every 30s → Read reg 0 → Scale (/10) → threshold > 80?
│
5 min cooldown OK?
│
Send webhook POST
"ALERT: 82.4°C"
Node-RED Flow JSON
To import: open Node-RED → Hamburger menu → Import → paste this JSON → Deploy.
Expected Output
// Only triggered when temp > 80°C and cooldown has passed: POST https://your-webhook-url.example.com/alert Body: "ALERT: Temperature 82.4°C exceeds 80°C limit"
Common Gotchas
- Use context.get/set (not flow or global context) for per-node state so multiple alert nodes don't share cooldown.
- Returning null from a function node drops the message — essential for the no-alert path.
- Set a cooldown (5 minutes above) to avoid alert storms when temperature oscillates around the threshold.
- Consider a hysteresis band: alert when > 80, clear when < 75 — add a second comparison for the 'all clear'.
- For Telegram: use node-red-contrib-telegrambot instead of http request for richer message formatting.
Same in ModPackQT — in 30 seconds
ModPackQT Signal Bots do exactly this — monitor register values, apply conditions, and trigger webhooks, emails, or MQTT messages. Configure the threshold in the bot editor, no coding required.
Was this example helpful?
More Integration examples