Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nmakel committed Oct 6, 2022
1 parent 7f74bed commit bdb0001
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
sdm_modbus is a python library that collects data from Eastron SDM single- and three-phase kWh meters over Modbus RTU or Modbus TCP.

Supported devices:
* [Eastron SDM72D-M V2](https://xn--stromzhler-v5a.eu/media/pdf/93/17/d7/SDM72DM-V2.pdf)
* [Eastron SDM72D-M](https://www.eastroneurope.com/products/view/sdm72modbus)
* [Eastron SDM72D-M v2](https://xn--stromzhler-v5a.eu/media/pdf/93/17/d7/SDM72DM-V2.pdf)
* [Eastron SDM120-Modbus](https://www.eastroneurope.com/products/view/sdm120modbus)
* [Eastron SDM230-Modbus](https://www.eastroneurope.com/products/view/sdm230modbus)
* [Eastron SDM630-Modbus](https://www.eastroneurope.com/products/view/sdm630modbus)
Expand Down
13 changes: 9 additions & 4 deletions src/sdm_modbus/sdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class SDM(meter.Meter):
pass


class SDM72V2(SDM):

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -55,22 +56,26 @@ def __init__(self, *args, **kwargs):
"import_total_power_active": (0x0500, 2, meter.registerType.INPUT, meter.registerDataType.FLOAT32, float, "Total Import Power (Active)", "W", 4, 1),
"export_total_power_active": (0x0502, 2, meter.registerType.INPUT, meter.registerDataType.FLOAT32, float, "Total Export Power (Active)", "W", 4, 1),

"system_type": (0x000a, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "System Type", [-1, "1P2W", "3P4W"], 1, 1),
"system_type": (0x000a, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "System Type", [
-1, "1P2W", "3P4W"], 1, 1),
"relay_pulse_width": (0x000c, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Relay Pulse Width", "ms", 1, 1),
"kppa": (0x000e, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Key Parameter Programming Authorization", [0, 1], 1, 1),
"network_parity_stop": (0x0012, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Network Parity Stop", [
"N-1", "E-1", "O-1", "N-2"], 1, 1),
"meter_id": (0x0014, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Modbus Address", "", 1, 1),
"pulse_constant": (0x0016, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Pulse Constant", [" 1000imp/kWh", "100imp/kWh", "10imp/kWh", "1imp/kWh"], 1, 1),
"pulse_constant": (0x0016, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Pulse Constant", [
"1000imp/kWh", "100imp/kWh", "10imp/kWh", "1imp/kWh"], 1, 1),
"password": (0x0018, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Password", "", 1, 1),
"baud": (0x001c, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Baud Rate", [
2400, 4800, 9600, 19200, 38400], 1, 1),
"auto_scroll": (0x003a, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Auto Scroll Display Time", "", 1, 1),
"backlit_time": (0x003c, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Backlit Time", "", 1, 1),
"pulse1_energy": (0x0056, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Pulse 1 Energy Type", ["import active energy", "total active energy", "export active energy, (default)"], 1, 1),
"backlit_time": (0x003c, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Backlight Timeout", "", 1, 1),
"pulse1_energy": (0x0056, 2, meter.registerType.HOLDING, meter.registerDataType.FLOAT32, int, "Pulse 1 Energy Type", [
"Import Energy (Active)", "Total Energy (Active)", "Export Energy (Active)"], 1, 1),
"reset_history": (0xf010, 2, meter.registerType.HOLDING, meter.registerDataType.INT16, int, "Reset Historical Data", 0x0003, 1, 1)
}


class SDM72(SDM):

def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit bdb0001

Please sign in to comment.