I post this on the HA community forum. But thought it might come in handy for people who are "new" to configuring HA to work with RS485 energy meters.
With the help of people across teh HA community, I’ve got my Eastrons working as I hoped. So here’s a copy of my modbus config for all those others out there who are “new” to this, and might find helpful.
My setup:
- 1x Eastron SDM230
- 3x Eastron SDM120
- 1x Industrial Modbus RS485 to USB Adaptor
- 1x IntelNUC (i5; 8Gb RAM; 128Gb SSD) flashed for HA only
- Daisy-chained using a single pair taken from a CAT6 cable.
- No GND cable
- No Terminating resistor
- My configuration.yaml calls a separate file in the same directory as the config.yaml called “modbusUSB.yaml”.
Code: Select all
modbus: !include modbusUSB.yaml
I’m able to read the following data on all of the individual meters:
- Active Energy (kWh)
- Voltage (V)
- Current (A)
- Active Power (W)
- Power Factor
NOTE: You must also ensure the "slave" value(s) match that of each individual meter - the meters need to have their own unique ID.
NOTE: You can also change the "name" and "unique_id" to suit your requirements.
Code: Select all
# ---------------------------USB/Serial--------------------------------------
# Modbus Config confirmed working for Eastron SDM230 and SDM120 single phase energy meters
# Adjust port setting to match USB port in use
# "slave" setting should be changed on each SDM individually, and each sensor updated accordingly
- name: HomeModbus1
type: serial
baudrate: 9600
bytesize: 8
method: rtu
parity: N
port: /dev/ttyACM0
stopbits: 1
# ---------------------------------------------------------------------------
sensors:
# SDM120; EPS Circuits
# Slave 200
- name: "EPS Active Energy"
unique_id: eps_active_energy
address: 342
input_type: input
count: 2
slave: 200
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "EPS Voltage"
unique_id: eps_voltage
slave: 200
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
- name: "EPS Current"
unique_id: eps_current
slave: 200
address: 6
input_type: input
count: 2
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
- name: "EPS Active Power"
unique_id: eps_active_power
slave: 200
address: 12
input_type: input
count: 2
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
- name: "EPS Power Factor"
unique_id: eps_power_factor
slave: 200
address: 30
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: cosф
device_class: power_factor
# SDM230; Non-EPS Circuits
# Slave 100
- name: "Non-EPS Active Energy"
unique_id: non_eps_active_energy
address: 342
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "Non-EPS Voltage"
unique_id: non_eps_voltage
slave: 100
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
- name: "Non-EPS Current"
unique_id: non_eps_current
slave: 100
address: 6
input_type: input
count: 2
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
- name: "Non-EPS Active Power"
unique_id: non_eps_active_power
slave: 100
address: 12
input_type: input
count: 2
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
- name: "Non-EPS Power Factor"
unique_id: non_eps_power_factor
slave: 100
address: 30
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: cosф
device_class: power_factor
# SDM120; Induction Hob Circuit
# Slave 101
- name: "Hob Active Energy"
unique_id: hob_active_energy
address: 342
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "Hob Voltage"
unique_id: hob_voltage
slave: 101
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
- name: "Hob Current"
unique_id: hob_current
slave: 101
address: 6
input_type: input
count: 2
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
- name: "Hob Active Power"
unique_id: hob_active_power
slave: 101
address: 12
input_type: input
count: 2
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
- name: "Hob Power Factor"
unique_id: hob_power_factor
slave: 101
address: 30
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: cosф
device_class: power_factor
# SDM120; Immersion Circuit
# Slave 102
- name: "Immersion Active Energy"
unique_id: immersion_active_energy
address: 342
input_type: input
count: 2
slave: 102
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "Immersion Voltage"
unique_id: immersion_voltage
slave: 102
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
- name: "Immersion Current"
unique_id: immersion_current
slave: 102
address: 6
input_type: input
count: 2
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
- name: "Immersion Active Power"
unique_id: immersion_active_power
slave: 102
address: 12
input_type: input
count: 2
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
- name: "Immersion Power Factor"
unique_id: immersion_power_factor
slave: 102
address: 30
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: cosф
device_class: power_factor
These energy meters are not placed to monitor import/export - I’ll be using a solar inverter (Fox-ESS H1 6kW) for that. I also have a Hildebrand GLOW In House Display (IHD) reading my SMETS2 and sending data via MQTT to my HA instance. This allows me to track tariff rates and import/export consumption at the boundary line. (This is a UK setup).
I will also be adding further Eastrons over time, as and when teh need presents itself.
I also pull in other energy data from various Shelly plus1PMs and a Shelly Pro4PM.
I'm now able to monitor individual devices in HA through the Energy dashboard, as well as get other data (current/voltage/PF) via Grafana or dashboard cards.
Hope the above is of use to someone out there.
Thanks.
Roland.