From 32a1f9f2cc47f821a6a417cdc54df08543796217 Mon Sep 17 00:00:00 2001 From: HotNoob Date: Fri, 8 Mar 2024 19:20:37 -0600 Subject: [PATCH 01/11] clean debug --- inverter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inverter.py b/inverter.py index 049d889..84438cd 100644 --- a/inverter.py +++ b/inverter.py @@ -181,14 +181,13 @@ def read_registers(self, ranges : list[tuple] = None, start : int = 0, end : int retry -= 1 if retry < 0: retry = 0 + #combine registers into "registry" - print("combine results, " + str(len(register.registers))) i = -1 while(i := i + 1 ) < range[1]: #print(str(i) + " => " + str(i+range[0])) registry[i+range[0]] = register.registers[i] - print("registry len: " + str(len(registry))) return registry def process_registery(self, registry : dict, map : list[registry_map_entry]) -> dict[str,str]: From 594343aec58d63a38fe121a696ec76cbca2f167f Mon Sep 17 00:00:00 2001 From: HotNoob Date: Fri, 8 Mar 2024 19:28:28 -0600 Subject: [PATCH 02/11] version check / warning --- invertermodbustomqtt.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/invertermodbustomqtt.py b/invertermodbustomqtt.py index a160cf7..24bc15f 100644 --- a/invertermodbustomqtt.py +++ b/invertermodbustomqtt.py @@ -2,11 +2,25 @@ """ Main module for Growatt / Inverters ModBus RTU data to MQTT """ + + +import sys +import time + +# Check if Python version is greater than 3.9 +if sys.version_info < (3, 9): + print("==================================================") + print("WARNING: python version 3.9 or higher is recommended") + print("Current version: " + sys.version) + print("Please upgrade your python version to 3.9") + print("==================================================") + time.sleep(4) + import atexit import glob import random import re -import time + import os import json import logging From 30d5fcfdedb6a9507c42025c8d59453c1cb58424 Mon Sep 17 00:00:00 2001 From: HotNoob Date: Tue, 12 Mar 2024 17:29:07 -0500 Subject: [PATCH 03/11] sok sn protocol --- invertermodbustomqtt.py | 1 - protocols/pace_bms_v1.3.holding_registry_map.csv | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/invertermodbustomqtt.py b/invertermodbustomqtt.py index 24bc15f..b40bcee 100644 --- a/invertermodbustomqtt.py +++ b/invertermodbustomqtt.py @@ -36,7 +36,6 @@ from protocol_settings import protocol_settings,Data_Type,registry_map_entry,Registry_Type - __logo = """ ____ _ _ ____ __ __ ___ _____ _____ / ___|_ __ _____ ____ _| |_| |_|___ \| \/ |/ _ \_ _|_ _| diff --git a/protocols/pace_bms_v1.3.holding_registry_map.csv b/protocols/pace_bms_v1.3.holding_registry_map.csv index 01d28e1..b08fc54 100644 --- a/protocols/pace_bms_v1.3.holding_registry_map.csv +++ b/protocols/pace_bms_v1.3.holding_registry_map.csv @@ -103,4 +103,4 @@ variable name;data type;register;documented name;length;writeable;unit;values;no ;UINT8;114;Charging OC-2 protection delay time;2byte;RW;0.025S;1~255;; ;;0150-0159;Version information;20byte;R;ASCII;;; ;;0160-0169;Model SN;20byte;RW;ASCII;;BMS Manufacturer; -;;0170-0179;PACK SN;20byte;RW;ASCII;;PACK Manufacturer; +Serial Number ;ASCII;0170-0179;PACK SN;20byte;RW;ASCII;;PACK Manufacturer; From b8dde82764ba1ab32611a5a6049dbe45e6d425a3 Mon Sep 17 00:00:00 2001 From: HotNoob Date: Tue, 12 Mar 2024 17:31:15 -0500 Subject: [PATCH 04/11] Update pace_bms_v1.3.holding_registry_map.csv --- protocols/pace_bms_v1.3.holding_registry_map.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/pace_bms_v1.3.holding_registry_map.csv b/protocols/pace_bms_v1.3.holding_registry_map.csv index b08fc54..b82b202 100644 --- a/protocols/pace_bms_v1.3.holding_registry_map.csv +++ b/protocols/pace_bms_v1.3.holding_registry_map.csv @@ -103,4 +103,4 @@ variable name;data type;register;documented name;length;writeable;unit;values;no ;UINT8;114;Charging OC-2 protection delay time;2byte;RW;0.025S;1~255;; ;;0150-0159;Version information;20byte;R;ASCII;;; ;;0160-0169;Model SN;20byte;RW;ASCII;;BMS Manufacturer; -Serial Number ;ASCII;0170-0179;PACK SN;20byte;RW;ASCII;;PACK Manufacturer; +Serial Number;ASCII;0170-0179;PACK SN;20byte;RW;ASCII;;PACK Manufacturer; From 594a999554c209c78646f97099e067ddb57d0ce8 Mon Sep 17 00:00:00 2001 From: HotNoob Date: Sat, 23 Mar 2024 10:19:57 -0500 Subject: [PATCH 05/11] modularize modbus rtu reader modularize readers so can support multiple registry type readers. ie, pace, and other "customized" registry type protocols. --- inverter.py | 79 ++++++++----------------------- invertermodbustomqtt.py | 25 +++------- protocol_settings.py | 6 +++ protocols/eg4_v58.json | 1 + protocols/growatt_2020_v1.24.json | 1 + protocols/pace_bms_v1.3.json | 1 + protocols/sigineer_v0.11.json | 1 + protocols/v0.14.json | 1 + readers/modbus_rtu.py | 30 ++++++++++++ readers/pace.py | 3 ++ readers/reader_base.py | 9 ++++ 11 files changed, 80 insertions(+), 77 deletions(-) create mode 100644 readers/modbus_rtu.py create mode 100644 readers/pace.py create mode 100644 readers/reader_base.py diff --git a/inverter.py b/inverter.py index 84438cd..bfc7bef 100644 --- a/inverter.py +++ b/inverter.py @@ -5,12 +5,14 @@ import logging import re import time -import struct +import importlib + from pymodbus.exceptions import ModbusIOException from typing import TYPE_CHECKING if TYPE_CHECKING: from pymodbus.client.sync import ModbusSerialClient as ModbusClient + from readers.reader_base import reader_base from protocol_settings import Data_Type, registry_map_entry, protocol_settings, Registry_Type @@ -20,15 +22,18 @@ class Inverter: max_precision : int modbus_delay : float = 0.85 modbus_version = "" + reader : reader_base + settings : dict[str, str] '''time inbetween requests''' - def __init__(self, client, name, unit, protocol_version, max_precision : int = -1, log = None): - self.client : ModbusClient = client + def __init__(self, name, unit, protocol_version, settings : dict[str,str], max_precision : int = -1, log = None): self.name = name self.unit = unit self.protocol_version = protocol_version self.max_precision = max_precision + self.settings = settings + print("max_precision: " + str(self.max_precision)) if (log is None): self.__log = log @@ -39,6 +44,16 @@ def __init__(self, client, name, unit, protocol_version, max_precision : int = - #load protocol settings self.protocolSettings = protocol_settings(self.protocol_version) + #load reader + # Import the module + module = importlib.import_module(self.protocolSettings.reader) + + # Get the class from the module + cls = getattr(module, self.protocolSettings.reader) + + self.reader : reader_base = cls(self.protocolSettings, self.settings) + self.reader.connect() + self.read_info() def read_serial_number(self) -> str: @@ -57,7 +72,7 @@ def read_serial_number(self) -> str: registry_entry = self.protocolSettings.get_holding_registry_entry(field) if registry_entry is not None: self.__log.info("Reading " + field + "("+str(registry_entry.register)+")") - data = self.client.read_holding_registers(registry_entry.register) + data = self.reader.read_registers(registry_entry.register, registry_type=Registry_Type.HOLDING) if not hasattr(data, 'registers') or data.registers is None: self.__log.critical("Failed to get serial number register ("+field+") ; exiting") exit() @@ -146,12 +161,7 @@ def read_registers(self, ranges : list[tuple] = None, start : int = 0, end : int isError = False try: - if registry_type == Registry_Type.INPUT: - register = self.client.read_input_registers(range[0], range[1], unit=self.unit) - else: - print("get holding") - register = self.client.read_holding_registers(range[0], range[1], unit=self.unit) - #register.addCallback + register = self.reader.read_registers(range[0], range[1], registry_type=registry_type, unit=self.unit) except ModbusIOException as e: print("ModbusIOException : ", e.error_code) @@ -315,51 +325,4 @@ def read_holding_registry(self) -> dict[str,str]: registry = self.read_registers(self.protocolSettings.holding_registry_ranges, registry_type=Registry_Type.HOLDING) info = self.process_registery(registry, self.protocolSettings.holding_registry_map) - return info - - - # def read_fault_table(self, name, base_index, count): - # fault_table = {} - # for i in range(0, count): - # fault_table[name + '_' + str(i)] = self.read_fault_record(base_index + i * 5) - # return fault_table - # - # def read_fault_record(self, index): - # row = self.client.read_input_registers(index, 5, unit=self.unit) - # # TODO: Figure out how to read the date for these records? - # print(row.registers[0], - # ErrorCodes[row.registers[0]], - # '\n', - # row.registers[1], - # row.registers[2], - # row.registers[3], - # '\n', - # 2000 + (row.registers[1] >> 8), - # row.registers[1] & 0xFF, - # row.registers[2] >> 8, - # row.registers[2] & 0xFF, - # row.registers[3] >> 8, - # row.registers[3] & 0xFF, - # row.registers[4], - # '\n', - # 2000 + (row.registers[1] >> 4), - # row.registers[1] & 0xF, - # row.registers[2] >> 4, - # row.registers[2] & 0xF, - # row.registers[3] >> 4, - # row.registers[3] & 0xF, - # row.registers[4] - # ) - # return { - # 'FaultCode': row.registers[0], - # 'Fault': ErrorCodes[row.registers[0]], - # #'Time': int(datetime.datetime( - # # 2000 + (row.registers[1] >> 8), - # # row.registers[1] & 0xFF, - # # row.registers[2] >> 8, - # # row.registers[2] & 0xFF, - # # row.registers[3] >> 8, - # # row.registers[3] & 0xFF - # #).timestamp()), - # 'Value': row.registers[4] - # } + return info \ No newline at end of file diff --git a/invertermodbustomqtt.py b/invertermodbustomqtt.py index b40bcee..18b1304 100644 --- a/invertermodbustomqtt.py +++ b/invertermodbustomqtt.py @@ -30,7 +30,6 @@ import paho.mqtt.client as mqtt from paho.mqtt.properties import Properties from paho.mqtt.packettypes import PacketTypes -from pymodbus.client.sync import ModbusSerialClient as ModbusClient from inverter import Inverter @@ -63,8 +62,6 @@ class InverterModBusToMQTT: __port = None # baudrate to access modbus connection __baudrate = -1 - # modbus client handle - __client = None # mqtt server host address __mqtt_host = None # mqtt client handle @@ -170,21 +167,6 @@ def init_invertermodbustomqtt(self): self.__log.setLevel(logging.getLevelName(self.__log_level)) - - self.__log.info('Setup Serial Connection... ') - self.__port = self.__settings.get( - 'serial', 'port', fallback='/dev/ttyUSB0') - self.__baudrate = self.__settings.get( - 'serial', 'baudrate', fallback=9600) - - - self.__client = ModbusClient(method='rtu', port=self.__port, - baudrate=int(self.__baudrate), - stopbits=1, parity='N', bytesize=8, timeout=2 - ) - self.__client.connect() - self.__log.info('Serial connection established...') - self.__log.info("start connection mqtt ...") self.__mqtt_host = self.__settings.get( 'mqtt', 'host', fallback='mqtt.eclipseprojects.io') @@ -222,7 +204,12 @@ def init_invertermodbustomqtt(self): self.__send_holding_register = self.__settings.getboolean(section, 'send_holding_register', fallback=False) self.__send_input_register = self.__settings.getboolean(section, 'send_input_register', fallback=True) self.measurement = self.__settings.get(section, 'measurement', fallback="") - self.inverter = Inverter(self.__client, name, unit, protocol_version, self.__max_precision, self.__log) + + reader_settings : dict[str, object] = {} + reader_settings["port"] = self.__settings.get('serial', 'port', fallback='/dev/ttyUSB0') + reader_settings["baudrate"] = self.__settings.getint('serial', 'baudrate', fallback=9600) + + self.inverter = Inverter(name, unit, protocol_version, settings=reader_settings, max_precision=self.__max_precision, log=self.__log) self.inverter.print_info() diff --git a/protocol_settings.py b/protocol_settings.py index 5008b1c..dc72a19 100644 --- a/protocol_settings.py +++ b/protocol_settings.py @@ -105,6 +105,7 @@ class registry_map_entry: class protocol_settings: protocol : str + reader : str settings_dir : str variable_mask : list[str] input_registry_map : list[registry_map_entry] @@ -130,6 +131,11 @@ def __init__(self, protocol : str, settings_dir : str = 'protocols'): self.variable_mask.append(line.strip().lower()) self.load__codes() #load first, so priority to json codes + if "reader" in self.codes: + self.reader = self.codes["reader"] + else: + self.reader = "modbus_rtu" + self.load__input_registry_map() self.load__holding_registry_map() diff --git a/protocols/eg4_v58.json b/protocols/eg4_v58.json index 7a73a41..329a819 100644 --- a/protocols/eg4_v58.json +++ b/protocols/eg4_v58.json @@ -1,2 +1,3 @@ { + "reader" : "modbus_rtu" } \ No newline at end of file diff --git a/protocols/growatt_2020_v1.24.json b/protocols/growatt_2020_v1.24.json index aa81f1e..4643488 100644 --- a/protocols/growatt_2020_v1.24.json +++ b/protocols/growatt_2020_v1.24.json @@ -1,4 +1,5 @@ { + "reader" : "modbus_rtu", "empty_codes" : { "0" : "TODO" diff --git a/protocols/pace_bms_v1.3.json b/protocols/pace_bms_v1.3.json index dd14c4d..99f812f 100644 --- a/protocols/pace_bms_v1.3.json +++ b/protocols/pace_bms_v1.3.json @@ -1,4 +1,5 @@ { + "reader" : "pace", "warning_flag_codes": { "b0" : "battery cell overvoltage alarm", diff --git a/protocols/sigineer_v0.11.json b/protocols/sigineer_v0.11.json index 6c37d06..82c4b90 100644 --- a/protocols/sigineer_v0.11.json +++ b/protocols/sigineer_v0.11.json @@ -1,4 +1,5 @@ { + "reader" : "modbus_rtu", "system_status_codes" : { "0" : "StandBy", diff --git a/protocols/v0.14.json b/protocols/v0.14.json index 19beaa8..9a1ea02 100644 --- a/protocols/v0.14.json +++ b/protocols/v0.14.json @@ -1,4 +1,5 @@ { + "reader" : "modbus_rtu", "system_status_codes" : { "0" : "StandBy", diff --git a/readers/modbus_rtu.py b/readers/modbus_rtu.py new file mode 100644 index 0000000..189759c --- /dev/null +++ b/readers/modbus_rtu.py @@ -0,0 +1,30 @@ +from protocol_settings import Registry_Type +from pymodbus.client.sync import ModbusSerialClient as ModbusClient +from reader_base import reader_base + +class modbus_rtu(reader_base): + port : str = "/dev/ttyUSB0" + baudrate : int = 9600 + client : ModbusClient + + def __init__(self, settings : dict[str,str]): + + if "port" in settings: + self.port = settings["port"] + + if "buadrate" in settings: + self.baudrate = settings["buadrate"] + + self.client = ModbusClient(method='rtu', port=self.__port, + baudrate=int(self.__baudrate), + stopbits=1, parity='N', bytesize=8, timeout=2 + ) + + def read_registers(self, start, count=1, registry_type : Registry_Type = Registry_Type.INPUT, **kwargs): + if registry_type == Registry_Type.INPUT: + return self.client.read_input_registers(start, count, **kwargs) + elif registry_type == Registry_Type.HOLDING: + return self.client.read_holding_registers(start, count, **kwargs) + + def connect(self): + self.client.connect() diff --git a/readers/pace.py b/readers/pace.py new file mode 100644 index 0000000..989bd84 --- /dev/null +++ b/readers/pace.py @@ -0,0 +1,3 @@ +class pace: + def __init__(self): + pass diff --git a/readers/reader_base.py b/readers/reader_base.py new file mode 100644 index 0000000..d3b6913 --- /dev/null +++ b/readers/reader_base.py @@ -0,0 +1,9 @@ +from protocol_settings import Registry_Type + + +class reader_base: + def connect(): + pass + + def read_registers(start, count=1, registry_type : Registry_Type = Registry_Type.INPUT, **kwargs): + pass \ No newline at end of file From ca6bf8d7620eedf46b4a682058a342a190f4c41c Mon Sep 17 00:00:00 2001 From: HotNoob Date: Sat, 23 Mar 2024 10:23:39 -0500 Subject: [PATCH 06/11] Update protocol_settings.py --- protocol_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol_settings.py b/protocol_settings.py index dc72a19..c60e142 100644 --- a/protocol_settings.py +++ b/protocol_settings.py @@ -208,8 +208,8 @@ def load__registry(self, path, registry_type : Registry_Type = Registry_Type.INP row['documented name'] = row['documented name'].strip().lower().replace(' ', '_') variable_name = row['variable name'] if row['variable name'] else row['documented name'] - variable_name = variable_name.lower().replace(' ', '_').replace('__', '_') #clean name - + variable_name = variable_name = variable_name.strip().lower().replace(' ', '_').replace('__', '_') #clean name + if re.search("[^a-zA-Z0-9\_]", variable_name) : print("WARNING Invalid Name : " + str(variable_name) + " reg: " + str(row['register']) + " doc name: " + str(row['documented name']) + " path: " + str(path)) From 94f1c5edd9301982038e3e4eb62f7b99e4475405 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 23 Mar 2024 16:39:46 +0000 Subject: [PATCH 07/11] debugging pace modbus; might be bad rs485 adapter --- inverter.py | 6 +- readers/modbus_rtu.py | 9 ++- readers/pace.py | 129 ++++++++++++++++++++++++++++++++++++++++- readers/reader_base.py | 3 + 4 files changed, 139 insertions(+), 8 deletions(-) diff --git a/inverter.py b/inverter.py index bfc7bef..8f33638 100644 --- a/inverter.py +++ b/inverter.py @@ -12,8 +12,8 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: from pymodbus.client.sync import ModbusSerialClient as ModbusClient - from readers.reader_base import reader_base +from readers.reader_base import reader_base from protocol_settings import Data_Type, registry_map_entry, protocol_settings, Registry_Type class Inverter: @@ -46,12 +46,12 @@ def __init__(self, name, unit, protocol_version, settings : dict[str,str], max_p #load reader # Import the module - module = importlib.import_module(self.protocolSettings.reader) + module = importlib.import_module('readers.'+self.protocolSettings.reader) # Get the class from the module cls = getattr(module, self.protocolSettings.reader) - self.reader : reader_base = cls(self.protocolSettings, self.settings) + self.reader : reader_base = cls(self.settings) self.reader.connect() self.read_info() diff --git a/readers/modbus_rtu.py b/readers/modbus_rtu.py index 189759c..902f240 100644 --- a/readers/modbus_rtu.py +++ b/readers/modbus_rtu.py @@ -1,6 +1,7 @@ +import logging from protocol_settings import Registry_Type from pymodbus.client.sync import ModbusSerialClient as ModbusClient -from reader_base import reader_base +from .reader_base import reader_base class modbus_rtu(reader_base): port : str = "/dev/ttyUSB0" @@ -8,6 +9,8 @@ class modbus_rtu(reader_base): client : ModbusClient def __init__(self, settings : dict[str,str]): + #logger = logging.getLogger(__name__) + #logging.basicConfig(level=logging.DEBUG) if "port" in settings: self.port = settings["port"] @@ -15,8 +18,8 @@ def __init__(self, settings : dict[str,str]): if "buadrate" in settings: self.baudrate = settings["buadrate"] - self.client = ModbusClient(method='rtu', port=self.__port, - baudrate=int(self.__baudrate), + self.client = ModbusClient(method='rtu', port=self.port, + baudrate=int(self.baudrate), stopbits=1, parity='N', bytesize=8, timeout=2 ) diff --git a/readers/pace.py b/readers/pace.py index 989bd84..e890ed7 100644 --- a/readers/pace.py +++ b/readers/pace.py @@ -1,3 +1,128 @@ +import time +import logging +from protocol_settings import Registry_Type +from pymodbus.client.sync import ModbusSerialClient + + +auchCRCHi = ( +0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, +0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, +0x40, 0x01, 0xC0, +0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, +0x81, 0x40, 0x01, +0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, +0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, +0x00, 0xC1, 0x81, +0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, +0x41, 0x01, 0xC0, +0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, +0x80, 0x41, 0x01, +0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, +0xC1, 0x81, 0x40, +0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, +0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, +0x40, 0x01, 0xC0, +0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, +0x81, 0x40, 0x01, +0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, +0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, +0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, +0x40, 0x01, 0xC0, +0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, +0x80, 0x41, 0x01, +0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, +0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, +0x00, 0xC1, 0x81, 0x40 +) + +auchCRCLo = ( +0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, +0x05, 0xC5, 0xC4, +0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, +0x0B, 0xC9, 0x09, +0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, +0xDF, 0x1F, 0xDD, +0x1D, 0x1C, 0xDC, 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, +0x12, 0x13, 0xD3, +0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32, +0x36, 0xF6, 0xF7, +0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, +0xFE, 0xFA, 0x3A, +0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, +0x2A, 0xEA, 0xEE, +0x2E, 0x2F, 0xEF, 0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, +0xE7, 0xE6, 0x26, +0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1, +0x63, 0xA3, 0xA2, +0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, +0x6D, 0xAF, 0x6F, +0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, +0xB9, 0x79, 0xBB, +0x7B, 0x7A, 0xBA, 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, +0x74, 0x75, 0xB5, +0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0, +0x50, 0x90, 0x91, +0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, +0x54, 0x9C, 0x5C, +0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, +0x58, 0x98, 0x88, +0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, +0x4D, 0x4C, 0x8C, +0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, +0x41, 0x81, 0x80, 0x40 +) + +# Define Custom CRC-16 calculation function +def calculate_crc(puchMsg, usDataLen): + uchCRCHi = 0xFF + uchCRCLo = 0xFF + for _ in range(usDataLen): + uIndex = uchCRCLo ^ puchMsg + uchCRCLo = uchCRCHi ^ auchCRCHi[uIndex] + uchCRCHi = auchCRCLo[uIndex] + puchMsg += 1 + return (uchCRCHi << 8 | uchCRCLo) + +# Subclass ModbusSerialClient +class CustomModbusSerialClient(ModbusSerialClient): + def _calculate_crc(self, message): + # Implement your custom CRC calculation here + return calculate_crc(message, len(message)) + class pace: - def __init__(self): - pass + + port : str = "/dev/ttyUSB0" + baudrate : int = 9600 + client : CustomModbusSerialClient + + def __init__(self, settings : dict[str,str]): + #logger = logging.getLogger(__name__) + #logging.basicConfig(level=logging.DEBUG) + + if "port" in settings: + self.port = settings["port"] + + if "buadrate" in settings: + self.baudrate = settings["buadrate"] + + self.client = CustomModbusSerialClient(method='rtu', port=self.port, + baudrate=int(self.baudrate), + stopbits=1, parity='N', bytesize=8, timeout=2 + ) + + def read_registers(self, start, count=1, registry_type : Registry_Type = Registry_Type.INPUT, **kwargs): + if registry_type == Registry_Type.INPUT: + return self.client.read_input_registers(start, count, **kwargs) + elif registry_type == Registry_Type.HOLDING: + return self.client.read_holding_registers(start, count, **kwargs) + + time.sleep(4) + + def connect(self): + self.client.connect() \ No newline at end of file diff --git a/readers/reader_base.py b/readers/reader_base.py index d3b6913..d27197e 100644 --- a/readers/reader_base.py +++ b/readers/reader_base.py @@ -2,6 +2,9 @@ class reader_base: + def __init__(self, settings : dict[str,str]) -> None: + pass + def connect(): pass From 15dfff0388fa216917aa4b532f311a583328200f Mon Sep 17 00:00:00 2001 From: HotNoob Date: Sat, 23 Mar 2024 23:32:57 +0000 Subject: [PATCH 08/11] bug fix --- protocol_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol_settings.py b/protocol_settings.py index c60e142..f1e743c 100644 --- a/protocol_settings.py +++ b/protocol_settings.py @@ -245,7 +245,7 @@ def load__registry(self, path, registry_type : Registry_Type = Registry_Type.INP codes_json = json.loads(row['values']) value_is_json = True - name = item.documented_name+'_codes' + name = row['documented name']+'_codes' if name not in self.codes: self.codes[name] = codes_json From 49f9cd5e7f49ff228d58f2e287e50c1b046a5844 Mon Sep 17 00:00:00 2001 From: HotNoob Date: Sat, 23 Mar 2024 18:36:59 -0500 Subject: [PATCH 09/11] Update sigineer_v0.11.holding_registry_map.csv --- protocols/sigineer_v0.11.holding_registry_map.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/sigineer_v0.11.holding_registry_map.csv b/protocols/sigineer_v0.11.holding_registry_map.csv index e219519..e2ca7f1 100644 --- a/protocols/sigineer_v0.11.holding_registry_map.csv +++ b/protocols/sigineer_v0.11.holding_registry_map.csv @@ -16,7 +16,7 @@ variable name;data_type;register;documented name;description;customer write;valu ;;20;OverLoadRestart;Over Load Restart;W;"{""0"": ""Yes"", ""1"": ""No"", ""2"": ""Swith to UTI""}";; 2: Swith to UTI;;;0;Yes(over     Load 1mins              to restart;       after over Load three times   to   stop output);;;;;;;; ;;21;OverTempRestart;Over Temperature Restart;W;"{""0"": ""Yes"", ""1"": ""No""}";;;;0;Yes(over Temperature to     restart   ; after            over Temperature three  times  to stop output);;;;;;;;; ;;22;BuzzerEN;Buzzer on/off enable;W;"{""1"": ""Enable"", ""0"": ""Disable""}";;;;1;;;;;;;;;;; -Serial Number;ASCII;23-27;Serial NO 5;Serial number 5;W;;ASCII;;;;;;;;;;;;;; +Serial Number;ASCII;r23-27;Serial NO 5;Serial number 5;W;;ASCII;;;;;;;;;;;;;; ;;28;Moudle H;Inverter Moudle (high);W;;;;Can be set at standy   state Only;;;;;;;;;;;; ;;29;Moudle L;Inverter Moudle (low);W;P-battery type: 0: Lead_Acid;; 2: CustomLead_Acid; U-user type: 0: No verndor; 1: Sigineer; 2: CPS; 3: Haiti; M-power rate: 3: 3KW; 5:5KW; S-Aging; 0: Normal Mode; 1: Aging Mode;;;;Can be set at standy   state Only ;;30;Com Address;Communicate   address;W;1~254;;1;;;;;;;;;;;;; From ea76a66b7bad209c6ce966e42b281d4f9391a57c Mon Sep 17 00:00:00 2001 From: HotNoob Date: Sun, 24 Mar 2024 00:28:48 +0000 Subject: [PATCH 10/11] fix data_type header / add clean function --- inverter.py | 7 +++++-- protocol_settings.py | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/inverter.py b/inverter.py index 8f33638..ee96853 100644 --- a/inverter.py +++ b/inverter.py @@ -143,9 +143,12 @@ def read_registers(self, ranges : list[tuple] = None, start : int = 0, end : int if not ranges: #ranges is empty, use min max ranges = [] - start = -batch_size + start = start - batch_size while( start := start + batch_size ) < end: - ranges.append((start, batch_size)) ##APPEND TUPLE + count = batch_size + if start + batch_size > end: + count = end - start + 1 + ranges.append((start, count)) ##APPEND TUPLE registry : dict[int,] = {} retries = 7 diff --git a/protocol_settings.py b/protocol_settings.py index f1e743c..bfc9f16 100644 --- a/protocol_settings.py +++ b/protocol_settings.py @@ -1,6 +1,7 @@ import csv from dataclasses import dataclass from enum import Enum +import itertools import json import re import os @@ -177,10 +178,21 @@ def load__registry(self, path, registry_type : Registry_Type = Registry_Type.INP if not os.path.exists(path): #return empty is file doesnt exist. return registry_map + def clean_header(iterator): + # Lowercase and strip whitespace from each item in the first row + first_row = next(iterator).lower().replace('_', ' ') + first_row = re.sub(r"\s+;|;\s+", ";", first_row) #trim values + return itertools.chain([first_row], iterator) + + with open(path, newline='', encoding='latin-1') as csvfile: + + #clean column names before passing to csv dict reader + csvfile = clean_header(csvfile) + # Create a CSV reader object - reader = csv.DictReader(csvfile, delimiter=';') #compensate for openoffice - + reader = csv.DictReader(clean_header(csvfile), delimiter=';') #compensate for openoffice + # Iterate over each row in the CSV file for row in reader: @@ -286,8 +298,8 @@ def load__registry(self, path, registry_type : Registry_Type = Registry_Type.INP if end > start: concatenate = True if reverse: - for i in range(end, start, -1): - concatenate_registers.append(i-1) + for i in range(end, start-1, -1): + concatenate_registers.append(i) else: for i in range(start, end+1): concatenate_registers.append(i) From befe33b666d96ee5d7e80e1eaf9132d7b64de32a Mon Sep 17 00:00:00 2001 From: HotNoob Date: Sat, 23 Mar 2024 19:29:17 -0500 Subject: [PATCH 11/11] fix data type headers --- protocols/eg4_v58.input_registry_map.csv | 464 +++++++++--------- .../sigineer_v0.11.holding_registry_map.csv | 2 +- .../sigineer_v0.11.input_registry_map.csv | 2 +- 3 files changed, 234 insertions(+), 234 deletions(-) diff --git a/protocols/eg4_v58.input_registry_map.csv b/protocols/eg4_v58.input_registry_map.csv index 047342c..b9294f4 100644 --- a/protocols/eg4_v58.input_registry_map.csv +++ b/protocols/eg4_v58.input_registry_map.csv @@ -1,232 +1,232 @@ -variable name,data_type,register,documented name,unit,values,note,,,,,,,,,,,, -,,0,State,,0-65535,For more information,,,,,,,,,,,, -PV1 Voltage,,1,Vpv1,0.1V,0-65535,PV1 voltage,,,,,,,,,,,, -PV2 Voltage,,2,Vpv2,0.1V,0-65535,PV2 voltage,,,,,,,,,,,, -PV3 Voltage,,3,Vpv3,0.1V,0-65536,PV3 voltage,,,,,,,,,,,, -,,4,Vbat,0.1V,0-65535,Battery voltage,,,,,,,,,,,, -,8bit,5,SOC,%,0-100,Battery capacity,,,,,,,,,,,, -,8bit,5.b8,SOH,%,0-100,Battery State of health,,,,,,,,,,,, -,,6,Internal Fault,,0-65535,For more information,,,,,,,,,,,, -,,7,Ppv1,W,0-65535,PV1 power/ AC enery storage Ppv,,,,,,,,,,,, -,,8,Ppv2,W,0-65535,PV2 power,,,,,,,,,,,, -,,9,Ppv3,W,0-65536,PV3 power (total PV power,,,,,,,,,,,, -,,10,Pcharge,W,0-65535,Charging power (power flowing into the battery),,,,,,,,,,,, -,,11,Pdischarge,W,0-65535,Discharging power (power flowing out of battery power),,,,,,,,,,,, -,,12,VacR,0.1V,0-65535,R-phase utility grid voltage,,,,,,,,,,,, -,,13,VacS,0.1V,0-65535,S-phase utility grid voltage,,,,,,,,,,,, -,,14,VacT,0.1V,0-65535,T-phase utility grid voltage,,,,,,,,,,,, -Grid Hz,,15,Fac,0.01Hz,0-65535,Utility grid frequency,,,,,,,,,,,, -,,16,Pinv,W,0-65535,On-gird inverter power (For three phase: R phase),,,,,,,,,,,, -,,17,Prec,W,0-65535,AC charging rectification power (For three phase: R phase),,,,,,,,,,,, -,,18,IinvRMS,0.01A,0-65535,Inverter rms current output (For three phase: R phase),,,,,,,,,,,, -,,19,PF,0.001,0-2000,Power factor x?(0,,,,,,,,,,,, -,,20,VepsR,0.1V,0-65535,R phase off-grid output voltage,,,,,,,,,,,, -,,21,VepsS,0.1V,0-65535,S phase off-grid output voltage,,,,,,,,,,,, -,,22,VepsT,0.1V,0-65535,T phase off-grid output voltage,,,,,,,,,,,, -,,23,Feps,0.01Hz,0-65535,Off-grid output frequency,,,,,,,,,,,, -,,24,Peps,W,0-65535,Off-grid inverter power (For three phase: R phase),,,,,,,,,,,, -,,25,Seps,VA,0-65535,Off-grid apparent power (For three phase: R phase),,,,,,,,,,,, -,,26,Ptogrid,W,0-65535,User on-grid power (For three phase: R phase),,,,,,,,,,,, -,,27,Ptouser,W,0-65535,Grid power capacity (For three phase: R phase),,,,,,,,,,,, -,,28,Epv1_day,0.1kWh,0-65535,PV1 power generation today / AC Energy Storage Epv_day,,,,,,,,,,,, -,,29,Epv2_day,0.1kWh,0-65535,PV2 power generation today,,,,,,,,,,,, -,,30,Epv3_day,0.1kWh,0-65535,PV3 power generation today (total PV=PV1+PV2+PV3),,,,,,,,,,,, -,,31,Einv_day,0.1kWh,0-65535,Today's on-grid inverter output energy,,,,,,,,,,,, -,,32,Erec_day,0.1kWh,0-65535,Today's AC charging rectifier energy,,,,,,,,,,,, -,,33,Echg_day,0.1kWh,0-65535,Energy Charge today,,,,,,,,,,,, -,,34,Edischg_day,0.1kWh,0-65535,Energy Discharge today,,,,,,,,,,,, -,,35,Eeps_day,0.1kWh,0-65535,Today's off-grid output energy,,,,,,,,,,,, -,,36,Etogrid_day,0.1kWh,0-65535,Today's export to gird energy,,,,,,,,,,,, -,,37,Etouser_day,0.1kWh,0-65535,Electricity supplied to user from the grid today,,,,,,,,,,,, -,,38,Vbus1,0.1V,0-65535,Voltage of Bus 1,,,,,,,,,,,, -,,39,Vbus2,0.1V,0-65535,Voltage of Bus 2,,,,,,,,,,,, -,,40,Epv1_all L,0.1kWh,0-65535,PV1 cumulative power generation/AC energy storage Epv_all Low byte,,,,,,,,,,,, -,,41,Epv1_all H,0.1kWh,0-65535,PV1 cumulative power generation/AC energy storage Epv_all high byte,,,,,,,,,,,, -,,42,Epv2_all L,0.1kWh,0-65535,PV2 cumulative power generation low byte,,,,,,,,,,,, -,,43,Epv2_all H,0.1kWh,0-65535,PV2 cumulative power generation high byte,,,,,,,,,,,, -,,44,Epv3_all L,0.1kWh,0-65535,PV3 cumulative power generation low byte (total PV=PV1+PV2+PV3),,,,,,,,,,,, -,,45,Epv3_all H,0.1kWh,0-65535,PV3 cumulative power generation high byte (total PV=PV1+PV2+PV3),,,,,,,,,,,, -,,46,Einv_all L,0.1kWh,0-65535,Inverter output accumulated power low byte,,,,,,,,,,,, -,,47,Einv_all H,0.1kWh,0-65535,Inverter output accumulates power high byte,,,,,,,,,,,, -,,48,Erec_all L,0.1kWh,0-65535,AC charging accumulates rectified power Low byte,,,,,,,,,,,, -,,49,Erec_all H,0.1kWh,0-65535,AC charging accumulates rectified power high byte,,,,,,,,,,,, -,,50,Echg_all L,0.1kWh,0-65535,Cumulative charge energy low byte,,,,,,,,,,,, -,,51,Echg_all H,0.1kWh,0-65535,Cumulative charge energy high byte,,,,,,,,,,,, -,,52,Edischg_all L,0.1kWh,0-65535,Cumulative discharge charge energy Low byte,,,,,,,,,,,, -,,53,Edischg_all H,0.1kWh,0-65535,Cumulative discharge charge energy High byte,,,,,,,,,,,, -,,54,Eeps_all L,0.1kWh,0-65535,Cumulative inverter off-grid output energy Low byte,,,,,,,,,,,, -,,55,Eeps_all H,0.1kWh,0-65535,Cumulative inverter off-grid output energy High byte,,,,,,,,,,,, -,,56,Etogrid_all L,0.1kWh,0-65535,Accumulate export energy Low byte,,,,,,,,,,,, -,,57,Etogrid_all H,0.1kWh,0-65535,Accumulate export energy High byte,,,,,,,,,,,, -,,58,Etouser_all L,0.1kWh,0-65535,Cumulative import energy Low byte,,,,,,,,,,,, -,,59,Etouser_all H,0.1kWh,0-65535,Cumulative import energy high byte,,,,,,,,,,,, -,,60,FaultCode L,,0-65535,For more information,,,,,,,,,,,, -,,61,FaultCode H,,0-65535,For more information,,,,,,,,,,,, -,,62,WarningCode L,,0-65535,For more information,,,,,,,,,,,, -,,63,WarningCode H,,0-65535,For more information,,,,,,,,,,,, -,,64,Tinner,celsius,0-65535,Internal temperature,,,,,,,,,,,, -,,65,Tradiator1,Celsius,0-65535,Radiator temperature 1,,,,,,,,,,,, -,,66,Tradiator2,celsius,0-65535,Radiator temperature 2,,,,,,,,,,,, -,,67,Tbat,celsius,0-65535,Battery temperature,,,,,,,,,,,, -,,69,RunningTime L,second,,Runtime duration,,,,,,,,,,,, -,,70,RunningTime H,second,,Runtime duration,,,,,,,,,,,, -,4bit,71,AutoTestStart,Bit0-3,,0 - not started ; 1 - started,,,,,,,,,,,, -,4bit,71.b4,UbAutoTestStatus,Bit4-7,,0-waiting 1-testing 2-test fail 3-V test OK 4-F test OK 5- test pass,,,,,,,,,,,, -,4bit,71.b8,UbAutoTestStep,Bit8-11,,1-V1L test 2-V1H 3-F1L test 4-F1H test 5-V2L test 6-V2H test 7-F2L test 8-F2H test,,,,,,,,,,,, -,,72,wAutoTestLimit,0.1V/0. 01Hz,,"When ubAuto Test Step=1,2,5,6, is the voltage limit; When ubAutoTest Step=3,4,7,8, it is the frequency limit",,,,,,,,,,,, -,,73,uwAutoTestDefault Time,ms,,,,,,,,,,,,,, -,,74,uwAutoTestTripValue,0.1V/0. 01Hz,,"When ubAuto Test Step=1,2,5,6, is the voltage limit; When ubAutoTestStep=3,4,7,8, it is the frequency limit",,,,,,,,,,,, -,,75,uwAutoTestTripTime,ms,,,,,,,,,,,,,, -,1bit,77,ACInputType,Bit0,0 or 1,0-Grid 1-Generator for 12KHybrid,,,,,,,,,,,, -,1bit,77.b1,ACCoupleInverterFlow,Bit1,0 or 1,0-no flow 1-show flow,,,,,,,,,,,, -,1bit,77.b2,ACCoupleEn,Bit2,0 or 1,0-Disable 1-Enable,,,,,,,,,,,, -,4bit,80,BatTypeAndBrand,,,For more information,,,,,,,,,,,, -,4bit,80.b4,BatComType,,0 or 1,0-CAN 1-485,,,,,,,,,,,, -,,81,MaxChgCurr,0.01A,,The maximum charging current of BMS limits,,,,,,,,,,,, -,,82,MaxDischgCurr,0.01A,,The maximum discharging current of BMS limits,,,,,,,,,,,, -,,83,ChargeVoltRef,0.1V,,Recommends charging voltage by BMS,,,,,,,,,,,, -,,84,DischgCutVolt,0.1V,,Recommends a discharging cut-off voltage by BMS,,,,,,,,,,,, -,,85,BatStatus0_BMS,,,Status information of BMS,,,,,,,,,,,, -,,86,BatStatus1_BMS,,,Status information of BMS,,,,,,,,,,,, -,,87,BatStatus2_BMS,,,Status information of BMS,,,,,,,,,,,, -,,88,BatStatus3_BMS,,,Status information of BMS,,,,,,,,,,,, -,,89,BatStatus4_BMS,,,Status information of BMS,,,,,,,,,,,, -,,90,BatStatus5_BMS,,,Status information of BMS,,,,,,,,,,,, -,,91,BatStatus6_BMS,,,Status information of BMS,,,,,,,,,,,, -,,92,BatStatus7_BMS,,,Status information of BMS,,,,,,,,,,,, -,,93,BatStatus8_BMS,,,Status information of BMS,,,,,,,,,,,, -,,94,BatStatus9_BMS,,,Status information of BMS,,,,,,,,,,,, -,,95,BatStatus_INV,,,The inverter aggregates lithium battery status information,,,,,,,,,,,, -,,96,BatParallelNum,,,Number of batteries in parallel,,,,,,,,,,,, -,,97,BatCapacity,Ah,,Battery capacity,,,,,,,,,,,, -,,98,BatCurrent_BMS,0.01A,,Battery current ,,,,,,,,,,,, -,,99,FaultCode_BMS,,,,,,,,,,,,,,, -,,100,WarningCode_BMS,,,,,,,,,,,,,,, -,,101,MaxCellVolt_BMS,0.001V,,Maximum voltage of cell,,,,,,,,,,,, -,,102,MinCellVolt_BMS,0.001V,,Minimum voltage of cell,,,,,,,,,,,, -,,103,MaxCellTemp_BMS,0.1C,,Maximum temperature of cell,,,,,,,,,,,, -,,104,MinCellTemp_BMS,0.1C,,Minimum temperature of cell,,,,,,,,,,,, -,,105,BMSFWUpdateState,,1-3,1-Upgrade in process 2-Upgrade successful 3- Upgrade failed,,,,,,,,,,,, -,,106,CycleCnt_BMS,,,Number of charging/discharging cycles,,,,,,,,,,,, -,,107,BatVoltSample_INV,0.1V,,Tnverter samples the battery voltage,,,,,,,,,,,, -,,108,T1,0.1C,,BT temperature for 12k,,,,,,,,,,,, -,,109,T2,0.1C,,Reserved,,,,,,,,,,,, -,,110,T3,0.1C,,Reserved,,,,,,,,,,,, -,,111,T4,0.1C,,Reserved,,,,,,,,,,,, -,,112,T5,0.1C,,Reserved,,,,,,,,,,,, -,2bit,113,MasterOrSlave,Bit0~1,1,2,,,,,,,,,,,, -,2bit,113.b2,SingleOrThreePhase,Bit2~3,1-3,1:R; 2:S ; 3:T; Parallel phase 1:R 2:S 3:T,,,,,,,,,,,, -,4bit,113.b4,Resvd,Bit4~7,,Reserved,,,,,,,,,,,, -,8bit,113.b8,ParallelNum,Bit8~16,1~255,Number of inverters in parallel,,,,,,,,,,,, -,,114,OnGridloadPower,W,,Load power of the 12k inverter when it is not off-grid,,,,,,,,,,,, -,8bit,115,SN_0__Year,,0'-'9' 'A'- 'Z',The serial number is a ten-digit ASCII code For example: The serial number is AB12345678 SN[0]=0x41(A) : : : : SN[9]=0x38(8),,,,,,,,,,,, -,8bit,115.b8,SN_1__week,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,116,SN_2__week,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,116.b8,SN_3__factory,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,117,SN_4__product code,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,117.b8,SN_5__product code,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,118,SN_6__serial number,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,118.b8,SN_7__serial number,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,119,SN_8__serial number,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,8bit,119.b8,SN_9__serial number,,0'-'9' 'A'- 'Z',,,,,,,,,,,,, -,,120,VBusP,0.1V,,,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage,Half BUS voltage -,,121,GenVolt,0.1V,,Generator voltage Voltage of generator for three phase: R phase,,,,,,,,,,,, -,,122,GenFreq,0.01Hz,,Generator frequency,,,,,,,,,,,, -,,123,GenPower,W,,Voltage of generator for three phase: R phase,,,,,,,,,,,, -,,124,Egen_day,0.1kWh,,Energy of generator today,,,,,,,,,,,, -,,125,Egen_all L,0.1kWh,,Low byte of total generator energy,,,,,,,,,,,, -,,126,Egen_all H,0.1kWh,,High byte of total generator energy,,,,,,,,,,,, -,,127,EPSVoltL1N,0.1V,,Voltage of EPS L1N Voltage of generator for three phase: S phase,,,,,,,,,,,, -,,128,EPSVoltL2N,0.1V,,Voltage of EPS L2N Voltage of generator for three phase: T phase,,,,,,,,,,,, -,,129,Peps_L1N,W,,Active power of EPS L1N Off-grid active power of three phase: S phase,,,,,,,,,,,, -,,130,Peps_L2N,W,,Active power of EPS L2N Off-grid active power of three phase: T phase,,,,,,,,,,,, -,,131,Seps_L1N,VA,,Apparent power of EPS L1N Off-grid apparent power of three phase: S phase,,,,,,,,,,,, -,,132,Seps_L2N,VA,,Apparent power of EPS L2N Off-grid apparent power of three phase: T phase,,,,,,,,,,,, -,,133,EepsL1N_day,0.1kWh,,Daily energy of EPSL1N Off-grid daily energy of three phase: S phase,,,,,,,,,,,, -,,134,EepsL2N_day,0.1kWh,,Daily energy of EPSL2N Off-grid daily energy of three phase: T phase,,,,,,,,,,,, -,,135,EepsL1N_all L,0.1kWh,,Low byte of total EPSL1N energy Total off-grid power of three phase: S phase,,,,,,,,,,,, -,,136,EepsL1N_all H,0.1kWh,,High byte of total EPSL1N energy Total off-grid power of three cameras: S phase,,,,,,,,,,,, -,,137,EepsL2N_all L,0.1kWh,,Low word of total EPSL2N energy Total off-grid power of three phase: T phase,,,,,,,,,,,, -,,138,EepsL2N_all H,0.1kWh,,High byte of total EPSL2N energy Total off-grid power of three byte: T phase,,,,,,,,,,,, -,,140,AFCI_CurrCH1,mA,,AFCI current,,,,,,,,,,,, -,,141,AFCI_CurrCH2,mA,,AFCI current,,,,,,,,,,,, -,,142,AFCI_CurrCH3,mA,,AFCI current,,,,,,,,,,,, -,,143,AFCI_CurrCH4,mA,,AFCI current,,,,,,,,,,,, -,1bit,144,AFCIFlag_ArcAlarmCH1,Bit0,,Arc status of CH1 0-Normal 1-Alarm,,,,,,,,,,,, -,1bit,144.b1,AFCIFlag_ArcAlarmCH2,Bit1,,Arc status of CH2 0-Normal 1-Alarm,,,,,,,,,,,, -,1bit,144.b2,AFCIFlag_ArcAlarmCH3,Bit2,,Arc status of CH3 0-Normal 1-Alarm,,,,,,,,,,,, -,1bit,144.b3,AFCIFlag_ArcAlarmCH4,Bit3,,Arc status of CH4 0-Normal 1-Alarm,,,,,,,,,,,, -,1bit,144.b4,AFCIFlag_SelfTestResultCH1,Bit4,,Test result of CH1 0-Normal 1-fail,,,,,,,,,,,, -,1bit,144.b5,AFCIFlag_SelfTestResultCH2,Bit5,,Test result of CH2 0-Normal 1-fail,,,,,,,,,,,, -,1bit,144.b6,AFCIFlag_SelfTestResultCH3,Bit6,,Test result of CH3 0-Normal 1-fail,,,,,,,,,,,, -,1bit,144.b7,AFCIFlag_SelfTestResultCH4,Bit7,,Test result of CH4 0-Normal 1-fail,,,,,,,,,,,, -,8bit,144.b8,AFCI_ArcAlarm_rsvd,Bit8-15,,,,,,,,,,,,,, -,,145,AFCI_ArcCH1,,,Real time arc of CH1,,,,,,,,,,,, -,,146,AFCI_ArcCH2,,,Real time arc of CH2,,,,,,,,,,,, -,,147,AFCI_ArcCH3,,,Real time arc of CH3,,,,,,,,,,,, -,,148,AFCI_ArcCH4,,,Real time arc of CH4,,,,,,,,,,,, -,,149,AFCI_MaxArcCH1,,,Max arc of CH1,,,,,,,,,,,, -,,150,AFCI_MaxArcCH2,,,Max arc of CH2,,,,,,,,,,,, -,,151,AFCI_MaxArcCH3,,,Max arc of CH3,,,,,,,,,,,, -,,152,AFCI_MaxArcCH4,,,Max arc of CH4,,,,,,,,,,,, -,,153,ACCouplePower,W,,AC Coupled inverter power,,,,,,,,,,,, -,,154,AutoTestTripValue_0_,0.1V/0. 01Hz,,,,,,,,,,,,,, -,,161,AutoTestTripValue_7_,0.1V/0. 01Hz,,,,,,,,,,,,,, -,,162,AutoTestTripTime _0_,ms,,,,,,,,,,,,,, -,,169,AutoTestTripTime _7_,ms,,,,,,,,,,,,,, -,,170,Pload,W,,,,,,,,,,,,,, -,,171,Eload_day,0.1kWh,,,,,,,,,,,,,, -,,172,Eload_allL,0.1kWh,,,,,,,,,,,,,, -,,173,Eload_allH,0.1kWh,,,,,,,,,,,,,, -,4bit,174,SwitchState_SafetySw,Bit0~4,0~0x1F,The status of the 5-digit safety DIP switch,,,,,,,,,,,, -,,180,Pinv_S,W,0-65535,On grid inverter power of three phase: S phase,,,,,,,,,,,, -,,181,Pinv_T,W,0-65535,On grid inverter power of three phase: T phase,,,,,,,,,,,, -,,182,Prec_S,W,0-65535,Charging rectification power of three phase: S phase,,,,,,,,,,,, -,,183,Prec_T,W,0-65535,Charging rectification power of three phase: T phase,,,,,,,,,,,, -,,184,Ptogrid_S,W,0-65535,User on-grid power of three phase: S phase,,,,,,,,,,,, -,,185,Ptogrid_T,W,0-65535,User on-grid power of three phase: T phase,,,,,,,,,,,, -,,186,Ptouser_S,W,0-65535,Grid supply power of three phase: S phase,,,,,,,,,,,, -,,187,Ptouser_T,W,0-65535,Grid supply power of three phase:T phase,,,,,,,,,,,, -,,188,GenPower_S,W,0-65535,Power of generator for three phase: S phase,,,,,,,,,,,, -,,189,GenPower_T,W,0-65535,Power of generator for three phase: T phase,,,,,,,,,,,, -,,190,IinvRMS_S,0.01,0-65535,Effective value of three phase inverter current: S phase,,,,,,,,,,,, -,,191,IinvRMS_T,0.01,0-65535,Effective value of three phase inverter current: T phase,,,,,,,,,,,, -,,192,PF_S,0.001,0-2000,Power factor of phase S in three- phase inverter x?(0,,,,,,,,,,,, -,,193,PF_T,0.001,0-2000,Power factor of phase T in three- phase inverter x? (0,,,,,,,,,,,, -,,192,PF_S,0.001,0-2000,Power factor of phase S in three- phase inverter x?(0,,,,,,,,,,,, -,,400,FaultRecord1_YAndM,,,Fault Records 1_ years & months,,,,,,,,,,,, -,,401,FaultRecord1_DAndH,,,Fault Records 1_ days & hours,,,,,,,,,,,, -,,402,FaultRecord1_MAndS,,,Fault Records 1_ minutes & seconds,,,,,,,,,,,, -,,403,FaultRecord1_Code,,,Fault Records 1_ fault code,,,,,,,,,,,, -,,404,FaultRecord1_Value,,,Fault Records 1_ fault value,,,,,,,,,,,, -,,405,FaultRecord1_SetOrClr,,0/1,Fault Records 1_Fault occurred or cleared (0-fault occurred,,,,,,,,,,,, -,,406,FaultRecord2_YAndM,,,Fault Records 2_ years & months,,,,,,,,,,,, -,,407,FaultRecord2_DAndH,,,Fault Records 2_ days & hours,,,,,,,,,,,, -,,408,FaultRecord2_MAndS,,,Fault Records 2_ minutes & seconds,,,,,,,,,,,, -,,409,FaultRecord2_Code,,,Fault Records 2_ fault code,,,,,,,,,,,, -,,410,FaultRecord2_Value,,,Fault Records 2_Fault value,,,,,,,,,,,, -,,411,FaultRecord2_SetOrClr,,0/1,Fault Records 2_Fault occurred or clear (0 - Fault Occurred,,,,,,,,,,,, -,,994,FaultRecord100_YAndM,,,Fault Records 100_ years & months,,,,,,,,,,,, -,,995,FaultRecord100_DAndH,,,Fault records 100_ days & hours,,,,,,,,,,,, -,,996,FaultRecord100_MAndS,,,Fault Records 100_minutes & seconds,,,,,,,,,,,, -,,997,FaultRecord100_Code,,,Fault Records 100_ fault code,,,,,,,,,,,, -,,998,FaultRecord100_Value,,,The fault record is 100_ fault value,,,,,,,,,,,, -,,999,FaultRecord100_SetOrClr,,0/1,Fault Records 100_Fault Occurred or Cleared (0 - Fault Occurred,,,,,,,,,,,, -,,1000,WarnRecord1_YAndM,,,Alarm Records 1_ years & months,,,,,,,,,,,, -,,1001,WarnRecord1_DAndH,,,Alarm Records 1_ days & hours,,,,,,,,,,,, -,,1002,WarnRecord1_MAndS,,,Alarm records 1_ minutes &seconds,,,,,,,,,,,, -,,1003,WarnRecord1_Code,,,Alarm Records 1_ alarm code,,,,,,,,,,,, -,,1004,WarnRecord1_Value,,,Alarm Records 1_Alarm value,,,,,,,,,,,, -,,1005,WarnRecord1_SetOrClr,,0/1,Alarm Records 1_Alarm occurred or cleared (0 - alarm occurred,,,,,,,,,,,, -,,1006,WarnRecord2_YAndM,,,Alarm records 2_ years & months,,,,,,,,,,,, -,,1007,WarnRecord2_DAndH,,,Alarm Records 2_ days & hour,,,,,,,,,,,, -,,1008,WarnRecord2_MAndS,,,Alarm Records 2_ minutes & seconds,,,,,,,,,,,, -,,1009,WarnRecord2_Code,,,Alarm Records 2_Alarm code,,,,,,,,,,,, -,,1010,WarnRecord2_Value,,,Alarm Records 2_Alarm value,,,,,,,,,,,, -,,1011,WarnRecord2_SetOrClr,,0/1,Alarm Records 2_Alarm occurred or cleared (0 - alarm occurred,,,,,,,,,,,, -,,1594,WarnRecord100_YAndM,,,Alarm Records 100_ years & months,,,,,,,,,,,, -,,1595,WarnRecord100_DAndH,,,Alarm Records for 100_ days & hours,,,,,,,,,,,, -,,1596,WarnRecord100_MAndS,,,Alarm records 100_ minutes &seconds,,,,,,,,,,,, -,,1597,WarnRecord100_Code,,,Alarm Records 100_ alarm code,,,,,,,,,,,, -,,1598,WarnRecord100_Value,,,Alarm records 100_alarm value,,,,,,,,,,,, -,,1599,WarnRecord100_SetOrClr,,0/1,Alarm Records 100_Alarm occurred or cleared (0 - alarm occurred,,,,,,,,,,,, +variable name;data type;register;documented name;unit;values;note;;;;;;;;;;;; +;;0;State;;0-65535;For more information;;;;;;;;;;;; +PV1 Voltage;;1;Vpv1;0.1V;0-65535;PV1 voltage;;;;;;;;;;;; +PV2 Voltage;;2;Vpv2;0.1V;0-65535;PV2 voltage;;;;;;;;;;;; +PV3 Voltage;;3;Vpv3;0.1V;0-65536;PV3 voltage;;;;;;;;;;;; +;;4;Vbat;0.1V;0-65535;Battery voltage;;;;;;;;;;;; +;8bit;5;SOC;%;0-100;Battery capacity;;;;;;;;;;;; +;8bit;5.b8;SOH;%;0-100;Battery State of health;;;;;;;;;;;; +;;6;Internal Fault;;0-65535;For more information;;;;;;;;;;;; +;;7;Ppv1;W;0-65535;PV1 power/ AC enery storage Ppv;;;;;;;;;;;; +;;8;Ppv2;W;0-65535;PV2 power;;;;;;;;;;;; +;;9;Ppv3;W;0-65536;PV3 power (total PV power;;;;;;;;;;;; +;;10;Pcharge;W;0-65535;Charging power (power flowing into the battery);;;;;;;;;;;; +;;11;Pdischarge;W;0-65535;Discharging power (power flowing out of battery power);;;;;;;;;;;; +;;12;VacR;0.1V;0-65535;R-phase utility grid voltage;;;;;;;;;;;; +;;13;VacS;0.1V;0-65535;S-phase utility grid voltage;;;;;;;;;;;; +;;14;VacT;0.1V;0-65535;T-phase utility grid voltage;;;;;;;;;;;; +Grid Hz;;15;Fac;0.01Hz;0-65535;Utility grid frequency;;;;;;;;;;;; +;;16;Pinv;W;0-65535;On-gird inverter power (For three phase: R phase);;;;;;;;;;;; +;;17;Prec;W;0-65535;AC charging rectification power (For three phase: R phase);;;;;;;;;;;; +;;18;IinvRMS;0.01A;0-65535;Inverter rms current output (For three phase: R phase);;;;;;;;;;;; +;;19;PF;0.001;0-2000;Power factor x?(0;;;;;;;;;;;; +;;20;VepsR;0.1V;0-65535;R phase off-grid output voltage;;;;;;;;;;;; +;;21;VepsS;0.1V;0-65535;S phase off-grid output voltage;;;;;;;;;;;; +;;22;VepsT;0.1V;0-65535;T phase off-grid output voltage;;;;;;;;;;;; +;;23;Feps;0.01Hz;0-65535;Off-grid output frequency;;;;;;;;;;;; +;;24;Peps;W;0-65535;Off-grid inverter power (For three phase: R phase);;;;;;;;;;;; +;;25;Seps;VA;0-65535;Off-grid apparent power (For three phase: R phase);;;;;;;;;;;; +;;26;Ptogrid;W;0-65535;User on-grid power (For three phase: R phase);;;;;;;;;;;; +;;27;Ptouser;W;0-65535;Grid power capacity (For three phase: R phase);;;;;;;;;;;; +;;28;Epv1_day;0.1kWh;0-65535;PV1 power generation today / AC Energy Storage Epv_day;;;;;;;;;;;; +;;29;Epv2_day;0.1kWh;0-65535;PV2 power generation today;;;;;;;;;;;; +;;30;Epv3_day;0.1kWh;0-65535;PV3 power generation today (total PV=PV1+PV2+PV3);;;;;;;;;;;; +;;31;Einv_day;0.1kWh;0-65535;Today's on-grid inverter output energy;;;;;;;;;;;; +;;32;Erec_day;0.1kWh;0-65535;Today's AC charging rectifier energy;;;;;;;;;;;; +;;33;Echg_day;0.1kWh;0-65535;Energy Charge today;;;;;;;;;;;; +;;34;Edischg_day;0.1kWh;0-65535;Energy Discharge today;;;;;;;;;;;; +;;35;Eeps_day;0.1kWh;0-65535;Today's off-grid output energy;;;;;;;;;;;; +;;36;Etogrid_day;0.1kWh;0-65535;Today's export to gird energy;;;;;;;;;;;; +;;37;Etouser_day;0.1kWh;0-65535;Electricity supplied to user from the grid today;;;;;;;;;;;; +;;38;Vbus1;0.1V;0-65535;Voltage of Bus 1;;;;;;;;;;;; +;;39;Vbus2;0.1V;0-65535;Voltage of Bus 2;;;;;;;;;;;; +;;40;Epv1_all L;0.1kWh;0-65535;PV1 cumulative power generation/AC energy storage Epv_all Low byte;;;;;;;;;;;; +;;41;Epv1_all H;0.1kWh;0-65535;PV1 cumulative power generation/AC energy storage Epv_all high byte;;;;;;;;;;;; +;;42;Epv2_all L;0.1kWh;0-65535;PV2 cumulative power generation low byte;;;;;;;;;;;; +;;43;Epv2_all H;0.1kWh;0-65535;PV2 cumulative power generation high byte;;;;;;;;;;;; +;;44;Epv3_all L;0.1kWh;0-65535;PV3 cumulative power generation low byte (total PV=PV1+PV2+PV3);;;;;;;;;;;; +;;45;Epv3_all H;0.1kWh;0-65535;PV3 cumulative power generation high byte (total PV=PV1+PV2+PV3);;;;;;;;;;;; +;;46;Einv_all L;0.1kWh;0-65535;Inverter output accumulated power low byte;;;;;;;;;;;; +;;47;Einv_all H;0.1kWh;0-65535;Inverter output accumulates power high byte;;;;;;;;;;;; +;;48;Erec_all L;0.1kWh;0-65535;AC charging accumulates rectified power Low byte;;;;;;;;;;;; +;;49;Erec_all H;0.1kWh;0-65535;AC charging accumulates rectified power high byte;;;;;;;;;;;; +;;50;Echg_all L;0.1kWh;0-65535;Cumulative charge energy low byte;;;;;;;;;;;; +;;51;Echg_all H;0.1kWh;0-65535;Cumulative charge energy high byte;;;;;;;;;;;; +;;52;Edischg_all L;0.1kWh;0-65535;Cumulative discharge charge energy Low byte;;;;;;;;;;;; +;;53;Edischg_all H;0.1kWh;0-65535;Cumulative discharge charge energy High byte;;;;;;;;;;;; +;;54;Eeps_all L;0.1kWh;0-65535;Cumulative inverter off-grid output energy Low byte;;;;;;;;;;;; +;;55;Eeps_all H;0.1kWh;0-65535;Cumulative inverter off-grid output energy High byte;;;;;;;;;;;; +;;56;Etogrid_all L;0.1kWh;0-65535;Accumulate export energy Low byte;;;;;;;;;;;; +;;57;Etogrid_all H;0.1kWh;0-65535;Accumulate export energy High byte;;;;;;;;;;;; +;;58;Etouser_all L;0.1kWh;0-65535;Cumulative import energy Low byte;;;;;;;;;;;; +;;59;Etouser_all H;0.1kWh;0-65535;Cumulative import energy high byte;;;;;;;;;;;; +;;60;FaultCode L;;0-65535;For more information;;;;;;;;;;;; +;;61;FaultCode H;;0-65535;For more information;;;;;;;;;;;; +;;62;WarningCode L;;0-65535;For more information;;;;;;;;;;;; +;;63;WarningCode H;;0-65535;For more information;;;;;;;;;;;; +;;64;Tinner;celsius;0-65535;Internal temperature;;;;;;;;;;;; +;;65;Tradiator1;Celsius;0-65535;Radiator temperature 1;;;;;;;;;;;; +;;66;Tradiator2;celsius;0-65535;Radiator temperature 2;;;;;;;;;;;; +;;67;Tbat;celsius;0-65535;Battery temperature;;;;;;;;;;;; +;;69;RunningTime L;second;;Runtime duration;;;;;;;;;;;; +;;70;RunningTime H;second;;Runtime duration;;;;;;;;;;;; +;4bit;71;AutoTestStart;Bit0-3;;0 - not started ; 1 - started;;;;;;;;;;; +;4bit;71.b4;UbAutoTestStatus;Bit4-7;;0-waiting 1-testing 2-test fail 3-V test OK 4-F test OK 5- test pass;;;;;;;;;;;; +;4bit;71.b8;UbAutoTestStep;Bit8-11;;1-V1L test 2-V1H 3-F1L test 4-F1H test 5-V2L test 6-V2H test 7-F2L test 8-F2H test;;;;;;;;;;;; +;;72;wAutoTestLimit;0.1V/0. 01Hz;;"When ubAuto Test Step=1,2,5,6, is the voltage limit; When ubAutoTest Step=3,4,7,8, it is the frequency limit";;;;;;;;;;;; +;;73;uwAutoTestDefault Time;ms;;;;;;;;;;;;;; +;;74;uwAutoTestTripValue;0.1V/0. 01Hz;;"When ubAuto Test Step=1,2,5,6, is the voltage limit; When ubAutoTestStep=3,4,7,8, it is the frequency limit";;;;;;;;;;;; +;;75;uwAutoTestTripTime;ms;;;;;;;;;;;;;; +;1bit;77;ACInputType;Bit0;0 or 1;0-Grid 1-Generator for 12KHybrid;;;;;;;;;;;; +;1bit;77.b1;ACCoupleInverterFlow;Bit1;0 or 1;0-no flow 1-show flow;;;;;;;;;;;; +;1bit;77.b2;ACCoupleEn;Bit2;0 or 1;0-Disable 1-Enable;;;;;;;;;;;; +;4bit;80;BatTypeAndBrand;;;For more information;;;;;;;;;;;; +;4bit;80.b4;BatComType;;0 or 1;0-CAN 1-485;;;;;;;;;;;; +;;81;MaxChgCurr;0.01A;;The maximum charging current of BMS limits;;;;;;;;;;;; +;;82;MaxDischgCurr;0.01A;;The maximum discharging current of BMS limits;;;;;;;;;;;; +;;83;ChargeVoltRef;0.1V;;Recommends charging voltage by BMS;;;;;;;;;;;; +;;84;DischgCutVolt;0.1V;;Recommends a discharging cut-off voltage by BMS;;;;;;;;;;;; +;;85;BatStatus0_BMS;;;Status information of BMS;;;;;;;;;;;; +;;86;BatStatus1_BMS;;;Status information of BMS;;;;;;;;;;;; +;;87;BatStatus2_BMS;;;Status information of BMS;;;;;;;;;;;; +;;88;BatStatus3_BMS;;;Status information of BMS;;;;;;;;;;;; +;;89;BatStatus4_BMS;;;Status information of BMS;;;;;;;;;;;; +;;90;BatStatus5_BMS;;;Status information of BMS;;;;;;;;;;;; +;;91;BatStatus6_BMS;;;Status information of BMS;;;;;;;;;;;; +;;92;BatStatus7_BMS;;;Status information of BMS;;;;;;;;;;;; +;;93;BatStatus8_BMS;;;Status information of BMS;;;;;;;;;;;; +;;94;BatStatus9_BMS;;;Status information of BMS;;;;;;;;;;;; +;;95;BatStatus_INV;;;The inverter aggregates lithium battery status information;;;;;;;;;;;; +;;96;BatParallelNum;;;Number of batteries in parallel;;;;;;;;;;;; +;;97;BatCapacity;Ah;;Battery capacity;;;;;;;;;;;; +;;98;BatCurrent_BMS;0.01A;;Battery current ;;;;;;;;;;;; +;;99;FaultCode_BMS;;;;;;;;;;;;;;; +;;100;WarningCode_BMS;;;;;;;;;;;;;;; +;;101;MaxCellVolt_BMS;0.001V;;Maximum voltage of cell;;;;;;;;;;;; +;;102;MinCellVolt_BMS;0.001V;;Minimum voltage of cell;;;;;;;;;;;; +;;103;MaxCellTemp_BMS;0.1C;;Maximum temperature of cell;;;;;;;;;;;; +;;104;MinCellTemp_BMS;0.1C;;Minimum temperature of cell;;;;;;;;;;;; +;;105;BMSFWUpdateState;;1-3;1-Upgrade in process 2-Upgrade successful 3- Upgrade failed;;;;;;;;;;;; +;;106;CycleCnt_BMS;;;Number of charging/discharging cycles;;;;;;;;;;;; +;;107;BatVoltSample_INV;0.1V;;Tnverter samples the battery voltage;;;;;;;;;;;; +;;108;T1;0.1C;;BT temperature for 12k;;;;;;;;;;;; +;;109;T2;0.1C;;Reserved;;;;;;;;;;;; +;;110;T3;0.1C;;Reserved;;;;;;;;;;;; +;;111;T4;0.1C;;Reserved;;;;;;;;;;;; +;;112;T5;0.1C;;Reserved;;;;;;;;;;;; +;2bit;113;MasterOrSlave;Bit0~1;1;2;;;;;;;;;;;; +;2bit;113.b2;SingleOrThreePhase;Bit2~3;1-3;1:R; 2:S ; 3:T; Parallel phase 1:R 2:S 3:T;;;;;;;;; +;4bit;113.b4;Resvd;Bit4~7;;Reserved;;;;;;;;;;;; +;8bit;113.b8;ParallelNum;Bit8~16;1~255;Number of inverters in parallel;;;;;;;;;;;; +;;114;OnGridloadPower;W;;Load power of the 12k inverter when it is not off-grid;;;;;;;;;;;; +;8bit;115;SN_0__Year;;0'-'9' 'A'- 'Z';The serial number is a ten-digit ASCII code For example: The serial number is AB12345678 SN[0]=0x41(A) : : : : SN[9]=0x38(8);;;;;;;;;;;; +;8bit;115.b8;SN_1__week;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;116;SN_2__week;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;116.b8;SN_3__factory;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;117;SN_4__product code;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;117.b8;SN_5__product code;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;118;SN_6__serial number;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;118.b8;SN_7__serial number;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;119;SN_8__serial number;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;8bit;119.b8;SN_9__serial number;;0'-'9' 'A'- 'Z';;;;;;;;;;;;; +;;120;VBusP;0.1V;;;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage;Half BUS voltage +;;121;GenVolt;0.1V;;Generator voltage Voltage of generator for three phase: R phase;;;;;;;;;;;; +;;122;GenFreq;0.01Hz;;Generator frequency;;;;;;;;;;;; +;;123;GenPower;W;;Voltage of generator for three phase: R phase;;;;;;;;;;;; +;;124;Egen_day;0.1kWh;;Energy of generator today;;;;;;;;;;;; +;;125;Egen_all L;0.1kWh;;Low byte of total generator energy;;;;;;;;;;;; +;;126;Egen_all H;0.1kWh;;High byte of total generator energy;;;;;;;;;;;; +;;127;EPSVoltL1N;0.1V;;Voltage of EPS L1N Voltage of generator for three phase: S phase;;;;;;;;;;;; +;;128;EPSVoltL2N;0.1V;;Voltage of EPS L2N Voltage of generator for three phase: T phase;;;;;;;;;;;; +;;129;Peps_L1N;W;;Active power of EPS L1N Off-grid active power of three phase: S phase;;;;;;;;;;;; +;;130;Peps_L2N;W;;Active power of EPS L2N Off-grid active power of three phase: T phase;;;;;;;;;;;; +;;131;Seps_L1N;VA;;Apparent power of EPS L1N Off-grid apparent power of three phase: S phase;;;;;;;;;;;; +;;132;Seps_L2N;VA;;Apparent power of EPS L2N Off-grid apparent power of three phase: T phase;;;;;;;;;;;; +;;133;EepsL1N_day;0.1kWh;;Daily energy of EPSL1N Off-grid daily energy of three phase: S phase;;;;;;;;;;;; +;;134;EepsL2N_day;0.1kWh;;Daily energy of EPSL2N Off-grid daily energy of three phase: T phase;;;;;;;;;;;; +;;135;EepsL1N_all L;0.1kWh;;Low byte of total EPSL1N energy Total off-grid power of three phase: S phase;;;;;;;;;;;; +;;136;EepsL1N_all H;0.1kWh;;High byte of total EPSL1N energy Total off-grid power of three cameras: S phase;;;;;;;;;;;; +;;137;EepsL2N_all L;0.1kWh;;Low word of total EPSL2N energy Total off-grid power of three phase: T phase;;;;;;;;;;;; +;;138;EepsL2N_all H;0.1kWh;;High byte of total EPSL2N energy Total off-grid power of three byte: T phase;;;;;;;;;;;; +;;140;AFCI_CurrCH1;mA;;AFCI current;;;;;;;;;;;; +;;141;AFCI_CurrCH2;mA;;AFCI current;;;;;;;;;;;; +;;142;AFCI_CurrCH3;mA;;AFCI current;;;;;;;;;;;; +;;143;AFCI_CurrCH4;mA;;AFCI current;;;;;;;;;;;; +;1bit;144;AFCIFlag_ArcAlarmCH1;Bit0;;Arc status of CH1 0-Normal 1-Alarm;;;;;;;;;;;; +;1bit;144.b1;AFCIFlag_ArcAlarmCH2;Bit1;;Arc status of CH2 0-Normal 1-Alarm;;;;;;;;;;;; +;1bit;144.b2;AFCIFlag_ArcAlarmCH3;Bit2;;Arc status of CH3 0-Normal 1-Alarm;;;;;;;;;;;; +;1bit;144.b3;AFCIFlag_ArcAlarmCH4;Bit3;;Arc status of CH4 0-Normal 1-Alarm;;;;;;;;;;;; +;1bit;144.b4;AFCIFlag_SelfTestResultCH1;Bit4;;Test result of CH1 0-Normal 1-fail;;;;;;;;;;;; +;1bit;144.b5;AFCIFlag_SelfTestResultCH2;Bit5;;Test result of CH2 0-Normal 1-fail;;;;;;;;;;;; +;1bit;144.b6;AFCIFlag_SelfTestResultCH3;Bit6;;Test result of CH3 0-Normal 1-fail;;;;;;;;;;;; +;1bit;144.b7;AFCIFlag_SelfTestResultCH4;Bit7;;Test result of CH4 0-Normal 1-fail;;;;;;;;;;;; +;8bit;144.b8;AFCI_ArcAlarm_rsvd;Bit8-15;;;;;;;;;;;;;; +;;145;AFCI_ArcCH1;;;Real time arc of CH1;;;;;;;;;;;; +;;146;AFCI_ArcCH2;;;Real time arc of CH2;;;;;;;;;;;; +;;147;AFCI_ArcCH3;;;Real time arc of CH3;;;;;;;;;;;; +;;148;AFCI_ArcCH4;;;Real time arc of CH4;;;;;;;;;;;; +;;149;AFCI_MaxArcCH1;;;Max arc of CH1;;;;;;;;;;;; +;;150;AFCI_MaxArcCH2;;;Max arc of CH2;;;;;;;;;;;; +;;151;AFCI_MaxArcCH3;;;Max arc of CH3;;;;;;;;;;;; +;;152;AFCI_MaxArcCH4;;;Max arc of CH4;;;;;;;;;;;; +;;153;ACCouplePower;W;;AC Coupled inverter power;;;;;;;;;;;; +;;154;AutoTestTripValue_0_;0.1V/0. 01Hz;;;;;;;;;;;;;; +;;161;AutoTestTripValue_7_;0.1V/0. 01Hz;;;;;;;;;;;;;; +;;162;AutoTestTripTime _0_;ms;;;;;;;;;;;;;; +;;169;AutoTestTripTime _7_;ms;;;;;;;;;;;;;; +;;170;Pload;W;;;;;;;;;;;;;; +;;171;Eload_day;0.1kWh;;;;;;;;;;;;;; +;;172;Eload_allL;0.1kWh;;;;;;;;;;;;;; +;;173;Eload_allH;0.1kWh;;;;;;;;;;;;;; +;4bit;174;SwitchState_SafetySw;Bit0~4;0~0x1F;The status of the 5-digit safety DIP switch;;;;;;;;;;;; +;;180;Pinv_S;W;0-65535;On grid inverter power of three phase: S phase;;;;;;;;;;;; +;;181;Pinv_T;W;0-65535;On grid inverter power of three phase: T phase;;;;;;;;;;;; +;;182;Prec_S;W;0-65535;Charging rectification power of three phase: S phase;;;;;;;;;;;; +;;183;Prec_T;W;0-65535;Charging rectification power of three phase: T phase;;;;;;;;;;;; +;;184;Ptogrid_S;W;0-65535;User on-grid power of three phase: S phase;;;;;;;;;;;; +;;185;Ptogrid_T;W;0-65535;User on-grid power of three phase: T phase;;;;;;;;;;;; +;;186;Ptouser_S;W;0-65535;Grid supply power of three phase: S phase;;;;;;;;;;;; +;;187;Ptouser_T;W;0-65535;Grid supply power of three phase:T phase;;;;;;;;;;;; +;;188;GenPower_S;W;0-65535;Power of generator for three phase: S phase;;;;;;;;;;;; +;;189;GenPower_T;W;0-65535;Power of generator for three phase: T phase;;;;;;;;;;;; +;;190;IinvRMS_S;0.01;0-65535;Effective value of three phase inverter current: S phase;;;;;;;;;;;; +;;191;IinvRMS_T;0.01;0-65535;Effective value of three phase inverter current: T phase;;;;;;;;;;;; +;;192;PF_S;0.001;0-2000;Power factor of phase S in three- phase inverter x?(0;;;;;;;;;;;; +;;193;PF_T;0.001;0-2000;Power factor of phase T in three- phase inverter x? (0;;;;;;;;;;;; +;;192;PF_S;0.001;0-2000;Power factor of phase S in three- phase inverter x?(0;;;;;;;;;;;; +;;400;FaultRecord1_YAndM;;;Fault Records 1_ years & months;;;;;;;;;;;; +;;401;FaultRecord1_DAndH;;;Fault Records 1_ days & hours;;;;;;;;;;;; +;;402;FaultRecord1_MAndS;;;Fault Records 1_ minutes & seconds;;;;;;;;;;;; +;;403;FaultRecord1_Code;;;Fault Records 1_ fault code;;;;;;;;;;;; +;;404;FaultRecord1_Value;;;Fault Records 1_ fault value;;;;;;;;;;;; +;;405;FaultRecord1_SetOrClr;;0/1;Fault Records 1_Fault occurred or cleared (0-fault occurred;;;;;;;;;;;; +;;406;FaultRecord2_YAndM;;;Fault Records 2_ years & months;;;;;;;;;;;; +;;407;FaultRecord2_DAndH;;;Fault Records 2_ days & hours;;;;;;;;;;;; +;;408;FaultRecord2_MAndS;;;Fault Records 2_ minutes & seconds;;;;;;;;;;;; +;;409;FaultRecord2_Code;;;Fault Records 2_ fault code;;;;;;;;;;;; +;;410;FaultRecord2_Value;;;Fault Records 2_Fault value;;;;;;;;;;;; +;;411;FaultRecord2_SetOrClr;;0/1;Fault Records 2_Fault occurred or clear (0 - Fault Occurred;;;;;;;;;;;; +;;994;FaultRecord100_YAndM;;;Fault Records 100_ years & months;;;;;;;;;;;; +;;995;FaultRecord100_DAndH;;;Fault records 100_ days & hours;;;;;;;;;;;; +;;996;FaultRecord100_MAndS;;;Fault Records 100_minutes & seconds;;;;;;;;;;;; +;;997;FaultRecord100_Code;;;Fault Records 100_ fault code;;;;;;;;;;;; +;;998;FaultRecord100_Value;;;The fault record is 100_ fault value;;;;;;;;;;;; +;;999;FaultRecord100_SetOrClr;;0/1;Fault Records 100_Fault Occurred or Cleared (0 - Fault Occurred;;;;;;;;;;;; +;;1000;WarnRecord1_YAndM;;;Alarm Records 1_ years & months;;;;;;;;;;;; +;;1001;WarnRecord1_DAndH;;;Alarm Records 1_ days & hours;;;;;;;;;;;; +;;1002;WarnRecord1_MAndS;;;Alarm records 1_ minutes &seconds;;;;;;;;;;;; +;;1003;WarnRecord1_Code;;;Alarm Records 1_ alarm code;;;;;;;;;;;; +;;1004;WarnRecord1_Value;;;Alarm Records 1_Alarm value;;;;;;;;;;;; +;;1005;WarnRecord1_SetOrClr;;0/1;Alarm Records 1_Alarm occurred or cleared (0 - alarm occurred;;;;;;;;;;;; +;;1006;WarnRecord2_YAndM;;;Alarm records 2_ years & months;;;;;;;;;;;; +;;1007;WarnRecord2_DAndH;;;Alarm Records 2_ days & hour;;;;;;;;;;;; +;;1008;WarnRecord2_MAndS;;;Alarm Records 2_ minutes & seconds;;;;;;;;;;;; +;;1009;WarnRecord2_Code;;;Alarm Records 2_Alarm code;;;;;;;;;;;; +;;1010;WarnRecord2_Value;;;Alarm Records 2_Alarm value;;;;;;;;;;;; +;;1011;WarnRecord2_SetOrClr;;0/1;Alarm Records 2_Alarm occurred or cleared (0 - alarm occurred;;;;;;;;;;;; +;;1594;WarnRecord100_YAndM;;;Alarm Records 100_ years & months;;;;;;;;;;;; +;;1595;WarnRecord100_DAndH;;;Alarm Records for 100_ days & hours;;;;;;;;;;;; +;;1596;WarnRecord100_MAndS;;;Alarm records 100_ minutes &seconds;;;;;;;;;;;; +;;1597;WarnRecord100_Code;;;Alarm Records 100_ alarm code;;;;;;;;;;;; +;;1598;WarnRecord100_Value;;;Alarm records 100_alarm value;;;;;;;;;;;; +;;1599;WarnRecord100_SetOrClr;;0/1;Alarm Records 100_Alarm occurred or cleared (0 - alarm occurred;;;;;;;;;;;; diff --git a/protocols/sigineer_v0.11.holding_registry_map.csv b/protocols/sigineer_v0.11.holding_registry_map.csv index e2ca7f1..aa29484 100644 --- a/protocols/sigineer_v0.11.holding_registry_map.csv +++ b/protocols/sigineer_v0.11.holding_registry_map.csv @@ -1,4 +1,4 @@ -variable name;data_type;register;documented name;description;customer write;values;unit;Initial value;note;;;;;;;;;;;; +variable name;data type;register;documented name;description;customer write;values;unit;Initial value;note;;;;;;;;;;;; ;;0;On_Off;"The Standby On/Off state and the AC output DisEN/EN state; The low byte is the Standby on/off(1/0), the high byte is the AC output disable/enable (1/0).";;"0x0000:    Standby    off, Output enable; 0x0001:    Standby    on, Output enable; 0x0100:    Standby    off, Output disable; 0x0101:    Standby    on, Output disable;";;0;;;;;;;;;;;;; ;;1;OutputConfig;AC output set;W;"{""0"": ""BAT First"", ""1"": ""PV First"",""2"": ""UTI First""}";;;;;0;;;;;;;;;; ;;2;ChargeConfig;Charge source set;W;"{""0"": ""PV first"",""1"": ""PV&UTI"",""2"": ""PV Only""}";;;;;0;;;;;;;;;; diff --git a/protocols/sigineer_v0.11.input_registry_map.csv b/protocols/sigineer_v0.11.input_registry_map.csv index f08095b..ff37f40 100644 --- a/protocols/sigineer_v0.11.input_registry_map.csv +++ b/protocols/sigineer_v0.11.input_registry_map.csv @@ -1,4 +1,4 @@ -variable name;data_type;register;documented name;description;values;unit;note;;;;;;;;;; +variable name;data type;register;documented name;description;values;unit;note;;;;;;;;;; ;;0;System Status;System run state;"{""0"": ""Standby"", ""1"": ""(No Use)"", ""2"": ""Discharge"", ""3"": ""Fault"", ""4"": ""Flash"", ""5"": ""PV charge"", ""6"": ""AC charge"", ""7"": ""Combine charge"", ""8"": ""Combine charge and Bypass"", ""9"": ""PV charge and Bypass"", ""10"": ""AC charge and Bypass"", ""11"": ""Bypass"", ""12"": ""PV charge and Discharge""}";;  (No Use) 2: Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge; 12:    PV    charge    and Discharge PV1 Voltage;;1;Vpv1;PV1 voltage;;0.1V;;;;;;;;;;; PV2 Voltage;;2;Vpv2;PV2 voltage;;0.1V;;;;;;;;;;;