Prerequisites: Local Mosquitto broker, InfluxDB 2.x. Complements Building IoT Workflows with MQTT.
Build an MQTT telemetry pipeline from template #161: when a sensor message arrives, write the payload to InfluxDB for trending and dashboards.
What this template does
- MQTT Sensor Event — subscribes to
sensors/+/telemetry. - Write to InfluxDB — measurement
sensor_readingwith topic tag.
Step 1 — Load the template
- Studio → Templates → search
MQTT Sensor InfluxDB. - Load template #161.
Step 2 — MQTT
- Set broker host/port and topic filter to match your devices.
- Publish a test message:
mosquitto_pub -t sensors/temp01/telemetry -m '{"value":22.5}'
Step 3 — InfluxDB
- Configure URL, token, org, bucket, measurement, and field mapping from
{{payload}}. - Add tags such as
{{topic}}for multi-sensor dashboards.
Step 4 — Activate on-prem
MQTT subscribe requires on-prem Studio or an exported runtime on the gateway PC. Export with Export Runtime to Edge if the broker runs on a factory LAN.
Related tutorials
- Modbus PLC → InfluxDB Logger — poll-based industrial logging.
- MQTT Event — trigger reference.