Energy

How to connect a Modbus electricity meter to a cloud dashboard

By the Vera Automation engineering team · Updated

Short answer

To connect a Modbus electricity meter to a cloud dashboard, wire the meter’s RS-485 port (Modbus RTU) or Ethernet port (Modbus TCP) to an industrial gateway, configure the gateway to poll the meter’s registers for the values you need, and have it publish those values over MQTT or HTTPS to a time-series database that a dashboard reads from. The gateway should buffer readings locally so no data is lost when the connection drops.

What you need

  • A meter with a Modbus port — most commercial smart meters and power analysers have RS-485 (Modbus RTU) or Ethernet (Modbus TCP).
  • The meter’s register map from the manufacturer’s manual: which register holds kWh, kW, voltage and so on, and in which data format.
  • An industrial gateway (sometimes called an edge device or data logger) that speaks Modbus and can connect to the internet over Ethernet, Wi-Fi or GSM.
  • A cloud endpoint: an MQTT broker or HTTPS API, a time-series database, and a dashboard or reporting tool.

Step 1: Wire the meter

For Modbus RTU, connect the meter’s A/B (sometimes labelled D+/D−) terminals to the gateway’s RS-485 port using twisted-pair cable, daisy-chaining multiple meters on the same pair. Terminate both ends of a long bus with 120 Ω resistors and keep the cable away from power conductors. For Modbus TCP, connect the meter to the site network like any other Ethernet device and give it a fixed IP address.

Each meter on an RS-485 bus needs a unique slave address (1–247), and every device must use the same serial settings — typically 9600 or 19200 baud, 8 data bits, and the parity and stop bits specified by the meter.

Step 2: Configure the registers

In the gateway, add each meter and list the registers to read. Typical values for energy monitoring are:

ValueWhy it mattersTypical format
Active energy import (kWh)Consumption and billing32-bit float or 32/64-bit integer
Active power (kW)Live load32-bit float
Apparent power (kVA)Demand charges32-bit float
Reactive energy (kvarh)Power factor32-bit float or integer
Voltage and current per phaseSupply quality and balance32-bit float

Step 3: Choose how often to poll

Energy counters (kWh) only need to be read every few minutes and are then aggregated into 15- or 30-minute intervals. Live values such as kW can be polled every few seconds if you want a responsive dashboard. On RS-485 every request shares one bus, so dozens of meters polled every second can overload it — poll what you need, as often as you need it.

Step 4: Send the data to the cloud

Most gateways publish readings using MQTT — a lightweight publish/subscribe protocol designed for unreliable links — to a broker over TLS (usually port 8883). Others post JSON over HTTPS. Either way the connection should be outbound-only from the site, so no ports are opened on the site firewall. Configure store-and-forward so readings are buffered on the gateway during outages and uploaded when the link returns.

Step 5: Store, validate and display

A service subscribes to the incoming data and writes it to a time-series database such as TimescaleDB or InfluxDB. Before anything is reported, validate it: check for gaps, counter resets, impossible jumps and meters that have stopped reporting. The dashboard — Grafana, Power BI or a custom web app — then reads from the database to show consumption per interval, demand peaks and trends, and to raise alerts.

Common mistakes to avoid

  • Reporting the raw kWh counter instead of the difference between readings.
  • Ignoring counter rollovers or meter replacements, which create huge false spikes.
  • Using the gateway’s clock without time synchronisation — interval data must be timestamped accurately.
  • Leaving the default password on the gateway or exposing it directly to the internet.

If you would rather not build this yourself, see our energy monitoring and industrial IoT integration services.

FAQ

Frequently asked questions

Can I read a Modbus meter without a gateway?

A PC or server with an RS-485 adapter can read meters directly, but an industrial gateway is more reliable on site: it is built for electrical panels, buffers data during outages and handles the cloud connection securely.

How many meters can go on one RS-485 bus?

Modbus allows up to 247 addresses, but a standard RS-485 segment supports 32 unit loads; more devices need low-load transceivers or repeaters. In practice, polling speed usually limits a bus before addressing does.

Does it matter whether the meter is Modbus RTU or TCP?

Not to the dashboard. The gateway handles the difference. RTU needs RS-485 wiring; TCP needs a network connection. See Modbus RTU vs Modbus TCP.

Next step

Tell us what’s slowing you down.

Describe the process, the system or the site. We’ll come back with a clear, practical view of what can be automated — and what it would take.