Easy Modbus Register maps →

How do I add a Modbus device to Home Assistant?

Updated 10 November 2026

Short answer

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

Step 1. Pick the device

Choosing a manufacturer and model in the Home Assistant generator
Step 1: choose the manufacturer, then the model.
  1. 1 (orange circle) Choose the manufacturer from the first list.
  2. 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

The register list with checkboxes and the Starter set button
Step 2: choose which values Home Assistant should read.
  1. 3 (green circle) Type in the search box to narrow a long list, for example voltage or energy.
  2. 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.
  3. 5 (purple circle) Tick or untick single registers with the checkbox on each row.
  4. 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

The connection settings: link type, IP address, port and unit id
Step 3: link type, address and unit id.
  1. 1 (orange circle) Link. Choose Modbus TCP for an Ethernet device or gateway, or Serial RTU for RS-485 on a USB adapter.
  2. 2 (blue circle) Device IP address. The address of the device or gateway on your network.
  3. 3 (green circle) TCP port. Almost always 502. Leave it unless the manual says otherwise.
  4. 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

The generated Home Assistant configuration with Copy and Download buttons
Step 4: copy or download the finished configuration.
  1. 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. 2 (blue circle) Copy puts it on your clipboard.
  3. 3 (green circle) Download file saves it as a .yaml file instead.

Step 5. Put it into Home Assistant

  1. Open configuration.yaml (Settings → Add-ons → File editor, if you use that add-on).
  2. 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 first modbus: line) into your existing list.
  3. Check the file: Developer tools → YAML → Check configuration. Fix anything it reports before continuing.
  4. Restart Home Assistant: Developer tools → YAML → Restart.
  5. 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 seeLikely causeWhat to do
Sensors say unavailableNo answer from the deviceCheck IP, port, unit id, wiring and baud rate. Look in Settings → System → Logs and search for modbus.
Numbers are far too big or too smallScaleThe 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 hugeWord orderUse the word-order guide to find the right swap: value.
Every value is off by one registerAddress styleThe generator writes 0-based wire addresses, which is what Home Assistant expects. See why addresses are off by one.
Home Assistant refuses to startA second modbus: section, or a paste with wrong indentationKeep 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.