Icon for EMQXIcon for InfluxDB

EMQX and InfluxDB

Integrates withCurated

Overview

EMQX integrates directly with InfluxDB, allowing IoT telemetry data to flow seamlessly from MQTT devices into a time-series database. This is a common pattern for industrial monitoring, smart building, and IIoT applications.

Integration Architecture

IoT Sensors → MQTT → EMQX → Rule Engine → InfluxDB → Grafana
                                    ↓
                              (Line Protocol)

Data Flow:

  1. Sensors publish measurements to EMQX
  2. EMQX Rule Engine extracts and formats data
  3. Data is written to InfluxDB via Line Protocol
  4. Grafana (or similar) visualizes the data

Configuration

EMQX Rule Engine SQL example:

SELECT
  payload.temperature as temperature,
  payload.pressure as pressure,
  clientid as device_id
FROM
  "sensors/+/data"

Then configure InfluxDB action with:

  • Database/bucket name
  • Measurement name
  • Field mappings
  • Tags (for indexing)

Use Cases

  • Industrial Monitoring: Machine telemetry for OEE and condition monitoring
  • Environmental Sensing: Temperature, humidity, air quality tracking
  • Smart Buildings: Energy consumption and HVAC monitoring
  • Predictive Maintenance: Vibration and temperature trend analysis

Benefits

  • No middleware: Direct broker-to-database integration
  • In-flight processing: Filter/transform before storage
  • Scalable: Handles millions of writes per second
  • Reliable: Built-in buffering and retry

Considerations

  • Schema design: Plan InfluxDB schema (measurements, tags, fields) carefully
  • Retention policies: Configure appropriate data retention
  • Batching: EMQX batches writes for efficiency
  • Alternative: For complex preprocessing, use Node-RED between EMQX and InfluxDB