Energy metering with Eastron SDM630 v2 Modbus

Hi all. Did you have any new FW to this SDM630 Modbus V2 to update ?

This solution is not working for me… I Always get the error:

[homeassistant.components.modbus.modbus] modbus waveshare1 communication closed

is there any solution for this issue?

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
3 Likes

@jghek this will work with SDM630 V2?

Yes. I have 2 V2’s connected. Here is a picture of one:

I’ve also changed my initial post. Thanks!

Working Version here with a SDM630 Modbus v2 and a Waveshare RS485 to RJ45/Ethernet

Waveshare:

hass config:

modbus:
  # SDM630 PowerMeter
  - name: eastron
    type: rtuovertcp
    host: 10.0.0.28
    port: 502
    retry_on_empty: true
    close_comm_on_error: false
    retries: 10
    timeout: 15
    delay: 2
    sensors:
      - name: Phase 1 line to neutral volts
        unique_id: l1_neutral_volts
        count: 2
        data_type: float32
        precision: 2
        address: 0
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Phase 2 line to neutral volts
        unique_id: l2_neutral_volts
        count: 2
        data_type: float32
        precision: 2
        address: 2
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Phase 3 line to neutral volts
        unique_id: l3_neutral_volts
        count: 2
        data_type: float32
        precision: 2
        address: 4
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Phase 1 current
        unique_id: l1_current
        count: 2
        data_type: float32
        precision: 2
        address: 6
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Phase 2 current
        unique_id: l2_current
        count: 2
        data_type: float32
        precision: 2
        address: 8
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Phase 3 current
        unique_id: l3_current
        count: 2
        data_type: float32
        precision: 2
        address: 10
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Phase 1 power
        unique_id: l1_power
        count: 2
        data_type: float32
        precision: 2
        address: 12
        input_type: input
        slave: 1
        unit_of_measurement: W
        state_class: measurement
        device_class: power
      - name: Phase 2 power
        unique_id: l2_power
        count: 2
        data_type: float32
        precision: 2
        address: 14
        input_type: input
        slave: 1
        unit_of_measurement: W
        state_class: measurement
        device_class: power
      - name: Phase 3 power
        unique_id: l3_power
        count: 2
        data_type: float32
        precision: 2
        address: 16
        input_type: input
        slave: 1
        unit_of_measurement: W
        state_class: measurement
        device_class: power
      - name: Phase 1 Volt amps
        unique_id: l1_volt_amps
        count: 2
        data_type: float32
        precision: 2
        address: 18
        input_type: input
        slave: 1
        unit_of_measurement: VA
        state_class: measurement
        device_class: apparent_power
      - name: Phase 2 Volt amps
        unique_id: l2_volt_amps
        count: 2
        data_type: float32
        precision: 2
        address: 20
        input_type: input
        slave: 1
        unit_of_measurement: VA
        state_class: measurement
        device_class: apparent_power
      - name: Phase 3 Volt amps
        unique_id: l3_volt_amps
        count: 2
        data_type: float32
        precision: 2
        address: 22
        input_type: input
        slave: 1
        unit_of_measurement: VA
        state_class: measurement
        device_class: apparent_power
      - name: Phase 1 volt amps reactive
        unique_id: l1_volt_amps_reactive
        count: 2
        data_type: float32
        precision: 2
        address: 24
        input_type: input
        slave: 1
        unit_of_measurement: VAr
        state_class: measurement
        device_class: reactive_power
      - name: Phase 2 volt amps reactive
        unique_id: l2_volt_amps_reactive
        count: 2
        data_type: float32
        precision: 2
        address: 26
        input_type: input
        slave: 1
        unit_of_measurement: VAr
        state_class: measurement
        device_class: reactive_power
      - name: Phase 3 volt amps reactive
        unique_id: l3_volt_amps_reactive
        count: 2
        data_type: float32
        precision: 2
        address: 28
        input_type: input
        slave: 1
        unit_of_measurement: VAr
        state_class: measurement
        device_class: reactive_power
      - name: Phase 1 power factor
        unique_id: l1_power_factor
        count: 2
        data_type: float32
        precision: 2
        address: 30
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 2 power factor
        unique_id: l2_power_factor
        count: 2
        data_type: float32
        precision: 2
        address: 32
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 3 power factor
        unique_id: l3_power_factor
        count: 2
        data_type: float32
        precision: 2
        address: 34
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 1 phase angle
        unique_id: l1_phase_angle
        count: 2
        data_type: float32
        precision: 2
        address: 36
        input_type: input
        slave: 1
        unit_of_measurement: Degree
        state_class: measurement
        device_class: power
      - name: Phase 2 phase angle
        unique_id: l2_phase_angle
        count: 2
        data_type: float32
        precision: 2
        address: 38
        input_type: input
        slave: 1
        unit_of_measurement: Degree
        state_class: measurement
        device_class: power
      - name: Phase 3 phase angle
        unique_id: l3_phase_angle
        count: 2
        data_type: float32
        precision: 2
        address: 40
        input_type: input
        slave: 1
        unit_of_measurement: Degree
        state_class: measurement
        device_class: power
      - name: Average line to neutral volts
        unique_id: average_line_neutral_volt
        count: 2
        data_type: float32
        precision: 2
        address: 42
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Average line current
        unique_id: average_line_current
        count: 2
        data_type: float32
        precision: 2
        address: 46
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Sum of line currents
        unique_id: sum_line_currents
        count: 2
        data_type: float32
        precision: 2
        address: 48
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Total system power
        unique_id: total_system_power
        scan_interval: 5
        count: 2
        data_type: float32
        precision: 2
        address: 52
        input_type: input
        slave: 1
        unit_of_measurement: W
        state_class: measurement
        device_class: power
      - name: Total system volt amps
        unique_id: total_system_volt_amps
        count: 2
        data_type: float32
        precision: 2
        address: 56
        input_type: input
        slave: 1
        unit_of_measurement: VA
        state_class: measurement
        device_class: apparent_power
      - name: Total system VAr
        unique_id: total_system_var
        count: 2
        data_type: float32
        precision: 2
        address: 60
        input_type: input
        slave: 1
        unit_of_measurement: VAr
        state_class: measurement
        device_class: reactive_power
      - name: Total system power factor
        unique_id: total_system_power_factor
        count: 2
        data_type: float32
        precision: 2
        address: 62
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Total system phase angle
        unique_id: total_system_phase_angle
        count: 2
        data_type: float32
        precision: 2
        address: 66
        input_type: input
        slave: 1
        unit_of_measurement: Degree
        state_class: measurement
      - name: Frequency of supply voltages
        unique_id: frequency_of_supply_voltages
        count: 2
        data_type: float32
        precision: 2
        address: 70
        input_type: input
        slave: 1
        unit_of_measurement: Hz
        state_class: measurement
        device_class: frequency
      - name: Import kWh since last reset
        unique_id: Import_kWh_since_last_reset
        count: 2
        data_type: float32
        precision: 2
        address: 72
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: Export kWh since last reset
        unique_id: Export_kWh_since_last_reset
        count: 2
        data_type: float32
        precision: 2
        address: 74
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: Import VArh since last reset
        unique_id: Import_VArh_since_last_reset
        count: 2
        data_type: float32
        precision: 2
        address: 76
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total
      - name: Export VArh since last reset
        unique_id: Export_VArh_since_last_reset
        count: 2
        data_type: float32
        precision: 2
        address: 78
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: VAh since last reset
        unique_id: VAh_since_last_reset
        count: 2
        data_type: float32
        precision: 2
        address: 80
        input_type: input
        slave: 1
        unit_of_measurement: kVAh
        state_class: total
      - name: Ah since last reset
        unique_id: Ah_since_last_reset
        count: 2
        data_type: float32
        precision: 2
        address: 82
        input_type: input
        slave: 1
        unit_of_measurement: Ah
        state_class: total
      - name: Total system power demand
        unique_id: Total_system_power_demand
        count: 2
        data_type: float32
        precision: 2
        address: 84
        input_type: input
        slave: 1
        unit_of_measurement: W
        state_class: measurement
        device_class: power
      - name: Maximum total system power demand
        unique_id: Maximum_total_system_power_demand
        count: 2
        data_type: float32
        precision: 2
        address: 86
        input_type: input
        slave: 1
        unit_of_measurement: W
        state_class: measurement
        device_class: power
      - name: Total system VA demand
        unique_id: Total_system_VA_demand
        count: 2
        data_type: float32
        precision: 2
        address: 100
        input_type: input
        slave: 1
        unit_of_measurement: VA
        state_class: measurement
        device_class: apparent_power
      - name: Maximum total system VA demand
        unique_id: Maximum_total_system_VA_demand
        count: 2
        data_type: float32
        precision: 2
        address: 102
        input_type: input
        slave: 1
        unit_of_measurement: VA
        state_class: measurement
        device_class: apparent_power
      - name: Neutral current demand
        unique_id: Neutral_current_demand
        count: 2
        data_type: float32
        precision: 2
        address: 104
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Maximum neutral current demand
        unique_id: Maximum_neutral_current_demand
        count: 2
        data_type: float32
        precision: 2
        address: 106
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Line 1 to Line 2 volts
        unique_id: Line1_to_Line2_volts
        count: 2
        data_type: float32
        precision: 2
        address: 200
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Line 2 to Line 3 volts
        unique_id: Line2_to_Line3_volts
        count: 2
        data_type: float32
        precision: 2
        address: 202
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Line 3 to Line 1 volts
        unique_id: Line3_to_Line1_volts
        count: 2
        data_type: float32
        precision: 2
        address: 204
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Average line to line volts
        unique_id: Average_line_to_line_volts
        count: 2
        data_type: float32
        precision: 2
        address: 206
        input_type: input
        slave: 1
        unit_of_measurement: V
        state_class: measurement
        device_class: voltage
      - name: Neutral current
        unique_id: Neutral_current
        count: 2
        data_type: float32
        precision: 2
        address: 224
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Phase 1 L/N volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 234
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 2 L/N volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 236
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 3 L/N volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 238
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 1 Current THD
        count: 2
        data_type: float32
        precision: 2
        address: 240
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 2 Current THD
        count: 2
        data_type: float32
        precision: 2
        address: 242
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Phase 3 Current THD
        count: 2
        data_type: float32
        precision: 2
        address: 244
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Average line to neutral volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 248
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Average line current THD
        count: 2
        data_type: float32
        precision: 2
        address: 250
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Total system power factor
        count: 2
        data_type: float32
        precision: 2
        address: 254
        input_type: input
        slave: 1
        unit_of_measurement: Degree
        state_class: measurement
      - name: Phase 1 current demand
        count: 2
        data_type: float32
        precision: 2
        address: 258
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Phase 2 current demand
        count: 2
        data_type: float32
        precision: 2
        address: 260
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Phase 3 current demand
        count: 2
        data_type: float32
        precision: 2
        address: 262
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Maximum phase 1 current demand
        count: 2
        data_type: float32
        precision: 2
        address: 264
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Maximum phase 2 current demand
        count: 2
        data_type: float32
        precision: 2
        address: 266
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Maximum phase 3 current demand
        count: 2
        data_type: float32
        precision: 2
        address: 268
        input_type: input
        slave: 1
        unit_of_measurement: A
        state_class: measurement
        device_class: current
      - name: Line 1 to line 2 volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 334
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Line 2 to line 3 volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 336
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Line 3 to line 1 volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 338
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Average line to line volts THD
        count: 2
        data_type: float32
        precision: 2
        address: 340
        input_type: input
        slave: 1
        unit_of_measurement: "%"
        state_class: measurement
        device_class: power_factor
      - name: Total kWh
        unique_id: Total_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 342
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total
        device_class: energy
      - name: Total kVArh
        unique_id: Total_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 344
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total
      - name: L1 import kWh
        unique_id: L1_import_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 346
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: L2 import kWh
        unique_id: L2_import_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 348
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: L3 import kWh
        unique_id: L3_import_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 350
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: L1 export kWh
        unique_id: L1_export_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 352
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: L2 export kWh
        unique_id: L2_export_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 354
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: L3 export kWh
        unique_id: L3_export_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 356
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
      - name: L1 total kWh
        unique_id: L1_total_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 358
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total
        device_class: energy
      - name: L2 total kWh
        unique_id: L2_total_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 360
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total
        device_class: energy
      - name: L3 total kWh
        unique_id: L3_total_kWh
        count: 2
        data_type: float32
        precision: 2
        address: 362
        input_type: input
        slave: 1
        unit_of_measurement: kWh
        state_class: total
        device_class: energy
      - name: L1 import kVArh
        unique_id: L1_import_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 364
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: L2 import kVArh
        unique_id: L2_import_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 366
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: L3 import kVArh
        unique_id: L3_import_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 368
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: L1 export kVArh
        unique_id: L1_export_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 370
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: L2 export kVArh
        unique_id: L2_export_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 372
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: L3 export kVArh
        unique_id: L3_export_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 374
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total_increasing
      - name: L1 total kVArh
        unique_id: L1_total_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 376
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total
      - name: L2 total kVArh
        unique_id: L2_total_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 378
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total
      - name: L3 total kVArh
        unique_id: L3_total_kVArh
        count: 2
        data_type: float32
        precision: 2
        address: 380
        input_type: input
        slave: 1
        unit_of_measurement: kVArh
        state_class: total
3 Likes

Great. Just one more question before I buy the equipments. To connect two SDM630 units I only need one RS485 to Ethernet unit, right?

Yes. You can actually have 247 modbus devices on a single RS485 bus. Just make sure you are setting each device to a unique address. Please note that what we call address on the SDM630 is called ‘slave’ in your HA modbus set up. The address in HA refers to the address of a value (acutally a register) within a modbus device.

Here’s a picture I made while adding a third SDM630.

All devices are connected in parallel, and I twisted the wire to make improve the signal transmission.

1 Like

Hi,

How can we check if the connection is made between home-assistant and the unit.
Got the exact same one but cant get it to work so it seems?

Hi there.

I’m looking to buy a 3-phase meter to use with Home Assistant, I see that Eastron has released a “TCP” version of the SDM630 with an integrated ethernet port and Modbus/TCP. Has anyone tried it already?

Hi,

I have the EASTRON SDM630 MODBUS-MID V2
and I use Waveshare RS232/485/422 zu RJ45 Ethernet Konverter as a Gateway.

I am desperate. I cannot manage to get this two devices to work together or in Home Assistant.

First I tried to configure the gateway without the meter but I got no data even no random
noise data. Then I connected the power meter to it. The configuration looks fine. Both gateway
and power meter have the same serial properties:

  1. Baud rate: 9600
  2. Databits: 8
  3. Parity: even
  4. Stopbits: 1

I tried several tools like

  1. mbpoll (linux) → mbpoll.jpg
  2. ModScan → modscan.jjpg

Either no data is sent or the connection times out. I can ping the gateway so it should be
reachable.

I also tried to configure the gateway in Home Assistant. Same result. No data and even no
log entries although I got this in my configuration:

logger:
  logs:
    homeassistant.components.modbus: debug
    pymodbus.client: debug

I noticed that the small phone handset in the SDM630 display is missing. So I guess there is no
communication between both of them.

At the moment I am using a simple bulb and the 1p2w setting in the SDM630. Maybe that’s the
cause that the modbus is not working? Is modbus only active with a 3p4w setting?
I know this is a Home Assistant forum but maybe someone else had the same problems.

I would appreciate any kind of help and ideas.

Best regards
Goran

Hi Goran,

Have you got this to work in the end? I Was troubled with another type of Waveshare interface and got a little bit further by swapping the A and B signals around (seems like it was incorrectly labeled on the interface itself…). You may give that a try, though you may have tried that already of course.

Cheers,

Kim

Hi Kim,

I purchased an Modbus-To-USB dongle to test it directly at the computer.
It worked out of the box. So I guess the gateway does not work or cannot be configured properly.
I returned it.

At the end I found another solution:

I tried it and it works like a charme

Best regards
Goran

Thanks a lot, now i got it working. Herzlichen Dank nach dieser Anleitung funktioniert nun das Auslesen mit dem SDM630 Modbus v2 and a Waveshare RS485 to RJ45/Ethernet

@TomTomTom
I can confirm Modbus on the SDM630 works in the 1p2w settings as well.
Waveshare settings that I used:
Work mode: TCP Server.
Protocol: Modbus TCP to RTU

With that I tested if I could pull data using other tools first. With QModMaster I was able to pull data (0x04), Unit ID to what you set the SDM630 to, Start address 200, nr of registers 2, data format float, precision 3. This gave an output of 237 which is the L1 Voltage.

After this I got it to work on the Raspberry that has HASS installed. First I tried to replicate above using a Modbus integration in Node-Red as this makes it easier to play around with.

modbus:
  - name: "sdm630"
    retries: 10
    delay: 10
    message_wait_milliseconds: 1000
    timeout: 10
    type: tcp
    host: 192.168.2.40
    port: 502
    sensors:
      - name: sdm630_line_1_to_line_2_volts
        slave: 2
        address: 200
        input_type: input
        data_type: float32
        precision: 2
        unit_of_measurement: V
        device_class: voltage
      - name: sdm630_frequency_of_supply_voltages
        address: 70
        precision: 2
        input_type: input
        slave: 2
        data_type: float32
        unit_of_measurement: Hz

I had the feeling HASS only picks up Modbus configurations after a reload btw.

hello,

it’s my first time here so forgive any dumb mistakes.

but i had the same problems as descript above, i have the feeling it’s due to the fact the baudrate is to low for the modbus to function correctly, i have the same Waveshare modbus and the SDM630, and had the same problem.

I’ve set the baudrate on the SDM630 to 38400 and in the setting of the modbus.
mine is now working perfectly without losing any data or disconnection all the time. and its responding really quick.

here is my YAML and some pics of the settings that i have used.

modbus:
  - name: "sdm630"
    retries: 10
    delay: 10
    message_wait_milliseconds: 1000
    timeout: 10
    type: tcp
    host: 192.168.2.200
    port: 502
    sensors:
      - name: L1_volts
        unique_id: l1_neutral_volts
        slave: 2
        address: 0
        input_type: input
        data_type: float32
        precision: 2
        unit_of_measurement: V
        device_class: voltage
      - name: L2_volts
        unique_id: l2_neutral_volts
        slave: 2
        address: 2
        input_type: input
        data_type: float32
        precision: 2
        unit_of_measurement: V
        device_class: voltage
      - name: L3_volts
        unique_id: l3_neutral_volts
        slave: 2
        address: 4
        input_type: input
        data_type: float32
        precision: 2
        unit_of_measurement: V
        device_class: voltage
      - name: frequency
        unique_id: frequency
        address: 70
        precision: 2
        input_type: input
        slave: 2
        data_type: float32
        unit_of_measurement: Hz
      - name: L1_KW
        unique_id: L1_KW
        address: 12
        precision: 2
        input_type: input
        slave: 2
        scale: 0.001
        data_type: float32
        unit_of_measurement: KW
      - name: L2_KW
        unique_id: L2_KW
        address: 14
        precision: 2
        input_type: input
        slave: 2
        scale: 0.001
        data_type: float32
        unit_of_measurement: KW
      - name: L3_KW
        unique_id: L3_KW
        address: 16
        precision: 2
        input_type: input
        slave: 2
        scale: 0.001
        data_type: float32
        unit_of_measurement: KW
      - name: total_power_KW
        unique_id: totaal_KW
        address: 52
        precision: 2
        input_type: input
        slave: 2
        scale: 0.001
        data_type: float32
        unit_of_measurement: KW

Hello, how do you differentiate the individual electricity meters, any photos of the screens.
Thank you.

What do you mean? In HA configuration, or the configuration of the power meters?

Your power meters need to be configured to different addresses. Then, in HA, you basically use these addresses to talk to the devices. I am happy to share some pictures, but it would be great if you could tell a bit more on what you want to know.

For the power meter, here’s a manual: https://www.photovoltaikforum.com/core/attachment/153858-sdm630-modbus-v2-manual-incl-protocoll-pdf/

Page 14 shows how to set the address on the SDM630. In HA the device address is mentioned in the YAML as ‘slave’. That is what you use to differentiate between different devices. Note that ‘address’ means a different address within a device to read different values (power, amps, volts, etc…). It is typically called coil, register, location or address.

Hello, I am concerned with how to easily add data from only one specific electricity meter to the HA control panel, when there will be more electricity meters (approx. 30 units). I would have multiple control panels in HA, each with one meter.
Thank you.
I can’t speak English, translate by Google.

Hello, I understand the address settings in the SDM630 electricity meter and the slave in YAML. I found your YAML where sdm630a and sdm630b are. How to easily create one control panel in HA for sdm630a only and another control panel for sdm630b only.
Thank you.