How do I add a Modbus device to Home Assistant?
Updated 10 November 2026
Home Assistant reads Modbus devices from a modbus: block in
configuration.yaml. Writing that block by hand means looking up every register address, data type, scale and
word order. The free Home Assistant generator writes it for you from the
verified register-map library: pick the device, tick the registers you want, enter the IP address and unit id, copy the
result into configuration.yaml, and restart Home Assistant.
This guide uses an Eastron SDM630 power meter as the example. Any device in the register-map library works the same way. In the pictures, each numbered coloured circle matches a numbered step below it.
Before you start
- Home Assistant is running and you can edit
configuration.yaml(the File editor add-on, Samba, or SSH all work). - The Modbus device is reachable: for Modbus TCP you know its IP address; for a serial (RS-485) device it is wired to a USB adapter on the Home Assistant machine.
- You know the device's unit (slave) id. The factory default is often 1; the baud rate and parity guide covers finding it.
Step 1. Pick the device

- 1 (orange circle) Choose the manufacturer from the first list.
- 2 (blue circle) Choose the model. The register map loads straight away.
Can't find your device? It isn't in the library yet. You can still use the frame builder and decoder and the word-order finder to work out its registers by hand.
Step 2. Tick the registers you want

- 3 (green circle) Type in the search box to narrow a long list, for example voltage or energy.
- 4 (pink circle) Starter set ticks the handful of values the library recommends. Good for a first test. All readable ticks everything you can read; None clears the list.
- 5 (purple circle) Tick or untick single registers with the checkbox on each row.
- 6 (red circle) The counter shows how many registers are selected.
Start small. Every ticked register becomes a sensor that Home Assistant asks for every 30 seconds by default. Hundreds of sensors on a slow serial line will crawl; see the guide to making polling faster.
Step 3. Say how Home Assistant reaches the device

- 1 (orange circle) Link. Choose Modbus TCP for an Ethernet device or gateway, or Serial RTU for RS-485 on a USB adapter.
- 2 (blue circle) Device IP address. The address of the device or gateway on your network.
- 3 (green circle) TCP port. Almost always 502. Leave it unless the manual says otherwise.
- 4 (pink circle) Unit / slave id. The device's Modbus address, 0 to 255.
For a serial device the same box asks for the serial port (for example /dev/ttyUSB0 on Linux or
COM3 on Windows), baud rate and parity. The library fills in the device's factory defaults where
the manual states them.
The last list, Home Assistant unit-id key, can stay on slave, which every Home Assistant version accepts.
Choose device_address only if you want the newer spelling.
Step 4. Copy the file

- 1 (orange circle) This is your finished
modbus:block. Scroll through it if you like: every sensor has its address, data type, scale, units and word order. - 2 (blue circle) Copy puts it on your clipboard.
- 3 (green circle) Download file saves it as a
.yamlfile instead.
Step 5. Put it into Home Assistant
- Open
configuration.yaml(Settings → Add-ons → File editor, if you use that add-on). - Paste the block at the bottom of the file.
If you already have a
modbus:section, do not add a second one. Paste only the- name: ...item (everything under the firstmodbus:line) into your existing list. - Check the file: Developer tools → YAML → Check configuration. Fix anything it reports before continuing.
- Restart Home Assistant: Developer tools → YAML → Restart.
- Find your values: Settings → Devices & services → Entities, then search for the register name (for example Phase 1 current).
The screens inside Home Assistant differ a little between versions, so this guide doesn't show them. The block itself is checked against Home Assistant's own configuration validator, and its decoding was compared with Home Assistant's own code, but we have not run it on every Home Assistant release. Try it on a test setup first.
If something is wrong
| What you see | Likely cause | What to do |
|---|---|---|
| Sensors say unavailable | No answer from the device | Check IP, port, unit id, wiring and baud rate. Look in Settings → System → Logs and search for modbus. |
| Numbers are far too big or too small | Scale | The generator sets scale from the register map. If the manual for your firmware differs, edit the scale: line. The calibration guide shows how to work it out. |
| Numbers look random or huge | Word order | Use the word-order guide to find the right swap: value. |
| Every value is off by one register | Address style | The generator writes 0-based wire addresses, which is what Home Assistant expects. See why addresses are off by one. |
| Home Assistant refuses to start | A second modbus: section, or a paste with wrong indentation | Keep a single modbus: key and keep the indentation exactly as generated. |
The file only reads values. Writable registers are listed in a comment at the bottom; to change one, use
Home Assistant's modbus.write_register action, and read
is it safe to write to Modbus? first.