Energy metering with Eastron SDM630 v2 Modbus

@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.

Hello, I think I already know how to do it. I’ll set up my first control panel and then copy the code. I’ll just replace the sdm630a with the sdm630c.

Excellent. If you have 30 units, that is lot. I’d love to see some pictures of that. Also, you may want to use something else then A, B, C, etc… maybe the address of the device. When doing that, you also can easily use search and replace on on the YAML.

Hello, that’s just my goal (30 pcs). I just got the SDM630 and HA connection now. My next problem is creating a network between buildings. Only some of the buildings have an Ethernet cable.

Hello,
I would like to buy a SDM630 Modbus and it seems that only the V3 version is available.
What changes between versions V2 and V3?
Do they have the same register numbers?
Thanks

Hi, i am also using V3. I is working, too!

I’m strugging getting data returned from my Eastron SDM630 Modbus in combination with a Waveshare RS485 to ETH (B) device. I have read all the posts above and tried many of the examples but still no result.
The error message I consistently get for all entities is:

Eastron Modbus: Error: device: 103 address: 72 -> Modbus Error: [Input/Output] ERROR: No response received after 3 retries

My yaml:

  - name: "Eastron Modbus"
    type: rtuovertcp
    host: 192.168.200.78
    port: 502
    delay: 10                        # default = 0
    timeout: 10                      # default = 5
    message_wait_milliseconds: 1000  # default = 30 for serial
    sensors:
      - name: WP-Eastron import kWh
        unique_id: wp_eastron_import_kwh
        data_type: float32
        precision: 2
        scale: 0.01
        address: 72
        input_type: input
        slave: 103
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy

  - name: "Nibe S1255"
    type: tcp
    host: 192.168.200.74
    port: 502
    sensors:
<<etcetera>>

It seems my Waveshare device is operating as it should since I see the correct lights (Link light = blue, Active light = blue so it should be returning data). I’m using baudrate 9.6k, parity none, stop bits 1 on both the Waveshare and SDM630. I have triple checked my modbus addresses (101 and 103; in addition I have also connected a Nibe heat pump which uses address 1 and no problem in receiving data from this device).

What else have I tried in various combinations (without result):

  • Baudrate 38400
  • Protocol Modbus TCP to RTU
  • type ‘rtuovertcp’ as well as ‘tcp’
    I notice in previous posts the use of ‘count: 2’ and ‘float32’ to specify sensors. However, I’m getting an error message when I use this (float32 already specifies 2 registers to read)

What am I overlooking?

(This is a continuation of the previous post)

@fsfikke @jghek can you perhaps have a look at my problem … thanks in advance.

I have reset my RS485-to-ETH to factory defaults and changed the IP adress to DHCP (static 192.168.200.78), port 502, work mode ‘TCP Server’ (default), 9600 baud.
I can access the converter with Modbus Master app. However, I consistently get an Error code 2 (‘Illegal address’). See attached screenshot (modbus instruction and resulting error code visible at bottom of screenshot).

Can you suggest what I could try …?

Just saw your post, and I’ve had a long day. :roll_eyes:
So, just from the top of my head… I do remember that you have to offset by 1.

Also, it is a good idea to start at 9600 baud. The quality of data transmission is basically this in combination with the quality of your cabling.

Thanks for the response.

I also tried different baudrates but this didn’t make any difference.

I also tried start address 1 but this also didn’t make a difference. I attached an over view of the first few SDM630 input registers below. I still think the addresses should be even and starting from 0, 2, 4 etc.

What I did discover just now is that even with the SDM630 not connected to the RS485-to-ETH converter, the error message is still the same “Illegal address”. That strikes me as odd.

Any suggestions?

@jghek

I used another modbus analyzer (QdModMaster instead of Modbus Master). QdModMaster gives more and better detail wrt response codes:

  1. when querying the ‘modbus diagnostics’ QdModMaster clearly distinguishes between the SDM630 being connected to the gateway (response ‘Read diagnostics data failed. Error : Timeout’) or not (response ‘not connected’). My conclusion is that my SDM630 is connected.

  2. When trying to read an address the response is consistently ‘Read data failed. Error : Timeout’

QUESTION: One earlier remark above was to swap the A and B labelled connectors (+ and -). Can I try this without damaging the gateway or SDM630?

I have 4 eastron SDM 72DM also with modbus which I have to connect to my HA Server running on a Pi 4 roughly 35m aways (cable meter).

Any recommendations what to look for and what would be usefull ?
ESP Data Collector or is there a hub that could collect the data of these 4 and send those via LAN ?

LAN and WLAN are available - otherwise I would have to lay a new 35 m long LAN cable to use its 4x twisted pair cables for the 4 eastron SDM72 meter.

Here is a more detailed project description

yes, you can switch them around. But usually there is clear description from the meter and which pin to be use on the adapter or maybe inverter.

Might be good to show your current wiring too. Cause it is quite unusual in my opinion.

If you have the right wires connected properly then the FIRST SIGN should be that you should see a TELEPHON RECEIVER in the upper left corner, you know back from the 80s

image
This is a photo which I had put together to make it clear.

Right wires (usually people tend to use a LAN Cable with 4 twisted pair wires) and properly connected is key.
If you are starting always try to start with a short pair of cables first cause that makes things a lot easier.
I did it with an old LAN cable where I had cut off the RJ 45 plugs on one site and used the other RJ45 on the inverter side.
WHen that had worked for me I added a double clutch to the cable as connector cause I added a 35 m long lang cable which made a total length of 37 m. I took the LAN and went throught the rooms of the house to the inverter room to do the next checke if the SDM could communicate again this time with the inverter. Once it had worked out I started to finaly pull the wire via attic and roof as the final solution.

Did work out for me quite well

Maybe a little late but I created a list of all sensors that can be exported from this smartmeter. Here it is Homeassistant Sensor configuration for EASTRON SDM630 V3 · GitHub

Hi guys,
I have this meter connected to HA and hardware/ software wise everything is working. The thing I cannot figure out is how to setup the energy meter in terms actual data… I have the meter connected at the entry of my 3 phase installation. The energy can flow in and out. My question is:

Which registers exactly, and how recalculated, can be used to get the actual balance of energy (in kWh) that is present at the moment? I mean here, there must be a better way than integrating the power on each phase and summing it? The thing I dont get about this meter is why is it summuing the import anx export kWh values instead of subtracting one from another.

Also, how to hook it up with the Energy panel in home assistant?

I would appreciate all feedback!