Modbus DIY

Modbus vs MQTT for Home Data: An Honest Comparison

Two very different ways to move data around your home — one asks, one tells. Here's how to choose without the hype.

Godīgs skatījums bez pārdošanas spiedienaReāli protokola faktiCTA uz veikalu, ne uz obligātu pasūtījumu
How to choose: 4 practical steps

How to choose: 4 practical steps

01

Check what's already talking

If your inverter, energy meter, or heat pump left the factory speaking Modbus, that's often reason enough to keep using it — no need to replace comms that already work.

02

Decide who asks the questions

Modbus is a polling model: one master asks each device in turn, on a schedule you control. MQTT flips that — devices publish the moment something changes, through a central broker.

03

Match the model to your project

Building your own sensor network from scratch (ESPHome nodes, Zigbee2MQTT bridges) fits MQTT's push style. Wiring into existing industrial-style gear fits Modbus's ask-and-wait style.

04

Bridge them instead of choosing forever

You don't have to pick one for the whole house. A gateway can poll your Modbus devices and republish their values as MQTT messages, so both live side by side.

What actually differs between Modbus and MQTT

What actually differs between Modbus and MQTT

2

models, one home network

Modbus polls, MQTT publishes — knowing which one you're dealing with explains almost every wiring and software decision that follows.

Modbus: the master asks, the device answers

A Modbus master polls each device in turn using function codes — FC03/FC04 to read registers, FC06/FC16 to write them. A device never speaks unless asked first.

MQTT: devices publish, a broker distributes

In MQTT, devices ('clients') publish a message to a topic on a central broker the instant their state changes; anything subscribed to that topic gets it right away, without asking.

RTU wiring vs. an IP network

Modbus RTU runs over an RS-485 two-wire bus, daisy-chained, with 120Ω termination at each end and every device sharing one baud rate. Modbus TCP and MQTT both ride your existing Ethernet or Wi-Fi network.

Where each one is factory-native

Industrial-style gear — inverters, energy meters, PLCs — has spoken Modbus since 1979 and usually still does out of the box. Modern DIY sensor ecosystems like ESPHome or Zigbee2MQTT bridges speak MQTT natively.

Neither has security switched on by default

Classic Modbus (RTU or TCP) has no authentication or encryption in the base spec — anyone on the bus or network can send a valid command. MQTT brokers can add usernames, passwords, and TLS, but you have to configure it; neither one is safe out of the box.

Options

What smarteg.lv stocks for either path

Whichever protocol your devices already speak, here's what helps you wire it correctly.

  • RS-485 cable and connectors for Modbus RTU wiring
  • 120Ω termination resistors for bus ends
  • DIN-rail enclosures and mounts for panel-based sensors
  • ESPHome-compatible sensors and modules for DIY MQTT setups
  • Practical guides on wiring, addressing, and troubleshooting
FAQ

Frequently asked questions

Is Modbus or MQTT better for a home?

Neither is 'better' — they suit different jobs. Modbus fits devices that already speak it from the factory (inverters, meters); MQTT fits sensor networks you build yourself, like ESPHome or Zigbee2MQTT setups.

Can I use both Modbus and MQTT in the same home?

Yes — a common pattern is a gateway that polls your Modbus devices (RTU or TCP) and republishes their register values as MQTT topics, so everything ends up in one place.

Why does Modbus need a master constantly asking questions?

Modbus is a polling protocol: devices are 'slaves' that only answer when asked. That keeps the bus predictable, but it means your data is only as fresh as your last poll.

Is Modbus RTU wiring hard to get right?

The main pitfalls are simple but strict: every device on the RS-485 bus needs the same baud rate, a unique address (1-247), and 120Ω termination only at the two physical ends of the bus — not at every device.

Is MQTT secure enough for home automation?

MQTT itself has no security switched on by default, but brokers commonly support username/password auth and TLS encryption — same as with Modbus, security is something you configure, not something you get for free.

Not sure which protocol fits your setup?

Browse the wiring gear and sensors in our shop, or read the related guides below before you commit to a protocol.

Request a survey
Related guides

Related guides

Loading...
Back to top