Connecting existing equipment with Modbus, MQTT, and APIs
Connect equipment and existing systems with Modbus, MQTT, and APIs. Learn how data mapping, timestamps, outages, and retries affect monitoring and reports.
Meters, sensors, and existing management systems expose different interfaces. Bringing their readings into one dashboard requires a way to identify the source equipment, interpret each value, and determine when it was measured and whether it is still usable. Those details affect alerts, energy reports, and maintenance work.
Modbus, MQTT, and APIs can work together in one system. A gateway might read meters through Modbus and publish the readings to a platform through MQTT. The platform can then send events to an existing management system through an API. Data definitions and failure handling need to remain consistent across that path.
What each interface does
| Interface | Common use | Integration priorities |
|---|---|---|
| Modbus | Read device data points or perform supported writes | Register maps, addresses, data formats, and polling intervals |
| MQTT | Distribute messages from equipment or gateways to subscribers | Topics, payloads, delivery settings, and data timestamps |
| API | Exchange status, events, asset records, or work orders with software | Authentication, field definitions, usage limits, and retries |
Modbus connects device data points
Modbus uses function codes and addresses to specify read and write operations. Modbus RTU and Modbus TCP require different connection settings, while the meaning of a data point comes from the manufacturer’s map. The Modbus Organization’s introduction explains requests, responses, and register mapping.
For each data point, record the equipment model, document version, function code, address, and data format. Check for an offset between the documented register number and the address expected by the driver. For values spanning registers, confirm word order, scaling, and units. Compare a reading with the device display or a known value before reusing the configuration. Schneider Electric’s register documentation illustrates mapping settings; the equipment manufacturer’s documentation determines the mapping for each model.
MQTT distributes equipment messages
MQTT uses a publish/subscribe model: publishers send messages to topics, and a broker distributes them to subscribers. QoS 1 can deliver duplicates. Retained messages can reach new subscribers after the original data was produced. These behaviors are defined in the OASIS MQTT 5.0 specification.
Define a payload that carries the equipment identifier, measurement time, units, and a message identifier. Assign accounts permission to publish or subscribe to specific topics. The application can handle duplicates using the identifier or other agreed unique fields. When displaying retained data, check its original timestamp against the permitted data age and mark stale readings clearly.
APIs connect existing software
An API provides an interface for other programs. For a typical HTTP API, confirm authentication, read and write permissions, field definitions, pagination, usage limits, and versioning. If systems use different equipment identifiers, maintain a mapping so that an event reaches the correct asset or work order.
Retries matter when creating work orders or sending commands. HTTP Semantics on idempotency sets conditions for automatically retrying non-idempotent requests. Use an idempotency key when the API provides one, following its documentation. After a connection failure, a request-status lookup can also help establish whether a record was created before another action is attempted.
Give data from different sources shared definitions
Keep an equipment identifier traceable across the gateway, platform, and work-order system. For each measurement, record its source, field name, value, unit, measurement time, receipt time, and quality status. Preserve the source data and conversion rules so that a report value can be traced back to its origin.
Power readings in W and kW need conversion; power and cumulative energy belong in different fields. Agree on timestamp formats and time zones. When equipment supplies no timestamp, identify the use of receipt time explicitly. Alerts and reports can then distinguish values with different meanings or measurement periods.
Make outages, backfills, and duplicates recognizable
When equipment stops updating, retain the last valid value with its timestamp and display a stale-data or communication status. Record timeouts and failed reads separately from valid zero readings so that alert rules can respond appropriately. Set update intervals and stale-data thresholds around equipment capabilities, connectivity, and operating needs.
For equipment or gateways with offline buffering, confirm capacity, backfill order, and retention periods. Process backfilled data using its original measurement time, and test duplicates and out-of-order arrivals. Functions that count events or create work orders should recognize records they have already processed.
Configure data access and equipment control separately
Begin with read-only access to verify data points, timestamps, and quality states. For equipment control, configure writable points, operating permissions, safety rules, and approval steps. Test failure handling and equipment feedback, including how the system confirms the outcome after a command is sent.
Configure network access, encryption, and authentication according to what the equipment and services support. Restrict endpoints and account permissions. Record who maintains credentials, interface changes, and replacement equipment so that these tasks have an owner during operation.
Start with one complete data path
Choose representative equipment and follow a reading through to a dashboard, alert, or report. Exercise outages, stale data, duplicate backfills, and interface errors alongside normal operation. If events lead to maintenance work orders, the inspection digitization guide can help define assignment, tracking, and closure.
lvsota’s equipment and data integration service connects multi-vendor equipment through Modbus, MQTT, and APIs for energy, storage management, and site operations. Bring an equipment list, interface documentation, sample data, and the monitoring views or reports you need to discuss an integration project.
Explore Equipment and data integration