question

thomasw-1 avatar image
thomasw-1 asked

Eastron SDM630/SDM230 Modbus Energy Meter - community edition

======================================================================
Important Note
Support of SDM630 is continued in thread "Power Meter lib for Modbus-RTU-based meters from ABB, Carlo Gavazzi (Victron) and Eastron", the support of SDM230 is deprecated.

======================================================================

Update history

version 1.2

  • Support of legacy meter SDM630v1
    meter is only supported, if configured with baudrate >= 9600

version 1.1:

  • Support of SDM230
    (limited support - requires manual adaptation since device id is not supported on that device type - details see below)
    Thanks to Sergio for allowing access to his environment
  • Addition of supported product ID > shown properly in VRM

======================================================================

Hi All,

I like to share an implementation for support of the Eastron SDM630-Modbus and SDM230-Modbus v2 energy meters.
For any usage a donation to seashepherd.org with an amount of 5 USD/EUR/GBP or equivalent is expected.

Installation

  • copy Eastron SDM meters v1.2.zip -file into directory /opt/victronenergy/dbus-modbus-client and unzip it.
  • Add following bold-marked line into file /opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py
    import carlo_gavazzi
    import Eastron_SDM630v2 (in case you use another meter version apply alternatively expression "Eastron_SDM230" or "Eastron_SDM630v1" instead of "Eastron_SDM630v2 ")
    import ev_charger
    import smappee
  • rename file /opt/victronenergy/dbus-modbus-client/dbus-modbus-client.pyc into /opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py.orig
  • Since that file is not automatically compiled by VenusOS execute following bold marked commands in directory /opt/victronenergy/dbus-modbus-client
    python
    Python 2.7.18 (default, Apr 15 2021, 10:46:30)
    [GCC 9.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import py_compile
    >>> py_compile.compile ('dbus-modbus-client.py')
    >>> exit()
  • reboot VenusOS

  • SDM230 specific:
    Since SDM230 does not support device id, the device must be identified by serial id.
    In order to do so:
    • Read serial ID with holding register FC00 (unsigned int32) from SDM device
      result e.g. 20084317 (using a tool like e.g. modbus poll, iobroker or node red)
    • convert id into hex: 20084317 >> 0132 765D
    • take first 2 hex-bytes (0132) and convert it back into int (here 306)
    • configure that number in file Eastron_SDM230.py
      1627119618938.png
    • in case you use more meters in parallel multiply setting like in this exampe ID "84".

  • Go to "Settings" > "Modbus TCP devices" and perform a "Scan for Devices" or directy add a device via "Devices" > "Add" using relevant IP and ModBus ID and port. Last option is much quicker and also supports non-default unit-IDs.
    A few seconds later the meter should appear in your main menu:
    1618745796225.png
  • Select in submenu "Setup" the usage as grid, pvinverter or generator meter
    1618745887195.png

Main page screenshot

1618745382616.png

Device screenshot1618745459392.png
Comments:

  • Firmware register is not filled by devices (so no modul issue).
  • In above screenshots don't be misled by empty phases 2 and 3. In test environment I had only phase 1 connected. Phase config is dependent of device configuration.
    As soon as meter is configured with 1 phase support only, driver detects circumstance and excludes remaining phases.
    1618748013891.png

Important: The installation is not resistent for VenusOS updates. After an update to another release installation has to be repeated.

Exclusion of liability: Although the module has been tested in depth, I don't take any liabilty for any potential damage on your installation

Thanks to Victron for their open platform and especially for the support of Matthijs Vader.

Energy MeterModbus TCP
11 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mark232 avatar image mark232 commented ·

Hello. it is possible that if I added this data to the configuration, it would be able to send data via modbus to another device. I don't need venus to process it on the display.

class Eastron_Meter_3P(Eastron_Meter_1P):
def phase_regs(self, n):
s = 2 * (n - 1)
return [
Reg_f32b(0x0000 + s, '/Ac/L%d/Voltage' % n, 1, '%.1f V'),
Reg_f32b(0x0006 + s, '/Ac/L%d/Current' % n, 1, '%.1f A'),
Reg_f32b(0x000c + s, '/Ac/L%d/Power' % n, 1, '%.1f W'),

Reg_f32b(0x0012 + s, '/AC/L%d/PowerVAr' % n, 1, '%.1f VAr'),
Reg_f32b(0x015a + s, '/Ac/L%d/Energy/Forward' % n, 1, '%.1f kWh'),
Reg_f32b(0x0160 + s, '/Ac/L%d/Energy/Reverse' % n, 1, '%.1f kWh'),

Or any other data..

0 Likes 0 ·