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.
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/ttyUSB0Step 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
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: 2Step 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.
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?