Hi All,
I’ve also used the SDM630 for energy metering. Due to changes in HA, the configuration is now a bit different, and I made some hardware choices that work out quite well for me. This thread has been very helpful, and I wanted to return the favor by posting my working config here. I hope this is useful.
Hardware
I’ve studied electrical engineering, and I did the full electrical installation of my house. To me, the breaker box is no playground for hobby projects. Any mishaps here will cause serious issues and even fire. If something were to happen, even caused by something completely different, I do not want to have this discussion with my insurance. In effect that means that I run signal wires as short as possible and properly insulated inside the breaker box. All electronics goes outside the box, in another box.
I’m using 2 SDM630 V2s (and I will add a third later on). The RS485 is connected to both in parallel. I did not use any terminator resistors. Short wire runs and low bit rates will not require this. For this I used 0,5mm2 flexible wire that I twisted myself. You can go smaller, but that’s easy to damage and the insulation is not rated for voltages used inside the breaker box. This felt pretty sturdy and the insulation is also rated for high voltage.
One of the first things that needed to be done is to configure the SDM630 Modbus addresses. This can be anything between 1 and 247. Each device needs a unique address. I choose 100 and 101. By default this is 1. The chosen address is referred to as ‘slave’ in the modbus configuration. (or at least until some woke movement tries to cancel modbus). You’d also need to make sure that serial settings are good. I used the default setting: 9600,N,1. This needs to be matched by the RS485 to Ethernet bridge. I chose this, because the amount of data is small and slower is more reliable, especially since I’m not using terminator resistors on the RS485 bus.
As RS485 to Ethernet bridge I used this:
I have a POE enabled switch, so to power it I used a POE Splitter (I’ve used the 5V DC version, but 12V DC would also be OK):
The splitter was mutulated a bit in the proces, the alternative being a whole bunch of connectors, wires and screw terminals.
Both combined look like this:
Both are mounted in an ABS box (130h x 80w x 70d) outside the breaker box.
RS485 to Ethernet Config
For the RS485 to Ethernet bridge I was strugling with getting the software properly installed and working. Then, I noticed that the unit had a pretty good Web interface. So, there is no need to install any software to configure this. Out of the box, this device used DHCP and it got an IP address. Perfect for me. I have a separate DHCP enabled (with 10 year leases) IoT VLAN for these devices and HA.
Here are my serial port settings:
Here are my communication settings:
Home Assistant Config
I’ve moved modbus stuff to a separate file. To do that I added this to my configuration.yaml:
modbus: !include modbus.yaml
Here’s my modbus.yaml:
Please note that is contains everything twice (a and b) since I have 2 SDM630 V2’s connected.
- name: ee11_01
type: rtuovertcp
host: 192.168.1.231
port: 8888
sensors:
- name: sdm630a_phase_1_line_to_neutral_volts
slave: 100
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: e4fd23fe-18be-4c60-b8e8-bf44640f12ff
- name: sdm630a_phase_2_line_to_neutral_volts
slave: 100
address: 2
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: be929394-9daf-4f27-8c36-1ad79de68897
- name: sdm630a_phase_3_line_to_neutral_volts
slave: 100
address: 4
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 73218700-b043-4ac2-b96f-ab133c328e21
- name: sdm630a_phase_1_current
address: 6
input_type: input
count: 2
slave: 100
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: dc439a69-1f82-4b83-9e4c-a2cb63375af6
- name: sdm630a_phase_2_current
address: 8
input_type: input
count: 2
slave: 100
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 298c2d37-19d9-4962-9149-9672dfb123c5
- name: sdm630a_phase_3_current
address: 10
input_type: input
count: 2
slave: 100
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 77b8bcf4-1357-4295-8ac9-5818ec37dfbe
- name: sdm630a_phase_1_power
address: 12
input_type: input
count: 2
slave: 100
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: 7d80e94e-38bd-45a4-be50-8649e1838d7b
- name: sdm630a_phase_2_power
address: 14
input_type: input
count: 2
slave: 100
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: fe80f571-bd1d-4693-a40d-e360ef73456b
- name: sdm630a_phase_3_power
address: 16
input_type: input
count: 2
slave: 100
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: 7795d348-0d1a-44f6-bc5e-b0fa5e7a7822
- name: sdm630a_phase_1_va
address: 18
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: f310d44e-5a7e-48c2-9e82-82b7828e85fa
- name: sdm630a_phase_2_va
address: 20
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: 333c7e75-0262-4e78-a5f5-3cc821969293
- name: sdm630a_phase_3_va
address: 22
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: 39bb632d-d53f-4f39-a564-b59ade16b2e2
- name: sdm630a_phase_1_va_reactive
address: 24
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: f49cfa48-ca0a-4820-81ee-de82c04e5538
- name: sdm630a_phase_2_va_reactive
address: 26
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: 0f591919-8ff0-4912-8985-7040e7e6e396
- name: sdm630a_phase_3_va_reactive
address: 28
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: b777921f-e0bf-42f0-b7c5-0063d1d1f998
- name: sdm630a_sum_of_line_currents
address: 48
input_type: input
count: 2
slave: 100
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 674429d5-41b1-4665-9359-823c9e96c4db
- name: sdm630a_total_system_power
address: 52
input_type: input
count: 2
slave: 100
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: a2da5638-1830-413e-a3ae-0c2c0d8774f0
- name: sdm630a_total_system_va
address: 56
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: 0335b258-7159-4bd1-ab88-0a05b3834070
- name: sdm630a_total_system_var
address: 60
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: b9debc67-9de3-4466-91f0-d3e152b7187c
- name: sdm630a_frequency_of_supply_voltages
address: 70
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: Hz
unique_id: 53bac3c5-26b0-4288-9640-96724371eb52
- name: sdm630a_import_wh_since_last_reset
address: 72
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
unique_id: 0984ddfc-e9c2-4830-b283-ecedc9e43c8a
- name: sdm630a_export_wh_since_last_reset
address: 74
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
unique_id: 34114a81-c69b-4300-a5b5-589c741fc9d6
- name: sdm630a_maximum_total_system_power
address: 86
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: W
device_class: power
unique_id: 5303d79d-cb54-46cd-b443-fd977eac3c0e
- name: sdm630a_total_system_va_demand
address: 100
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: 2947dec8-b49a-4837-ac7c-bab1e5c27f97
- name: sdm630a_maximum_total_system_va_demand
address: 102
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: ad06d5b4-fed8-4785-9b02-b0b80d7a0fd7
- name: sdm630a_line_1_to_line_2_volts
address: 200
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 3037dfee-5840-4249-89f2-17387cdacbec
- name: sdm630a_line_2_to_line_3_volts
address: 202
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 108f656a-f3da-4f93-956a-5cfbe58d6c04
- name: sdm630a_line_3_to_line_1_volts
address: 204
input_type: input
count: 2
slave: 100
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: e3ab3d23-010f-4266-ad53-5340e173fb0e
- name: sdm630b_phase_1_line_to_neutral_volts
slave: 101
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 41338dee-5a63-4b13-b990-1f8ec421587e
- name: sdm630b_phase_2_line_to_neutral_volts
slave: 101
address: 2
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 190f6827-5dcc-4541-b04f-02c588180550
- name: sdm630b_phase_3_line_to_neutral_volts
slave: 101
address: 4
input_type: input
count: 2
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 41a61c53-70fb-427a-8825-5ef2e7a9f870
- name: sdm630b_phase_1_current
address: 6
input_type: input
count: 2
slave: 101
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 099e1898-d17e-4197-8a03-f10167a5ce32
- name: sdm630b_phase_2_current
address: 8
input_type: input
count: 2
slave: 101
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 29fe4b01-9b3e-4b32-8f5f-6ff83043aeee
- name: sdm630b_phase_3_current
address: 10
input_type: input
count: 2
slave: 101
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 95bc8f36-fa83-42a0-bdfd-8f75b6527f21
- name: sdm630b_phase_1_power
address: 12
input_type: input
count: 2
slave: 101
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: d303eb15-7b5d-4e97-a823-a90d7808de13
- name: sdm630b_phase_2_power
address: 14
input_type: input
count: 2
slave: 101
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: a20029bd-6d08-4c23-bcbb-a61b8ca651dc
- name: sdm630b_phase_3_power
address: 16
input_type: input
count: 2
slave: 101
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: 16813684-9811-4e2a-90d1-d740296e2f2d
- name: sdm630b_phase_1_va
address: 18
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: cdf51917-5898-4ba1-ba28-bfcc027f9449
- name: sdm630b_phase_2_va
address: 20
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: 06f1fe8b-8a6f-4f19-9bff-369d3f2fefc4
- name: sdm630b_phase_3_va
address: 22
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: ae569e48-0a29-461d-af69-5ec1ed91c9a6
- name: sdm630b_phase_1_va_reactive
address: 24
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: fd2e9e2b-8793-4370-a0be-783b3a3be1b0
- name: sdm630b_phase_2_va_reactive
address: 26
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: 3e1630b4-82e0-40fc-b6f5-bc3d4838d207
- name: sdm630b_phase_3_va_reactive
address: 28
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: 8e74583b-7e1d-4def-976f-c75ca0a3c0cc
- name: sdm630b_sum_of_line_currents
address: 48
input_type: input
count: 2
slave: 101
precision: 3
data_type: float32
unit_of_measurement: A
device_class: current
unique_id: 245b641b-74e7-4c33-924e-d061a52e1264
- name: sdm630b_total_system_power
address: 52
input_type: input
count: 2
slave: 101
precision: 3
scale: 0.001
data_type: float32
unit_of_measurement: kW
device_class: power
unique_id: 07509e1e-6bfe-483b-b246-d337e81e1672
- name: sdm630b_total_system_va
address: 56
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: eb38bf21-fd05-46a0-b828-9ecc13e0b6e0
- name: sdm630b_total_system_var
address: 60
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VAr
device_class: power
unique_id: 780c1d8f-e93f-4938-b546-43973d1eb0aa
- name: sdm630b_frequency_of_supply_voltages
address: 70
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: Hz
unique_id: 273bc377-c3ae-4ae9-afeb-0a5dbad68304
- name: sdm630b_import_wh_since_last_reset
address: 72
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
unique_id: 18989ead-0d41-4708-819f-785ebadb93fd
- name: sdm630b_export_wh_since_last_reset
address: 74
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: kWh
device_class: energy
unique_id: 16aa8fc9-6005-4929-8375-a00de2f2fa68
- name: sdm630b_maximum_total_system_power
address: 86
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: W
device_class: power
unique_id: 556799c2-1502-4b7d-a7c9-9a7eb531757a
- name: sdm630b_total_system_va_demand
address: 100
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: 49806eef-c948-41f2-b92c-17473d74a027
- name: sdm630b_maximum_total_system_va_demand
address: 102
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: VA
device_class: power
unique_id: bc97dcee-02e1-4240-8309-9ccc06b63b32
- name: sdm630b_line_1_to_line_2_volts
address: 200
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: fda56590-59b4-44c6-81fc-e1f4724b8dcd
- name: sdm630b_line_2_to_line_3_volts
address: 202
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: c7aa801b-3821-4bb5-9783-ed24ad3fdd7e
- name: sdm630b_line_3_to_line_1_volts
address: 204
input_type: input
count: 2
slave: 101
precision: 2
data_type: float32
unit_of_measurement: V
device_class: voltage
unique_id: 2730820b-7207-4cbf-8474-8b484390750b
The use of unique ID’s allowed me to set area’s and change names in the UI. I’ve used an online GUID generator to make these.
I also needed to have a couple of customizations to make stuff work in the energy panel, here’s my customize.yaml:
sensor.sdm630a_import_wh_since_last_reset:
state_class: total_increasing
sensor.sdm630a_export_wh_since_last_reset:
state_class: total_increasing
sensor.sdm630b_import_wh_since_last_reset:
state_class: total_increasing
sensor.sdm630b_export_wh_since_last_reset:
state_class: total_increasing
To be complete, customizations.yaml is a separate file. In the configuration.yaml this needs to be there:
homeassistant:
customize: !include customize.yaml