Modbus project: Eastron SDM230 energy meter over RS-485 into Home Assistant, testing with mbpoll first

Discuss the Implementation and Development of MODBus Devices
Post Reply
User avatar
ZerOne
Site Admin
Posts: 216
Joined: Sun Dec 13, 2020 8:21 am

A worked example for getting live power and energy from an Eastron SDM230-Modbus single-phase meter into Home Assistant. Based on the Eastron protocol document, the EpiSensor register map for this meter, the mbpoll README and the Home Assistant Modbus docs, as at October 2026. I have not run this exact setup, so verify each value against the meter display, and check the manual for your exact model and firmware. It applies to the SDM230-Modbus RS-485 version only (not the pulse, M-Bus or other variants).

Safety: the meter connects to mains. In Australia, installation and wiring on the mains side must be done by a licensed electrician. This guide covers only the data side. Keep the RS-485 wiring away from mains cables and do not touch terminals with power on.

What you need
  • An installed SDM230-Modbus, direct-connected (the meter is documented for direct connection up to 100 A).
  • A USB to RS-485 adapter on your Home Assistant machine, or another route from the previous guide.
  • A Linux laptop or the HA host with mbpoll available.
Step 1: read the meter's serial settings

The manual gives a default address of 1 and 2400 bit/s, with parity (none, even, odd) and one or two stop bits configurable. Do not assume the defaults, since a used meter or an electrician may have changed them. Read the installed address, baud rate, parity and stop bits from the meter's setup menu using the manual. Note them down.

Step 2: test with mbpoll

Key mbpoll options from its README: -m rtu, -a unit address, -b baud, -P parity (none, even or odd; the default is even), -s stop bits, -t 3:float for input registers as 32-bit floats, -r start reference, -0 for zero-based addressing, -B for big-endian word order, -c count and -1 to poll once.

Per the protocol document, the meter uses function code 04 (input registers) and two registers per float, most significant register first, with addresses starting from zero. Voltage is at address 0. Example, if the meter is at address 1, 2400 baud, no parity, 1 stop bit:

Code: Select all

mbpoll -m rtu -a 1 -b 2400 -P none -s 1 -t 3:float -B -0 -r 0 -c 1 -1 /dev/ttyUSB0
You should see a voltage near what the mains is (check it against the meter's display). If you get a nonsense number, try without -B, since word order options are the most likely cause. If you get timeouts, re-check baud, parity, stop bits and address, then try swapping A and B. I have not run this exact command, so check mbpoll -h.

Step 3: the register map

All are float32 over 2 registers (zero-based addresses, input registers). From the EpiSensor map and the protocol document:
  • Voltage (V): 0
  • Current (A): 6
  • Active power (W): 12
  • Apparent power (VA): 18
  • Reactive power (VAr): 24
  • Power factor: 30
  • Frequency (Hz): 70
  • Import energy (kWh): 72
  • Export energy (kWh): 74
The display reference for voltage, 30001, is not what goes on the wire. Use address 0. The protocol limits one request to 40 values (80 registers).

Step 4: Home Assistant YAML

Add to configuration.yaml (use /dev/serial/by-id/... for the port if available, since ttyUSB numbers can change). Adjust to your meter settings:

Code: Select all

modbus:
  - name: sdm230
    type: serial
    port: /dev/ttyUSB0
    method: rtu
    baudrate: 2400
    bytesize: 8
    parity: N
    stopbits: 1
    sensors:
      - name: "Mains voltage"
        unique_id: sdm230_voltage
        device_address: 1
        address: 0
        input_type: input
        data_type: float32
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scan_interval: 15
      - name: "Mains active power"
        unique_id: sdm230_power
        device_address: 1
        address: 12
        input_type: input
        data_type: float32
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scan_interval: 15
      - name: "Mains import energy"
        unique_id: sdm230_import_kwh
        device_address: 1
        address: 72
        input_type: input
        data_type: float32
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scan_interval: 60
        precision: 2
Notes from the HA docs: device_address is the unit ID (older versions use slave). Word order is controlled by the swap option, which the docs list as none, byte, word or word_byte. The meter is big-endian, most significant register first, so I would expect no swap. If your values are wrong, try a word swap. Check the Modbus page for the exact options in your HA version, and restart HA after the edit.

Step 5: energy dashboard

Once the import kWh sensor is stable, add it as grid consumption in the Energy dashboard. For export (solar), add address 74 in the same way. Compare numbers with the meter display for a day before trusting them.

Troubleshooting
  • Timeouts: serial settings or address mismatch, A/B swapped, or another program holding the serial port.
  • HA reports unavailable only on some sensors: serial lines at 2400 bit/s are slow; spread out scan_interval values or raise the baud on the meter and in HA.
  • Values off by a factor: do not apply any scaling for this direct-connected model; the protocol document says no CT multiplier is needed.
Links
Question for the group: has anyone run an SDM230 (or SDM120/630) with Home Assistant, and which baud rate, parity and word-order settings ended up working for you?
Post Reply

Return to “MODBus Protocol Discussion”