diff --git a/MANIFEST.in b/MANIFEST.in index 1fdacb3..5cf8d85 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1 @@ -recursive-include hoymiles_wifi/protos *.proto -recursive-include hoymiles_wifi/protos *.py +recursive-include hoymiles_wifi/protobuf *.py diff --git a/hoymiles_wifi/__main__.py b/hoymiles_wifi/__main__.py index 74e79a5..bf22d1b 100644 --- a/hoymiles_wifi/__main__.py +++ b/hoymiles_wifi/__main__.py @@ -1,5 +1,5 @@ import argparse -from hoymiles_wifi.inverter import Inverter +from hoymiles_wifi.inverter2 import Inverter2 import time def main(): @@ -7,15 +7,23 @@ def main(): parser.add_argument("ip_address", type=str, help="IP address or hostname of the inverter") args = parser.parse_args() - inverter = Inverter(args.ip_address) + inverter = Inverter2(args.ip_address) try: while True: - response = inverter.update_state() + + response = inverter.get_real_data() if response: - print(f"Inverter State: {response}") + print(f"Get Real Data Response: {response}") else: - print("Unable to retrieve inverter state") + print("Unable to retrieve real data") + + + response = inverter.get_config() + if response: + print(f"Get Config Response: {response}") + else: + print("Unable to retrieve config") # Sleep for a while before the next update time.sleep(60) diff --git a/hoymiles_wifi/inverter.py b/hoymiles_wifi/inverter.py index 5e88026..94ccb20 100644 --- a/hoymiles_wifi/inverter.py +++ b/hoymiles_wifi/inverter.py @@ -1,71 +1,72 @@ -import socket -import struct -from hoymiles_wifi import logger -from hoymiles_wifi.protos.RealData_pb2 import RealDataResDTO, HMSStateResponse -from crcmod import mkCrcFun -from datetime import datetime -import time +# import socket +# import struct +# from hoymiles_wifi import logger +# from hoymiles_wifi.protos.RealData_pb2 import RealDataResDTO, HMSStateResponse + +# from crcmod import mkCrcFun +# from datetime import datetime +# import time -INVERTER_PORT = 10081 +# INVERTER_PORT = 10081 -class NetworkState: - Unknown = 0 - Online = 1 - Offline = 2 +# class NetworkState: +# Unknown = 0 +# Online = 1 +# Offline = 2 -class Inverter: - def __init__(self, host): - self.host = host - self.state = NetworkState.Unknown - self.sequence = 0 +# class Inverter: +# def __init__(self, host): +# self.host = host +# self.state = NetworkState.Unknown +# self.sequence = 0 - def set_state(self, new_state): - if self.state != new_state: - self.state = new_state - logger.info(f"Inverter is {new_state}") +# def set_state(self, new_state): +# if self.state != new_state: +# self.state = new_state +# logger.info(f"Inverter is {new_state}") - def update_state(self): - self.sequence = (self.sequence + 1) & 0xFFFF +# def update_state(self): +# self.sequence = (self.sequence + 1) & 0xFFFF - request = RealDataResDTO() - # date = datetime.now() - # time_string = date.strftime("%Y-%m-%d %H:%M:%S") - # request.ymd_hms = time_string - # request.cp = 23 + self.sequence - # request.offset = 0 - # request.time = int(time.time()) - header = b"\x48\x4d\xa3\x03" - request_as_bytes = request.SerializeToString() - crc16 = mkCrcFun(0x18005, rev=True, initCrc=0xFFFF, xorOut=0x0000)(request_as_bytes) - length = len(request_as_bytes) + 10 +# request = RealDataResDTO() +# # date = datetime.now() +# # time_string = date.strftime("%Y-%m-%d %H:%M:%S") +# # request.ymd_hms = time_string +# # request.cp = 23 + self.sequence +# # request.offset = 0 +# # request.time = int(time.time()) +# header = b"\x48\x4d\xa3\x03" +# request_as_bytes = request.SerializeToString() +# crc16 = mkCrcFun(0x18005, rev=True, initCrc=0xFFFF, xorOut=0x0000)(request_as_bytes) +# length = len(request_as_bytes) + 10 - # compose request message - message = header + struct.pack('>HHHH', self.sequence, crc16, length, 0) + request_as_bytes +# # compose request message +# message = header + struct.pack('>HHHH', self.sequence, crc16, length, 0) + request_as_bytes - address = (self.host, INVERTER_PORT) - try: - with socket.create_connection(address, timeout=0.5) as stream: - stream.settimeout(5) - stream.sendall(message) - buf = stream.recv(1024) - except (socket.error, socket.timeout) as e: - logger.debug(f"{e}") - self.set_state(NetworkState.Offline) - return None +# address = (self.host, INVERTER_PORT) +# try: +# with socket.create_connection(address, timeout=0.5) as stream: +# stream.settimeout(5) +# stream.sendall(message) +# buf = stream.recv(1024) +# except (socket.error, socket.timeout) as e: +# logger.debug(f"{e}") +# self.set_state(NetworkState.Offline) +# return None - read_length = struct.unpack('>H', buf[6:8])[0] +# read_length = struct.unpack('>H', buf[6:8])[0] - try: - parsed = HMSStateResponse.FromString(buf[10:10+read_length]) +# try: +# parsed = HMSStateResponse.FromString(buf[10:10+read_length]) - if not parsed: - raise ValueError("Parsing resulted in an empty or falsy value") +# if not parsed: +# raise ValueError("Parsing resulted in an empty or falsy value") - except Exception as e: - logger.debug(f"Failed to parse response: {e}") - self.set_state(NetworkState.Offline) - return None +# except Exception as e: +# logger.debug(f"Failed to parse response: {e}") +# self.set_state(NetworkState.Offline) +# return None - self.set_state(NetworkState.Online) - return parsed +# self.set_state(NetworkState.Online) +# return parsed \ No newline at end of file diff --git a/hoymiles_wifi/protobuf/APPHeartbeatPB.proto b/hoymiles_wifi/protobuf/APPHeartbeatPB.proto new file mode 100755 index 0000000..6baa7dc --- /dev/null +++ b/hoymiles_wifi/protobuf/APPHeartbeatPB.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +message HBReqDTO { + int32 offset = 1; // Offset value + int32 time = 2; // Timestamp of the request + int32 csq = 3; // Carrier Signal Quality (CSQ) + string dtu_serial_number = 4; // DTU serial number + string device_serial_number = 5; // Device serial number +} + +message HBResDTO { + int32 offset = 1; // Offset value + int32 time = 2; // Timestamp of the response + string ymd_hms = 3; // Timestamp in the format YMD_HMS +} diff --git a/hoymiles_wifi/protobuf/APPHeartbeatPB_pb2.py b/hoymiles_wifi/protobuf/APPHeartbeatPB_pb2.py new file mode 100644 index 0000000..7c56067 --- /dev/null +++ b/hoymiles_wifi/protobuf/APPHeartbeatPB_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: APPHeartbeatPB.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x41PPHeartbeatPB.proto\"n\n\x08HBReqDTO\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x0b\n\x03\x63sq\x18\x03 \x01(\x05\x12\x19\n\x11\x64tu_serial_number\x18\x04 \x01(\t\x12\x1c\n\x14\x64\x65vice_serial_number\x18\x05 \x01(\t\"9\n\x08HBResDTO\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x0f\n\x07ymd_hms\x18\x03 \x01(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'APPHeartbeatPB_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_HBREQDTO']._serialized_start=24 + _globals['_HBREQDTO']._serialized_end=134 + _globals['_HBRESDTO']._serialized_start=136 + _globals['_HBRESDTO']._serialized_end=193 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/APPInfomationData.proto b/hoymiles_wifi/protobuf/APPInfomationData.proto new file mode 100755 index 0000000..f532278 --- /dev/null +++ b/hoymiles_wifi/protobuf/APPInfomationData.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; + +message APPDtuInfoMO { + int32 device_kind = 1; + int32 dtu_sw = 2; + int32 dtu_hw = 3; + int32 dtu_step_time = 4; + int32 dtu_rf_hw = 5; + int32 dtu_rf_sw = 6; + int32 access_model = 7; + int32 communication_time = 8; + int32 signal_strength = 9; + string gprs_vsn = 10; + string wifi_vsn = 11; + string ka_nub = 12; + int32 dtu_rule_id = 13; + int32 dtu_error_code = 14; + int32 dtu485_mode = 15; + int32 dtu485_addr = 16; + int32 sub1g_fqband = 17; + int32 sub1g_chtnum = 18; + int32 sub1g_chnum = 19; + int32 sub1g_rp = 20; + int32 sub1g_chtotal = 21; + string gprs_imei = 22; +} + +message APPMeterInfoMO { + int32 device_kind = 1; + int64 meter_sn = 2; + int32 meter_model = 3; + int32 meter_ct = 4; + int32 com_way = 5; + int32 access_mode = 6; + int32 sw_vsn = 7; + string meter_val = 8; +} + +message APPRpInfoMO { + int32 device_kind = 1; + int64 rp_sn = 2; + int32 rp_sw = 3; + int32 rp_hw = 4; + int32 rp_rule_id = 5; +} + +message APPPvInfoMO { + int32 device_kind = 1; + int64 pv_sn = 2; + int32 pv_usfw = 3; + int32 pv_sw = 4; + int32 pv_hw_pn = 5; + int32 pv_hw = 6; + int32 pv_gpf_code = 7; + int32 pv_gpf = 8; + int32 pv_rf_hw = 9; + int32 pv_rf_sw = 10; + int32 mi_rule_id = 11; +} + +message APPFeatureMO { + int32 key = 1; + string value = 2; +} + +message APPInfoDataReqDTO { + string dtu_sn = 1; + uint32 time = 2; + int32 device_nub = 3; + int32 pv_nub = 4; + int32 package_nub = 5; + int32 package_now = 6; + int32 channel = 7; + APPDtuInfoMO mAPPDtuInfo = 8; + repeated APPMeterInfoMO mAPPMeterInfo = 9; + repeated APPRpInfoMO mAPPRpInfo = 10; + repeated APPPvInfoMO mAPPpvInfo = 11; + uint32 mf = 12; + repeated APPFeatureMO m_app_feature = 13; +} + +message APPInfoDataResDTO { + string ymd_hms = 1; + int32 offset = 2; + int32 package_now = 3; + int32 err_code = 4; + uint32 time = 5; +} diff --git a/hoymiles_wifi/protobuf/APPInfomationData_pb2.py b/hoymiles_wifi/protobuf/APPInfomationData_pb2.py new file mode 100644 index 0000000..6dcfde2 --- /dev/null +++ b/hoymiles_wifi/protobuf/APPInfomationData_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: APPInfomationData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x41PPInfomationData.proto\"\xd3\x03\n\x0c\x41PPDtuInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\x0e\n\x06\x64tu_sw\x18\x02 \x01(\x05\x12\x0e\n\x06\x64tu_hw\x18\x03 \x01(\x05\x12\x15\n\rdtu_step_time\x18\x04 \x01(\x05\x12\x11\n\tdtu_rf_hw\x18\x05 \x01(\x05\x12\x11\n\tdtu_rf_sw\x18\x06 \x01(\x05\x12\x14\n\x0c\x61\x63\x63\x65ss_model\x18\x07 \x01(\x05\x12\x1a\n\x12\x63ommunication_time\x18\x08 \x01(\x05\x12\x17\n\x0fsignal_strength\x18\t \x01(\x05\x12\x10\n\x08gprs_vsn\x18\n \x01(\t\x12\x10\n\x08wifi_vsn\x18\x0b \x01(\t\x12\x0e\n\x06ka_nub\x18\x0c \x01(\t\x12\x13\n\x0b\x64tu_rule_id\x18\r \x01(\x05\x12\x16\n\x0e\x64tu_error_code\x18\x0e \x01(\x05\x12\x13\n\x0b\x64tu485_mode\x18\x0f \x01(\x05\x12\x13\n\x0b\x64tu485_addr\x18\x10 \x01(\x05\x12\x14\n\x0csub1g_fqband\x18\x11 \x01(\x05\x12\x14\n\x0csub1g_chtnum\x18\x12 \x01(\x05\x12\x13\n\x0bsub1g_chnum\x18\x13 \x01(\x05\x12\x10\n\x08sub1g_rp\x18\x14 \x01(\x05\x12\x15\n\rsub1g_chtotal\x18\x15 \x01(\x05\x12\x11\n\tgprs_imei\x18\x16 \x01(\t\"\xa7\x01\n\x0e\x41PPMeterInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\x10\n\x08meter_sn\x18\x02 \x01(\x03\x12\x13\n\x0bmeter_model\x18\x03 \x01(\x05\x12\x10\n\x08meter_ct\x18\x04 \x01(\x05\x12\x0f\n\x07\x63om_way\x18\x05 \x01(\x05\x12\x13\n\x0b\x61\x63\x63\x65ss_mode\x18\x06 \x01(\x05\x12\x0e\n\x06sw_vsn\x18\x07 \x01(\x05\x12\x11\n\tmeter_val\x18\x08 \x01(\t\"c\n\x0b\x41PPRpInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\r\n\x05rp_sn\x18\x02 \x01(\x03\x12\r\n\x05rp_sw\x18\x03 \x01(\x05\x12\r\n\x05rp_hw\x18\x04 \x01(\x05\x12\x12\n\nrp_rule_id\x18\x05 \x01(\x05\"\xcf\x01\n\x0b\x41PPPvInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\r\n\x05pv_sn\x18\x02 \x01(\x03\x12\x0f\n\x07pv_usfw\x18\x03 \x01(\x05\x12\r\n\x05pv_sw\x18\x04 \x01(\x05\x12\x10\n\x08pv_hw_pn\x18\x05 \x01(\x05\x12\r\n\x05pv_hw\x18\x06 \x01(\x05\x12\x13\n\x0bpv_gpf_code\x18\x07 \x01(\x05\x12\x0e\n\x06pv_gpf\x18\x08 \x01(\x05\x12\x10\n\x08pv_rf_hw\x18\t \x01(\x05\x12\x10\n\x08pv_rf_sw\x18\n \x01(\x05\x12\x12\n\nmi_rule_id\x18\x0b \x01(\x05\"*\n\x0c\x41PPFeatureMO\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t\"\xd2\x02\n\x11\x41PPInfoDataReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\r\x12\x12\n\ndevice_nub\x18\x03 \x01(\x05\x12\x0e\n\x06pv_nub\x18\x04 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x05 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x06 \x01(\x05\x12\x0f\n\x07\x63hannel\x18\x07 \x01(\x05\x12\"\n\x0bmAPPDtuInfo\x18\x08 \x01(\x0b\x32\r.APPDtuInfoMO\x12&\n\rmAPPMeterInfo\x18\t \x03(\x0b\x32\x0f.APPMeterInfoMO\x12 \n\nmAPPRpInfo\x18\n \x03(\x0b\x32\x0c.APPRpInfoMO\x12 \n\nmAPPpvInfo\x18\x0b \x03(\x0b\x32\x0c.APPPvInfoMO\x12\n\n\x02mf\x18\x0c \x01(\r\x12$\n\rm_app_feature\x18\r \x03(\x0b\x32\r.APPFeatureMO\"i\n\x11\x41PPInfoDataResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x03 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\rb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'APPInfomationData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_APPDTUINFOMO']._serialized_start=28 + _globals['_APPDTUINFOMO']._serialized_end=495 + _globals['_APPMETERINFOMO']._serialized_start=498 + _globals['_APPMETERINFOMO']._serialized_end=665 + _globals['_APPRPINFOMO']._serialized_start=667 + _globals['_APPRPINFOMO']._serialized_end=766 + _globals['_APPPVINFOMO']._serialized_start=769 + _globals['_APPPVINFOMO']._serialized_end=976 + _globals['_APPFEATUREMO']._serialized_start=978 + _globals['_APPFEATUREMO']._serialized_end=1020 + _globals['_APPINFODATAREQDTO']._serialized_start=1023 + _globals['_APPINFODATAREQDTO']._serialized_end=1361 + _globals['_APPINFODATARESDTO']._serialized_start=1363 + _globals['_APPINFODATARESDTO']._serialized_end=1468 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/AlarmData.proto b/hoymiles_wifi/protobuf/AlarmData.proto new file mode 100755 index 0000000..e4c985a --- /dev/null +++ b/hoymiles_wifi/protobuf/AlarmData.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +message WInfoMO { + int64 pv_sn = 1; // PV serial number + int32 WCode = 2; // WCode identifier + int32 WNum = 3; // WNum value + int32 WTime1 = 4; // First timestamp value + int32 WTime2 = 5; // Second timestamp value + int32 WData1 = 6; // First data value + int32 WData2 = 7; // Second data value +} + +message WInfoReqDTO { + string dtu_sn = 1; // DTU serial number + int32 time = 2; // Timestamp of the request + repeated WInfoMO mWInfo = 3; // WInfoMO data array +} + +message WInfoResDTO { + string ymd_hms = 1; // Timestamp in the format YMD_HMS + int32 err_code = 2; // Error code indicator + int32 offset = 3; // Offset value + int32 time = 4; // Timestamp value +} + +message WWVDataReqDTO { + string dtu_sn = 1; // DTU serial number + int32 time = 2; // Timestamp of the request + int32 package_nub = 3; // Package number + int32 package_now = 4; // Current package number + int64 pv_sn = 5; // PV serial number + int32 WCode = 6; // WCode identifier + int32 WNum = 7; // WNum value + int32 WTime1 = 8; // First timestamp value + int32 WVDataL = 9; // Length of WWVData + int32 WPos = 10; // WPos value + string mWVData = 11; // WWVData string +} + +message WWVDataResDTO { + string ymd_hms = 1; // Timestamp in the format YMD_HMS + int32 package_now = 2; // Current package number + int32 err_code = 3; // Error code indicator + int32 offset = 4; // Offset value + int32 time = 5; // Timestamp value +} diff --git a/hoymiles_wifi/protobuf/AlarmData_pb2.py b/hoymiles_wifi/protobuf/AlarmData_pb2.py new file mode 100644 index 0000000..797dc8f --- /dev/null +++ b/hoymiles_wifi/protobuf/AlarmData_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: AlarmData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x41larmData.proto\"u\n\x07WInfoMO\x12\r\n\x05pv_sn\x18\x01 \x01(\x03\x12\r\n\x05WCode\x18\x02 \x01(\x05\x12\x0c\n\x04WNum\x18\x03 \x01(\x05\x12\x0e\n\x06WTime1\x18\x04 \x01(\x05\x12\x0e\n\x06WTime2\x18\x05 \x01(\x05\x12\x0e\n\x06WData1\x18\x06 \x01(\x05\x12\x0e\n\x06WData2\x18\x07 \x01(\x05\"E\n\x0bWInfoReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x18\n\x06mWInfo\x18\x03 \x03(\x0b\x32\x08.WInfoMO\"N\n\x0bWInfoResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x10\n\x08\x65rr_code\x18\x02 \x01(\x05\x12\x0e\n\x06offset\x18\x03 \x01(\x05\x12\x0c\n\x04time\x18\x04 \x01(\x05\"\xc3\x01\n\rWWVDataReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x04 \x01(\x05\x12\r\n\x05pv_sn\x18\x05 \x01(\x03\x12\r\n\x05WCode\x18\x06 \x01(\x05\x12\x0c\n\x04WNum\x18\x07 \x01(\x05\x12\x0e\n\x06WTime1\x18\x08 \x01(\x05\x12\x0f\n\x07WVDataL\x18\t \x01(\x05\x12\x0c\n\x04WPos\x18\n \x01(\x05\x12\x0f\n\x07mWVData\x18\x0b \x01(\t\"e\n\rWWVDataResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x13\n\x0bpackage_now\x18\x02 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'AlarmData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_WINFOMO']._serialized_start=19 + _globals['_WINFOMO']._serialized_end=136 + _globals['_WINFOREQDTO']._serialized_start=138 + _globals['_WINFOREQDTO']._serialized_end=207 + _globals['_WINFORESDTO']._serialized_start=209 + _globals['_WINFORESDTO']._serialized_end=287 + _globals['_WWVDATAREQDTO']._serialized_start=290 + _globals['_WWVDATAREQDTO']._serialized_end=485 + _globals['_WWVDATARESDTO']._serialized_start=487 + _globals['_WWVDATARESDTO']._serialized_end=588 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/AppGetHistED.proto b/hoymiles_wifi/protobuf/AppGetHistED.proto new file mode 100755 index 0000000..e6205af --- /dev/null +++ b/hoymiles_wifi/protobuf/AppGetHistED.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +message AppGetHistEDResDTO { + int32 cp = 1; // Control point identifier + int32 oft = 2; // Offset value + uint32 time = 3; // Timestamp of the response +} + +message APPEnergyInfoMO { + uint32 ed = 1; // Energy data + uint32 r_time = 2; // Relative timestamp +} + +message AppGetHistEDReqDTO { + int64 sn = 1; // Serial number + int32 oft = 2; // Offset value + uint32 time = 3; // Timestamp of the request + repeated APPEnergyInfoMO energ = 4; // APPEnergyInfoMO data array +} diff --git a/hoymiles_wifi/protobuf/AppGetHistED_pb2.py b/hoymiles_wifi/protobuf/AppGetHistED_pb2.py new file mode 100644 index 0000000..dde1d57 --- /dev/null +++ b/hoymiles_wifi/protobuf/AppGetHistED_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: AppGetHistED.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x41ppGetHistED.proto\";\n\x12\x41ppGetHistEDResDTO\x12\n\n\x02\x63p\x18\x01 \x01(\x05\x12\x0b\n\x03oft\x18\x02 \x01(\x05\x12\x0c\n\x04time\x18\x03 \x01(\r\"-\n\x0f\x41PPEnergyInfoMO\x12\n\n\x02\x65\x64\x18\x01 \x01(\r\x12\x0e\n\x06r_time\x18\x02 \x01(\r\"\\\n\x12\x41ppGetHistEDReqDTO\x12\n\n\x02sn\x18\x01 \x01(\x03\x12\x0b\n\x03oft\x18\x02 \x01(\x05\x12\x0c\n\x04time\x18\x03 \x01(\r\x12\x1f\n\x05\x65nerg\x18\x04 \x03(\x0b\x32\x10.APPEnergyInfoMOb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'AppGetHistED_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_APPGETHISTEDRESDTO']._serialized_start=22 + _globals['_APPGETHISTEDRESDTO']._serialized_end=81 + _globals['_APPENERGYINFOMO']._serialized_start=83 + _globals['_APPENERGYINFOMO']._serialized_end=128 + _globals['_APPGETHISTEDREQDTO']._serialized_start=130 + _globals['_APPGETHISTEDREQDTO']._serialized_end=222 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/AppGetHistPower.proto b/hoymiles_wifi/protobuf/AppGetHistPower.proto new file mode 100755 index 0000000..b41dc9c --- /dev/null +++ b/hoymiles_wifi/protobuf/AppGetHistPower.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +message AppGetHistPowerResDTO { + int32 control_point = 1; // Control point identifier + int32 offset = 2; // Offset value + uint32 requested_time = 3; // Time requested + uint32 requested_day = 4; // Day requested +} + +message AppGetHistPowerReqDTO { + int64 serial_number = 1; // Device serial number + int32 access_point = 2; // Access point identifier + int32 control_point = 3; // Control point identifier + int32 offset = 4; // Offset value + uint32 request_time = 5; // Timestamp of the request + uint32 start_time = 6; // Start timestamp + uint32 long_term_start = 7; // Long-term start timestamp + uint32 absolute_start = 8; // Absolute start timestamp + uint32 step_time = 9; // Step time + uint32 relative_power = 10; // Relative power + uint32 total_energy = 11; // Total energy + uint32 daily_energy = 12; // Daily energy + repeated int32 power_array = 13; // Array of power values + uint32 warning_number = 14; // Warning number +} diff --git a/hoymiles_wifi/protobuf/AppGetHistPower_pb2.py b/hoymiles_wifi/protobuf/AppGetHistPower_pb2.py new file mode 100644 index 0000000..99fb412 --- /dev/null +++ b/hoymiles_wifi/protobuf/AppGetHistPower_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: AppGetHistPower.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x41ppGetHistPower.proto\"m\n\x15\x41ppGetHistPowerResDTO\x12\x15\n\rcontrol_point\x18\x01 \x01(\x05\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\x16\n\x0erequested_time\x18\x03 \x01(\r\x12\x15\n\rrequested_day\x18\x04 \x01(\r\"\xca\x02\n\x15\x41ppGetHistPowerReqDTO\x12\x15\n\rserial_number\x18\x01 \x01(\x03\x12\x14\n\x0c\x61\x63\x63\x65ss_point\x18\x02 \x01(\x05\x12\x15\n\rcontrol_point\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x14\n\x0crequest_time\x18\x05 \x01(\r\x12\x12\n\nstart_time\x18\x06 \x01(\r\x12\x17\n\x0flong_term_start\x18\x07 \x01(\r\x12\x16\n\x0e\x61\x62solute_start\x18\x08 \x01(\r\x12\x11\n\tstep_time\x18\t \x01(\r\x12\x16\n\x0erelative_power\x18\n \x01(\r\x12\x14\n\x0ctotal_energy\x18\x0b \x01(\r\x12\x14\n\x0c\x64\x61ily_energy\x18\x0c \x01(\r\x12\x13\n\x0bpower_array\x18\r \x03(\x05\x12\x16\n\x0ewarning_number\x18\x0e \x01(\rb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'AppGetHistPower_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_APPGETHISTPOWERRESDTO']._serialized_start=25 + _globals['_APPGETHISTPOWERRESDTO']._serialized_end=134 + _globals['_APPGETHISTPOWERREQDTO']._serialized_start=137 + _globals['_APPGETHISTPOWERREQDTO']._serialized_end=467 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/AutoSearch.proto b/hoymiles_wifi/protobuf/AutoSearch.proto new file mode 100755 index 0000000..b06cb29 --- /dev/null +++ b/hoymiles_wifi/protobuf/AutoSearch.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +message AutoSearchReqDTO { + string dtu_serial_number = 1; // DTU serial number + int32 time = 2; // Timestamp of the request + int32 package_number = 3; // Total number of packages + int32 current_package = 4; // Current package number + repeated int64 mi_serial_numbers = 5; // Array of MI (Meter Interface) serial numbers +} + +message AutoSearchResDTO { + string ymd_hms = 1; // Timestamp in the format YMD_HMS + int32 offset = 2; // Offset value + int32 current_package = 3; // Current package number + int32 error_code = 4; // Error code indicator + int32 time = 5; // Timestamp of the response +} diff --git a/hoymiles_wifi/protobuf/AutoSearch_pb2.py b/hoymiles_wifi/protobuf/AutoSearch_pb2.py new file mode 100644 index 0000000..fc37994 --- /dev/null +++ b/hoymiles_wifi/protobuf/AutoSearch_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: AutoSearch.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x41utoSearch.proto\"\x87\x01\n\x10\x41utoSearchReqDTO\x12\x19\n\x11\x64tu_serial_number\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x16\n\x0epackage_number\x18\x03 \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x04 \x01(\x05\x12\x19\n\x11mi_serial_numbers\x18\x05 \x03(\x03\"n\n\x10\x41utoSearchResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x03 \x01(\x05\x12\x12\n\nerror_code\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'AutoSearch_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_AUTOSEARCHREQDTO']._serialized_start=21 + _globals['_AUTOSEARCHREQDTO']._serialized_end=156 + _globals['_AUTOSEARCHRESDTO']._serialized_start=158 + _globals['_AUTOSEARCHRESDTO']._serialized_end=268 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/CommandPB.proto b/hoymiles_wifi/protobuf/CommandPB.proto new file mode 100755 index 0000000..c55fc58 --- /dev/null +++ b/hoymiles_wifi/protobuf/CommandPB.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +message CommandResDTO { + int32 time = 1; + int32 action = 2; + int32 dev_kind = 3; + int32 package_nub = 4; + int32 package_now = 5; + int64 tid = 6; + string data = 7; + repeated string es_to_sn = 8; + repeated int64 mi_to_sn = 9; + int32 system_total_a = 10; + int32 system_total_b = 11; + int32 system_total_c = 12; + repeated int64 mi_sn_item_a = 13; + repeated int64 mi_sn_item_b = 14; + repeated int64 mi_sn_item_c = 15; +} + +message CommandReqDTO { + string dtu_sn = 1; + int32 time = 2; + int32 action = 3; + int32 package_now = 4; + int32 err_code = 5; + int64 tid = 6; +} + +message ESOperatingStatusMO { + string es_sn = 1; + int32 progress_rate = 2; +} + +message MIOperatingStatusMO { + int64 mi_sn = 1; + int32 progress_rate = 2; +} + +message MIErrorStatusMO { + int64 mi_sn = 1; + int64 error_code = 2; +} + +message ESSucStatusMO { + string es_sn = 1; +} + +message ESErrorStatusMO { + string es_sn = 1; + int64 error_code = 2; +} + +message CommandStatusReqDTO { + string dtu_sn = 1; + int32 time = 2; + int32 action = 3; + int32 package_nub = 4; + int32 package_now = 5; + int64 tid = 6; + repeated string es_sns_sucs = 7; + repeated int64 mi_sns_sucs = 8; + repeated string es_sns_failds = 9; + repeated int64 mi_sns_failds = 10; + repeated ESOperatingStatusMO es_mOperatingStatus = 11; + repeated MIOperatingStatusMO mi_mOperatingStatus = 12; + repeated MIErrorStatusMO mi_mErrorStatus = 13; + repeated ESSucStatusMO es_mSucStatus = 14; + repeated ESErrorStatusMO es_mErrorStatus = 15; +} + +message CommandStatusResDTO { + int32 time = 1; + int32 action = 2; + int32 package_now = 3; + int64 tid = 4; + int32 err_code = 5; +} diff --git a/hoymiles_wifi/protobuf/CommandPB_pb2.py b/hoymiles_wifi/protobuf/CommandPB_pb2.py new file mode 100644 index 0000000..3424881 --- /dev/null +++ b/hoymiles_wifi/protobuf/CommandPB_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: CommandPB.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x43ommandPB.proto\"\xb2\x02\n\rCommandResDTO\x12\x0c\n\x04time\x18\x01 \x01(\x05\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\x05\x12\x10\n\x08\x64\x65v_kind\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x04 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x05 \x01(\x05\x12\x0b\n\x03tid\x18\x06 \x01(\x03\x12\x0c\n\x04\x64\x61ta\x18\x07 \x01(\t\x12\x10\n\x08\x65s_to_sn\x18\x08 \x03(\t\x12\x10\n\x08mi_to_sn\x18\t \x03(\x03\x12\x16\n\x0esystem_total_a\x18\n \x01(\x05\x12\x16\n\x0esystem_total_b\x18\x0b \x01(\x05\x12\x16\n\x0esystem_total_c\x18\x0c \x01(\x05\x12\x14\n\x0cmi_sn_item_a\x18\r \x03(\x03\x12\x14\n\x0cmi_sn_item_b\x18\x0e \x03(\x03\x12\x14\n\x0cmi_sn_item_c\x18\x0f \x03(\x03\"q\n\rCommandReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x04 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x05 \x01(\x05\x12\x0b\n\x03tid\x18\x06 \x01(\x03\";\n\x13\x45SOperatingStatusMO\x12\r\n\x05\x65s_sn\x18\x01 \x01(\t\x12\x15\n\rprogress_rate\x18\x02 \x01(\x05\";\n\x13MIOperatingStatusMO\x12\r\n\x05mi_sn\x18\x01 \x01(\x03\x12\x15\n\rprogress_rate\x18\x02 \x01(\x05\"4\n\x0fMIErrorStatusMO\x12\r\n\x05mi_sn\x18\x01 \x01(\x03\x12\x12\n\nerror_code\x18\x02 \x01(\x03\"\x1e\n\rESSucStatusMO\x12\r\n\x05\x65s_sn\x18\x01 \x01(\t\"4\n\x0f\x45SErrorStatusMO\x12\r\n\x05\x65s_sn\x18\x01 \x01(\t\x12\x12\n\nerror_code\x18\x02 \x01(\x03\"\xb5\x03\n\x13\x43ommandStatusReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x04 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x05 \x01(\x05\x12\x0b\n\x03tid\x18\x06 \x01(\x03\x12\x13\n\x0b\x65s_sns_sucs\x18\x07 \x03(\t\x12\x13\n\x0bmi_sns_sucs\x18\x08 \x03(\x03\x12\x15\n\res_sns_failds\x18\t \x03(\t\x12\x15\n\rmi_sns_failds\x18\n \x03(\x03\x12\x31\n\x13\x65s_mOperatingStatus\x18\x0b \x03(\x0b\x32\x14.ESOperatingStatusMO\x12\x31\n\x13mi_mOperatingStatus\x18\x0c \x03(\x0b\x32\x14.MIOperatingStatusMO\x12)\n\x0fmi_mErrorStatus\x18\r \x03(\x0b\x32\x10.MIErrorStatusMO\x12%\n\res_mSucStatus\x18\x0e \x03(\x0b\x32\x0e.ESSucStatusMO\x12)\n\x0f\x65s_mErrorStatus\x18\x0f \x03(\x0b\x32\x10.ESErrorStatusMO\"g\n\x13\x43ommandStatusResDTO\x12\x0c\n\x04time\x18\x01 \x01(\x05\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x03 \x01(\x05\x12\x0b\n\x03tid\x18\x04 \x01(\x03\x12\x10\n\x08\x65rr_code\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'CommandPB_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_COMMANDRESDTO']._serialized_start=20 + _globals['_COMMANDRESDTO']._serialized_end=326 + _globals['_COMMANDREQDTO']._serialized_start=328 + _globals['_COMMANDREQDTO']._serialized_end=441 + _globals['_ESOPERATINGSTATUSMO']._serialized_start=443 + _globals['_ESOPERATINGSTATUSMO']._serialized_end=502 + _globals['_MIOPERATINGSTATUSMO']._serialized_start=504 + _globals['_MIOPERATINGSTATUSMO']._serialized_end=563 + _globals['_MIERRORSTATUSMO']._serialized_start=565 + _globals['_MIERRORSTATUSMO']._serialized_end=617 + _globals['_ESSUCSTATUSMO']._serialized_start=619 + _globals['_ESSUCSTATUSMO']._serialized_end=649 + _globals['_ESERRORSTATUSMO']._serialized_start=651 + _globals['_ESERRORSTATUSMO']._serialized_end=703 + _globals['_COMMANDSTATUSREQDTO']._serialized_start=706 + _globals['_COMMANDSTATUSREQDTO']._serialized_end=1143 + _globals['_COMMANDSTATUSRESDTO']._serialized_start=1145 + _globals['_COMMANDSTATUSRESDTO']._serialized_end=1248 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/DevConfig.proto b/hoymiles_wifi/protobuf/DevConfig.proto new file mode 100755 index 0000000..1efe666 --- /dev/null +++ b/hoymiles_wifi/protobuf/DevConfig.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +message DevConfigFetchResDTO { + int32 response_time = 1; // Timestamp of the response + int64 transaction_id = 2; // Transaction ID + string dtu_sn = 3; // DTU serial number + string dev_sn = 4; // Device serial number + int32 current_package = 5; // Current package number + int32 rule_type = 6; // Rule type +} + +message DevConfigFetchReqDTO { + int32 request_time = 1; // Timestamp of the request + int64 transaction_id = 2; // Transaction ID + int32 rule_id = 3; // Rule ID + string data = 4; // Data + int32 crc = 5; // CRC value + string dtu_sn = 6; // DTU serial number + string dev_sn = 7; // Device serial number + string cfg_data = 8; // Configuration data + int32 cfg_crc = 9; // Configuration CRC value + int32 total_packages = 10; // Total number of packages + int32 current_package = 11; // Current package number + int32 rule_type = 12; // Rule type +} + +message DevConfigPutResDTO { + int32 response_time = 1; // Timestamp of the response + int64 transaction_id = 2; // Transaction ID + int32 rule_id = 3; // Rule ID + string data = 4; // Data + int32 crc = 5; // CRC value + string dtu_sn = 6; // DTU serial number + string dev_sn = 7; // Device serial number + string cfg_data = 8; // Configuration data + int32 cfg_crc = 9; // Configuration CRC value + int32 total_packages = 10; // Total number of packages + int32 current_package = 11; // Current package number + repeated int64 mi_to_sn = 12; // List of MI (Meter Interface) serial numbers + int32 rule_type = 13; // Rule type +} + +message DevConfigPutReqDTO { + int32 request_time = 1; // Timestamp of the request + int64 transaction_id = 2; // Transaction ID + string dtu_sn = 3; // DTU serial number + string dev_sn = 4; // Device serial number + int32 status = 5; // Status indicator + int32 current_package = 6; // Current package number + repeated int64 mi_to_sn = 7; // List of MI (Meter Interface) serial numbers + int32 rule_type = 8; // Rule type +} + +message DevConfigReportReqDTO { + int32 request_time = 1; // Timestamp of the request + int64 transaction_id = 2; // Transaction ID + int32 rule_id = 3; // Rule ID + string data = 4; // Data + int32 crc = 5; // CRC value + string dtu_sn = 6; // DTU serial number + string dev_sn = 7; // Device serial number + string cfg_data = 8; // Configuration data + int32 cfg_crc = 9; // Configuration CRC value + int32 total_packages = 10; // Total number of packages + int32 current_package = 11; // Current package number + int32 rule_type = 12; // Rule type +} + +message DevConfigReportResDTO { + int32 response_time = 1; // Timestamp of the response + int64 transaction_id = 2; // Transaction ID + string dtu_sn = 3; // DTU serial number + string dev_sn = 4; // Device serial number + int32 current_package = 5; // Current package number + int32 rule_type = 6; // Rule type +} diff --git a/hoymiles_wifi/protobuf/DevConfig_pb2.py b/hoymiles_wifi/protobuf/DevConfig_pb2.py new file mode 100644 index 0000000..e8f82b4 --- /dev/null +++ b/hoymiles_wifi/protobuf/DevConfig_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: DevConfig.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x44\x65vConfig.proto\"\x91\x01\n\x14\x44\x65vConfigFetchResDTO\x12\x15\n\rresponse_time\x18\x01 \x01(\x05\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\x12\x0e\n\x06\x64tu_sn\x18\x03 \x01(\t\x12\x0e\n\x06\x64\x65v_sn\x18\x04 \x01(\t\x12\x17\n\x0f\x63urrent_package\x18\x05 \x01(\x05\x12\x11\n\trule_type\x18\x06 \x01(\x05\"\xf7\x01\n\x14\x44\x65vConfigFetchReqDTO\x12\x14\n\x0crequest_time\x18\x01 \x01(\x05\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\x12\x0f\n\x07rule_id\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x0b\n\x03\x63rc\x18\x05 \x01(\x05\x12\x0e\n\x06\x64tu_sn\x18\x06 \x01(\t\x12\x0e\n\x06\x64\x65v_sn\x18\x07 \x01(\t\x12\x10\n\x08\x63\x66g_data\x18\x08 \x01(\t\x12\x0f\n\x07\x63\x66g_crc\x18\t \x01(\x05\x12\x16\n\x0etotal_packages\x18\n \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x0b \x01(\x05\x12\x11\n\trule_type\x18\x0c \x01(\x05\"\x88\x02\n\x12\x44\x65vConfigPutResDTO\x12\x15\n\rresponse_time\x18\x01 \x01(\x05\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\x12\x0f\n\x07rule_id\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x0b\n\x03\x63rc\x18\x05 \x01(\x05\x12\x0e\n\x06\x64tu_sn\x18\x06 \x01(\t\x12\x0e\n\x06\x64\x65v_sn\x18\x07 \x01(\t\x12\x10\n\x08\x63\x66g_data\x18\x08 \x01(\t\x12\x0f\n\x07\x63\x66g_crc\x18\t \x01(\x05\x12\x16\n\x0etotal_packages\x18\n \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x0b \x01(\x05\x12\x10\n\x08mi_to_sn\x18\x0c \x03(\x03\x12\x11\n\trule_type\x18\r \x01(\x05\"\xb0\x01\n\x12\x44\x65vConfigPutReqDTO\x12\x14\n\x0crequest_time\x18\x01 \x01(\x05\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\x12\x0e\n\x06\x64tu_sn\x18\x03 \x01(\t\x12\x0e\n\x06\x64\x65v_sn\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x06 \x01(\x05\x12\x10\n\x08mi_to_sn\x18\x07 \x03(\x03\x12\x11\n\trule_type\x18\x08 \x01(\x05\"\xf8\x01\n\x15\x44\x65vConfigReportReqDTO\x12\x14\n\x0crequest_time\x18\x01 \x01(\x05\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\x12\x0f\n\x07rule_id\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x0b\n\x03\x63rc\x18\x05 \x01(\x05\x12\x0e\n\x06\x64tu_sn\x18\x06 \x01(\t\x12\x0e\n\x06\x64\x65v_sn\x18\x07 \x01(\t\x12\x10\n\x08\x63\x66g_data\x18\x08 \x01(\t\x12\x0f\n\x07\x63\x66g_crc\x18\t \x01(\x05\x12\x16\n\x0etotal_packages\x18\n \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x0b \x01(\x05\x12\x11\n\trule_type\x18\x0c \x01(\x05\"\x92\x01\n\x15\x44\x65vConfigReportResDTO\x12\x15\n\rresponse_time\x18\x01 \x01(\x05\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\x12\x0e\n\x06\x64tu_sn\x18\x03 \x01(\t\x12\x0e\n\x06\x64\x65v_sn\x18\x04 \x01(\t\x12\x17\n\x0f\x63urrent_package\x18\x05 \x01(\x05\x12\x11\n\trule_type\x18\x06 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'DevConfig_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_DEVCONFIGFETCHRESDTO']._serialized_start=20 + _globals['_DEVCONFIGFETCHRESDTO']._serialized_end=165 + _globals['_DEVCONFIGFETCHREQDTO']._serialized_start=168 + _globals['_DEVCONFIGFETCHREQDTO']._serialized_end=415 + _globals['_DEVCONFIGPUTRESDTO']._serialized_start=418 + _globals['_DEVCONFIGPUTRESDTO']._serialized_end=682 + _globals['_DEVCONFIGPUTREQDTO']._serialized_start=685 + _globals['_DEVCONFIGPUTREQDTO']._serialized_end=861 + _globals['_DEVCONFIGREPORTREQDTO']._serialized_start=864 + _globals['_DEVCONFIGREPORTREQDTO']._serialized_end=1112 + _globals['_DEVCONFIGREPORTRESDTO']._serialized_start=1115 + _globals['_DEVCONFIGREPORTRESDTO']._serialized_end=1261 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/EventData.proto b/hoymiles_wifi/protobuf/EventData.proto new file mode 100755 index 0000000..900dd9b --- /dev/null +++ b/hoymiles_wifi/protobuf/EventData.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +message EventDataResDTO { + int32 response_offset = 1; // Offset in the response + int32 response_time = 2; // Timestamp of the response + string start_timestamp = 3; // Start timestamp in YYYY-MM-DD HH:MM:SS format +} + +message MIEvent { + int32 event_code = 1; // Event code + int32 event_status = 2; // Event status + int32 event_count = 3; // Event count + int32 pv_voltage = 4; // PV voltage + int32 grid_voltage = 5; // Grid voltage + int32 grid_frequency = 6; // Grid frequency + int32 grid_power = 7; // Grid power + int32 temperature = 8; // Temperature + int64 mi_id = 9; // Meter Interface (MI) ID + int32 start_timestamp = 10; // Start timestamp +} + +message EventDataReqDTO { + int32 request_offset = 1; // Offset in the request + int32 request_time = 2; // Timestamp of the request + repeated MIEvent mi_events = 3; // List of MI (Meter Interface) events +} diff --git a/hoymiles_wifi/protobuf/EventData_pb2.py b/hoymiles_wifi/protobuf/EventData_pb2.py new file mode 100644 index 0000000..4124ee6 --- /dev/null +++ b/hoymiles_wifi/protobuf/EventData_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: EventData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x45ventData.proto\"Z\n\x0f\x45ventDataResDTO\x12\x17\n\x0fresponse_offset\x18\x01 \x01(\x05\x12\x15\n\rresponse_time\x18\x02 \x01(\x05\x12\x17\n\x0fstart_timestamp\x18\x03 \x01(\t\"\xdb\x01\n\x07MIEvent\x12\x12\n\nevent_code\x18\x01 \x01(\x05\x12\x14\n\x0c\x65vent_status\x18\x02 \x01(\x05\x12\x13\n\x0b\x65vent_count\x18\x03 \x01(\x05\x12\x12\n\npv_voltage\x18\x04 \x01(\x05\x12\x14\n\x0cgrid_voltage\x18\x05 \x01(\x05\x12\x16\n\x0egrid_frequency\x18\x06 \x01(\x05\x12\x12\n\ngrid_power\x18\x07 \x01(\x05\x12\x13\n\x0btemperature\x18\x08 \x01(\x05\x12\r\n\x05mi_id\x18\t \x01(\x03\x12\x17\n\x0fstart_timestamp\x18\n \x01(\x05\"\\\n\x0f\x45ventDataReqDTO\x12\x16\n\x0erequest_offset\x18\x01 \x01(\x05\x12\x14\n\x0crequest_time\x18\x02 \x01(\x05\x12\x1b\n\tmi_events\x18\x03 \x03(\x0b\x32\x08.MIEventb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'EventData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_EVENTDATARESDTO']._serialized_start=19 + _globals['_EVENTDATARESDTO']._serialized_end=109 + _globals['_MIEVENT']._serialized_start=112 + _globals['_MIEVENT']._serialized_end=331 + _globals['_EVENTDATAREQDTO']._serialized_start=333 + _globals['_EVENTDATAREQDTO']._serialized_end=425 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/GPSTData.proto b/hoymiles_wifi/protobuf/GPSTData.proto new file mode 100755 index 0000000..fccdb8f --- /dev/null +++ b/hoymiles_wifi/protobuf/GPSTData.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +message STValMO { + int32 code = 1; + int32 dflt_val = 2; + int32 dflt_tim = 3; + int32 rslt_val = 4; + int32 rslt_tim = 5; +} + +message GPSTValMO { + int64 pv_sn = 1; + int32 ver = 2; + int32 st = 3; + int32 gpf = 4; + int32 gpf_ver = 5; + STValMO hv1_stval = 6; + STValMO lv1_stval = 7; + STValMO hv2_stval = 8; + STValMO lv2_stval = 9; + STValMO hf1_stval = 10; + STValMO lf1_stval = 11; + STValMO hf2_stval = 12; + STValMO lf2_stval = 13; +} + +message GPSTReqDTO { + string dtu_sn = 1; + int32 time = 2; + int32 package_nub = 3; + int32 package_now = 4; + repeated GPSTValMO mGPSTInfo = 5; +} + +message GPSTResDTO { + string ymd_hms = 1; + int32 offset = 2; + int32 package_now = 3; + int32 err_code = 4; + int32 time = 5; +} diff --git a/hoymiles_wifi/protobuf/GPSTData_pb2.py b/hoymiles_wifi/protobuf/GPSTData_pb2.py new file mode 100644 index 0000000..1d690e9 --- /dev/null +++ b/hoymiles_wifi/protobuf/GPSTData_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: GPSTData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eGPSTData.proto\"_\n\x07STValMO\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x10\n\x08\x64\x66lt_val\x18\x02 \x01(\x05\x12\x10\n\x08\x64\x66lt_tim\x18\x03 \x01(\x05\x12\x10\n\x08rslt_val\x18\x04 \x01(\x05\x12\x10\n\x08rslt_tim\x18\x05 \x01(\x05\"\xb9\x02\n\tGPSTValMO\x12\r\n\x05pv_sn\x18\x01 \x01(\x03\x12\x0b\n\x03ver\x18\x02 \x01(\x05\x12\n\n\x02st\x18\x03 \x01(\x05\x12\x0b\n\x03gpf\x18\x04 \x01(\x05\x12\x0f\n\x07gpf_ver\x18\x05 \x01(\x05\x12\x1b\n\thv1_stval\x18\x06 \x01(\x0b\x32\x08.STValMO\x12\x1b\n\tlv1_stval\x18\x07 \x01(\x0b\x32\x08.STValMO\x12\x1b\n\thv2_stval\x18\x08 \x01(\x0b\x32\x08.STValMO\x12\x1b\n\tlv2_stval\x18\t \x01(\x0b\x32\x08.STValMO\x12\x1b\n\thf1_stval\x18\n \x01(\x0b\x32\x08.STValMO\x12\x1b\n\tlf1_stval\x18\x0b \x01(\x0b\x32\x08.STValMO\x12\x1b\n\thf2_stval\x18\x0c \x01(\x0b\x32\x08.STValMO\x12\x1b\n\tlf2_stval\x18\r \x01(\x0b\x32\x08.STValMO\"s\n\nGPSTReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x04 \x01(\x05\x12\x1d\n\tmGPSTInfo\x18\x05 \x03(\x0b\x32\n.GPSTValMO\"b\n\nGPSTResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x03 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'GPSTData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_STVALMO']._serialized_start=18 + _globals['_STVALMO']._serialized_end=113 + _globals['_GPSTVALMO']._serialized_start=116 + _globals['_GPSTVALMO']._serialized_end=429 + _globals['_GPSTREQDTO']._serialized_start=431 + _globals['_GPSTREQDTO']._serialized_end=546 + _globals['_GPSTRESDTO']._serialized_start=548 + _globals['_GPSTRESDTO']._serialized_end=646 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/GetConfig.proto b/hoymiles_wifi/protobuf/GetConfig.proto new file mode 100755 index 0000000..4c31382 --- /dev/null +++ b/hoymiles_wifi/protobuf/GetConfig.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; + +message GetConfigResDTO { + int32 response_offset = 1; // Offset in the response + uint32 response_time = 2; // Timestamp of the response +} + +message GetConfigReqDTO { + int32 request_offset = 1; // Offset in the request + uint32 request_time = 2; // Timestamp of the request + int32 lock_password = 3; // Lock password + int32 lock_time = 4; // Lock time + int32 limit_power_mypower = 5; // Limit power mypower + int32 zero_export_433_addr = 6; // Zero export 433 address + int32 zero_export_enable = 7; // Zero export enable + int32 netmode_select = 8; // Netmode select + int32 channel_select = 9; // Channel select + int32 server_send_time = 10; // Server send time + int32 wifi_rssi = 11; // Wifi RSSI + int32 serverport = 12; // Server port + string apn_set = 13; // Access Point Name (APN) set + string meter_kind = 14; // Meter kind + string meter_interface = 15; // Meter interface + string wifi_ssid = 16; // Wifi SSID + string wifi_passward = 17; // Wifi password + string server_domain_name = 18; // Server domain name + int32 inv_type = 19; // Inverter type + string dtu_sn = 20; // DTU serial number + int32 access_model = 21; // Access model + int32 mac_0 = 22; // MAC address byte 0 + int32 mac_1 = 23; // MAC address byte 1 + int32 mac_2 = 24; // MAC address byte 2 + int32 mac_3 = 25; // MAC address byte 3 + int32 dhcp_switch = 26; // DHCP switch + int32 ip_addr_0 = 27; // IP address byte 0 + int32 ip_addr_1 = 28; // IP address byte 1 + int32 ip_addr_2 = 29; // IP address byte 2 + int32 ip_addr_3 = 30; // IP address byte 3 + int32 subnet_mask_0 = 31; // Subnet mask byte 0 + int32 subnet_mask_1 = 32; // Subnet mask byte 1 + int32 subnet_mask_2 = 33; // Subnet mask byte 2 + int32 subnet_mask_3 = 34; // Subnet mask byte 3 + int32 default_gateway_0 = 35; // Default gateway byte 0 + int32 default_gateway_1 = 36; // Default gateway byte 1 + int32 default_gateway_2 = 37; // Default gateway byte 2 + int32 default_gateway_3 = 38; // Default gateway byte 3 + string ka_nub = 39; // KA number + string apn_name = 40; // APN name + string apn_passward = 41; // APN password + int32 sub1g_sweep_switch = 42; // Sub1G sweep switch + int32 sub1g_work_channel = 43; // Sub1G work channel + int32 cable_dns_0 = 44; // Cable DNS byte 0 + int32 cable_dns_1 = 45; // Cable DNS byte 1 + int32 cable_dns_2 = 46; // Cable DNS byte 2 + int32 cable_dns_3 = 47; // Cable DNS byte 3 + int32 wifi_ip_addr_0 = 48; // Wifi IP address byte 0 + int32 wifi_ip_addr_1 = 49; // Wifi IP address byte 1 + int32 wifi_ip_addr_2 = 50; // Wifi IP address byte 2 + int32 wifi_ip_addr_3 = 51; // Wifi IP address byte 3 + int32 mac_4 = 52; // MAC address byte 4 + int32 mac_5 = 53; // MAC address byte 5 + int32 wifi_mac_0 = 54; // Wifi MAC address byte 0 + int32 wifi_mac_1 = 55; // Wifi MAC address byte 1 + int32 wifi_mac_2 = 56; // Wifi MAC address byte 2 + int32 wifi_mac_3 = 57; // Wifi MAC address byte 3 + int32 wifi_mac_4 = 58; // Wifi MAC address byte 4 + int32 wifi_mac_5 = 59; // Wifi MAC address byte 5 + string gprs_imei = 60; // GPRS IMEI + string dtu_ap_ssid = 61; // DTU Access Point (AP) SSID + string dtu_ap_pass = 62; // DTU AP password +} diff --git a/hoymiles_wifi/protobuf/GetConfig_pb2.py b/hoymiles_wifi/protobuf/GetConfig_pb2.py new file mode 100644 index 0000000..0b095b0 --- /dev/null +++ b/hoymiles_wifi/protobuf/GetConfig_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: GetConfig.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fGetConfig.proto\"A\n\x0fGetConfigResDTO\x12\x17\n\x0fresponse_offset\x18\x01 \x01(\x05\x12\x15\n\rresponse_time\x18\x02 \x01(\r\"\xc9\n\n\x0fGetConfigReqDTO\x12\x16\n\x0erequest_offset\x18\x01 \x01(\x05\x12\x14\n\x0crequest_time\x18\x02 \x01(\r\x12\x15\n\rlock_password\x18\x03 \x01(\x05\x12\x11\n\tlock_time\x18\x04 \x01(\x05\x12\x1b\n\x13limit_power_mypower\x18\x05 \x01(\x05\x12\x1c\n\x14zero_export_433_addr\x18\x06 \x01(\x05\x12\x1a\n\x12zero_export_enable\x18\x07 \x01(\x05\x12\x16\n\x0enetmode_select\x18\x08 \x01(\x05\x12\x16\n\x0e\x63hannel_select\x18\t \x01(\x05\x12\x18\n\x10server_send_time\x18\n \x01(\x05\x12\x11\n\twifi_rssi\x18\x0b \x01(\x05\x12\x12\n\nserverport\x18\x0c \x01(\x05\x12\x0f\n\x07\x61pn_set\x18\r \x01(\t\x12\x12\n\nmeter_kind\x18\x0e \x01(\t\x12\x17\n\x0fmeter_interface\x18\x0f \x01(\t\x12\x11\n\twifi_ssid\x18\x10 \x01(\t\x12\x15\n\rwifi_passward\x18\x11 \x01(\t\x12\x1a\n\x12server_domain_name\x18\x12 \x01(\t\x12\x10\n\x08inv_type\x18\x13 \x01(\x05\x12\x0e\n\x06\x64tu_sn\x18\x14 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_model\x18\x15 \x01(\x05\x12\r\n\x05mac_0\x18\x16 \x01(\x05\x12\r\n\x05mac_1\x18\x17 \x01(\x05\x12\r\n\x05mac_2\x18\x18 \x01(\x05\x12\r\n\x05mac_3\x18\x19 \x01(\x05\x12\x13\n\x0b\x64hcp_switch\x18\x1a \x01(\x05\x12\x11\n\tip_addr_0\x18\x1b \x01(\x05\x12\x11\n\tip_addr_1\x18\x1c \x01(\x05\x12\x11\n\tip_addr_2\x18\x1d \x01(\x05\x12\x11\n\tip_addr_3\x18\x1e \x01(\x05\x12\x15\n\rsubnet_mask_0\x18\x1f \x01(\x05\x12\x15\n\rsubnet_mask_1\x18 \x01(\x05\x12\x15\n\rsubnet_mask_2\x18! \x01(\x05\x12\x15\n\rsubnet_mask_3\x18\" \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_0\x18# \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_1\x18$ \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_2\x18% \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_3\x18& \x01(\x05\x12\x0e\n\x06ka_nub\x18\' \x01(\t\x12\x10\n\x08\x61pn_name\x18( \x01(\t\x12\x14\n\x0c\x61pn_passward\x18) \x01(\t\x12\x1a\n\x12sub1g_sweep_switch\x18* \x01(\x05\x12\x1a\n\x12sub1g_work_channel\x18+ \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_0\x18, \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_1\x18- \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_2\x18. \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_3\x18/ \x01(\x05\x12\x16\n\x0ewifi_ip_addr_0\x18\x30 \x01(\x05\x12\x16\n\x0ewifi_ip_addr_1\x18\x31 \x01(\x05\x12\x16\n\x0ewifi_ip_addr_2\x18\x32 \x01(\x05\x12\x16\n\x0ewifi_ip_addr_3\x18\x33 \x01(\x05\x12\r\n\x05mac_4\x18\x34 \x01(\x05\x12\r\n\x05mac_5\x18\x35 \x01(\x05\x12\x12\n\nwifi_mac_0\x18\x36 \x01(\x05\x12\x12\n\nwifi_mac_1\x18\x37 \x01(\x05\x12\x12\n\nwifi_mac_2\x18\x38 \x01(\x05\x12\x12\n\nwifi_mac_3\x18\x39 \x01(\x05\x12\x12\n\nwifi_mac_4\x18: \x01(\x05\x12\x12\n\nwifi_mac_5\x18; \x01(\x05\x12\x11\n\tgprs_imei\x18< \x01(\t\x12\x13\n\x0b\x64tu_ap_ssid\x18= \x01(\t\x12\x13\n\x0b\x64tu_ap_pass\x18> \x01(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'GetConfig_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_GETCONFIGRESDTO']._serialized_start=19 + _globals['_GETCONFIGRESDTO']._serialized_end=84 + _globals['_GETCONFIGREQDTO']._serialized_start=87 + _globals['_GETCONFIGREQDTO']._serialized_end=1440 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/InfomationData.proto b/hoymiles_wifi/protobuf/InfomationData.proto new file mode 100755 index 0000000..ff670b1 --- /dev/null +++ b/hoymiles_wifi/protobuf/InfomationData.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +message DtuInfoMO { + int32 device_kind = 1; + int32 dtu_sw = 2; + int32 dtu_hw = 3; + int32 dtu_step_time = 4; + int32 dtu_rf_hw = 5; + int32 dtu_rf_sw = 6; + int32 access_model = 7; + string gprs_vsn = 8; + string wifi_vsn = 9; + string ka_nub = 10; + int32 dtu_rule_id = 11; + int32 dtu_error_code = 12; + int32 grid_type = 13; + int32 zero_export_switch= 14; + int32 surplus_power_a = 15; + int32 surplus_power_b = 16; + int32 surplus_power_c = 17; + int32 zero_export_control= 18; + int32 phase_balance_switch = 19; + int32 tolerance_between_phases = 20; +} + +message MeterInfoMO { + int32 device_kind = 1; + int64 meter_sn = 2; + int32 meter_model = 3; + int32 meter_ct = 4; + int32 com_way = 5; + int32 access_mode = 6; +} + +message RpInfoMO { + int32 device_kind = 1; + int64 rp_sn = 2; + int32 rp_sw = 3; + int32 rp_hw = 4; + int32 rp_rule_id = 5; +} + +message PvInfoMO { + int32 device_kind = 1; + int64 pv_sn = 2; + int32 pv_usfw = 3; + int32 pv_sw = 4; + int32 pv_hw_pn = 5; + int32 pv_hw = 6; + int32 pv_gpf_code = 7; + int32 pv_gpf = 8; + int32 pv_rf_hw = 9; + int32 pv_rf_sw = 10; + int32 mi_rule_id = 11; +} + +message FeatureMO { + int32 key = 1; + string value = 2; +} + +message InfoDataReqDTO { + string dtu_sn = 1; + int32 time = 2; + int32 device_nub = 3; + int32 pv_nub = 4; + int32 package_nub = 5; + int32 package_now = 6; + int32 channel = 7; + DtuInfoMO mDtuInfo = 8; + repeated MeterInfoMO mMeterInfo = 9; + repeated RpInfoMO mRpInfo = 10; + repeated PvInfoMO mpvInfo = 11; + repeated FeatureMO m_feature = 12; +} + +message InfoDataResDTO { + string ymd_hms = 1; + int32 offset = 2; + int32 package_now = 3; + int32 err_code = 4; + int32 time = 5; +} diff --git a/hoymiles_wifi/protobuf/InfomationData_pb2.py b/hoymiles_wifi/protobuf/InfomationData_pb2.py new file mode 100644 index 0000000..1d00041 --- /dev/null +++ b/hoymiles_wifi/protobuf/InfomationData_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: InfomationData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14InfomationData.proto\"\xcb\x03\n\tDtuInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\x0e\n\x06\x64tu_sw\x18\x02 \x01(\x05\x12\x0e\n\x06\x64tu_hw\x18\x03 \x01(\x05\x12\x15\n\rdtu_step_time\x18\x04 \x01(\x05\x12\x11\n\tdtu_rf_hw\x18\x05 \x01(\x05\x12\x11\n\tdtu_rf_sw\x18\x06 \x01(\x05\x12\x14\n\x0c\x61\x63\x63\x65ss_model\x18\x07 \x01(\x05\x12\x10\n\x08gprs_vsn\x18\x08 \x01(\t\x12\x10\n\x08wifi_vsn\x18\t \x01(\t\x12\x0e\n\x06ka_nub\x18\n \x01(\t\x12\x13\n\x0b\x64tu_rule_id\x18\x0b \x01(\x05\x12\x16\n\x0e\x64tu_error_code\x18\x0c \x01(\x05\x12\x11\n\tgrid_type\x18\r \x01(\x05\x12\x1a\n\x12zero_export_switch\x18\x0e \x01(\x05\x12\x17\n\x0fsurplus_power_a\x18\x0f \x01(\x05\x12\x17\n\x0fsurplus_power_b\x18\x10 \x01(\x05\x12\x17\n\x0fsurplus_power_c\x18\x11 \x01(\x05\x12\x1b\n\x13zero_export_control\x18\x12 \x01(\x05\x12\x1c\n\x14phase_balance_switch\x18\x13 \x01(\x05\x12 \n\x18tolerance_between_phases\x18\x14 \x01(\x05\"\x81\x01\n\x0bMeterInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\x10\n\x08meter_sn\x18\x02 \x01(\x03\x12\x13\n\x0bmeter_model\x18\x03 \x01(\x05\x12\x10\n\x08meter_ct\x18\x04 \x01(\x05\x12\x0f\n\x07\x63om_way\x18\x05 \x01(\x05\x12\x13\n\x0b\x61\x63\x63\x65ss_mode\x18\x06 \x01(\x05\"`\n\x08RpInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\r\n\x05rp_sn\x18\x02 \x01(\x03\x12\r\n\x05rp_sw\x18\x03 \x01(\x05\x12\r\n\x05rp_hw\x18\x04 \x01(\x05\x12\x12\n\nrp_rule_id\x18\x05 \x01(\x05\"\xcc\x01\n\x08PvInfoMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\r\n\x05pv_sn\x18\x02 \x01(\x03\x12\x0f\n\x07pv_usfw\x18\x03 \x01(\x05\x12\r\n\x05pv_sw\x18\x04 \x01(\x05\x12\x10\n\x08pv_hw_pn\x18\x05 \x01(\x05\x12\r\n\x05pv_hw\x18\x06 \x01(\x05\x12\x13\n\x0bpv_gpf_code\x18\x07 \x01(\x05\x12\x0e\n\x06pv_gpf\x18\x08 \x01(\x05\x12\x10\n\x08pv_rf_hw\x18\t \x01(\x05\x12\x10\n\x08pv_rf_sw\x18\n \x01(\x05\x12\x12\n\nmi_rule_id\x18\x0b \x01(\x05\"\'\n\tFeatureMO\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t\"\xa4\x02\n\x0eInfoDataReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x12\n\ndevice_nub\x18\x03 \x01(\x05\x12\x0e\n\x06pv_nub\x18\x04 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x05 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x06 \x01(\x05\x12\x0f\n\x07\x63hannel\x18\x07 \x01(\x05\x12\x1c\n\x08mDtuInfo\x18\x08 \x01(\x0b\x32\n.DtuInfoMO\x12 \n\nmMeterInfo\x18\t \x03(\x0b\x32\x0c.MeterInfoMO\x12\x1a\n\x07mRpInfo\x18\n \x03(\x0b\x32\t.RpInfoMO\x12\x1a\n\x07mpvInfo\x18\x0b \x03(\x0b\x32\t.PvInfoMO\x12\x1d\n\tm_feature\x18\x0c \x03(\x0b\x32\n.FeatureMO\"f\n\x0eInfoDataResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x03 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'InfomationData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_DTUINFOMO']._serialized_start=25 + _globals['_DTUINFOMO']._serialized_end=484 + _globals['_METERINFOMO']._serialized_start=487 + _globals['_METERINFOMO']._serialized_end=616 + _globals['_RPINFOMO']._serialized_start=618 + _globals['_RPINFOMO']._serialized_end=714 + _globals['_PVINFOMO']._serialized_start=717 + _globals['_PVINFOMO']._serialized_end=921 + _globals['_FEATUREMO']._serialized_start=923 + _globals['_FEATUREMO']._serialized_end=962 + _globals['_INFODATAREQDTO']._serialized_start=965 + _globals['_INFODATAREQDTO']._serialized_end=1257 + _globals['_INFODATARESDTO']._serialized_start=1259 + _globals['_INFODATARESDTO']._serialized_end=1361 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/NetworkInfo.proto b/hoymiles_wifi/protobuf/NetworkInfo.proto new file mode 100755 index 0000000..bba6980 --- /dev/null +++ b/hoymiles_wifi/protobuf/NetworkInfo.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +message NetworkInfoReqDTO { + string dtu_sn = 1; // DTU serial number + uint32 time = 2; // Timestamp of the request + int32 net_set_mod = 3; // Network setting mode + int32 net_set_time = 4; // Network setting time + int32 net_set_state = 5; // Network setting state + int32 net_work_mod = 6; // Network working mode + int32 net_work_time = 7; // Network working time + int32 csq = 8; // Carrier Signal Quality (CSQ) + int32 net_work_state = 9; // Network working state + int32 ap_set_state = 10; // Access Point (AP) setting state +} + +message NetworkInfoResDTO { + int32 offset = 1; // Offset value for response + uint32 time = 2; // Timestamp of the response +} diff --git a/hoymiles_wifi/protobuf/NetworkInfo_pb2.py b/hoymiles_wifi/protobuf/NetworkInfo_pb2.py new file mode 100644 index 0000000..5b3a1e0 --- /dev/null +++ b/hoymiles_wifi/protobuf/NetworkInfo_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: NetworkInfo.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11NetworkInfo.proto\"\xdb\x01\n\x11NetworkInfoReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\r\x12\x13\n\x0bnet_set_mod\x18\x03 \x01(\x05\x12\x14\n\x0cnet_set_time\x18\x04 \x01(\x05\x12\x15\n\rnet_set_state\x18\x05 \x01(\x05\x12\x14\n\x0cnet_work_mod\x18\x06 \x01(\x05\x12\x15\n\rnet_work_time\x18\x07 \x01(\x05\x12\x0b\n\x03\x63sq\x18\x08 \x01(\x05\x12\x16\n\x0enet_work_state\x18\t \x01(\x05\x12\x14\n\x0c\x61p_set_state\x18\n \x01(\x05\"1\n\x11NetworkInfoResDTO\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\rb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'NetworkInfo_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_NETWORKINFOREQDTO']._serialized_start=22 + _globals['_NETWORKINFOREQDTO']._serialized_end=241 + _globals['_NETWORKINFORESDTO']._serialized_start=243 + _globals['_NETWORKINFORESDTO']._serialized_end=292 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/RealData.proto b/hoymiles_wifi/protobuf/RealData.proto new file mode 100755 index 0000000..a37988f --- /dev/null +++ b/hoymiles_wifi/protobuf/RealData.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +message MeterDataMO { + int32 device_kind = 1; // Device kind identifier + int64 meter_sn = 2; // Meter serial number + int32 meter_total_power = 3; // Total power by the meter (Watts) + int32 meter_phase_A_power = 4; // Power in phase A (Watts) + int32 meter_phase_B_power = 5; // Power in phase B (Watts) + int32 meter_phase_C_power = 6; // Power in phase C (Watts) + int32 meter_factor = 7; // Meter factor + int32 meter_total_energy = 8; // Total energy produced by the meter (Watt-hours) + int32 meter_phase_A_energy = 9; // Energy produced in phase A (Watt-hours) + int32 meter_phase_B_energy = 10;// Energy produced in phase B (Watt-hours) + int32 meter_phase_C_energy = 11;// Energy produced in phase C (Watt-hours) + int32 meter_total_consumed = 12;// Total energy consumed (Watt-hours) + int32 meter_phase_A_consumed = 13;// Energy consumed in phase A (Watt-hours) + int32 meter_phase_B_consumed = 14;// Energy consumed in phase B (Watt-hours) + int32 meter_phase_C_consumed = 15;// Energy consumed in phase C (Watt-hours) + int32 meter_fault = 16; // Meter fault code +} + +message RpDataMO { + int64 rp_sn = 1; // RP serial number + int32 rp_signal = 2; // RP signal strength + int32 rp_channel = 3; // RP channel number + int32 rp_link_nub = 4; // RP link number + int32 rp_link_status = 5; // RP link status +} + +message PvDataMO { + int64 pv_sn = 1; // PV serial number + int32 pv_port = 2; // PV port number + int32 pv_vol = 3; // PV voltage (Volts) + int32 pv_cur = 4; // PV current (Amperes) + int32 pv_power = 5; // PV power (Watts) + int32 pv_energy_total = 6; // Total energy generated by PV (Watt-hours) + int32 grid_vol = 7; // Grid voltage (Volts) + int32 grid_vol_max = 8; // Maximum grid voltage (Volts) + int32 grid_freq = 9; // Grid frequency (Hertz) + int32 grid_p = 10; // Grid active power (Watts) + int32 grid_q = 11; // Grid reactive power (VAR) + int32 grid_i = 12; // Grid current (Amperes) + int32 grid_pf = 13; // Grid power factor + int32 pv_temp = 14; // PV temperature + int32 pv_run_status = 15; // PV running status + int32 pv_fault_num = 16; // PV fault number + int32 pv_fault_cnt = 17; // PV fault count + int32 pv_warning_cnt = 18; // PV warning count + int32 pv_link_status = 19; // PV link status + int32 pv_send_power = 20; // PV send power (Watts) + int32 pv_receive_power = 21; // PV received power (Watts) + int32 pv_time = 22; // PV time + int32 pv_energy = 23; // PV energy (Watt-hours) + int32 mi_signal = 24; // Modulation index signal +} + +message RealDataReqDTO { + string dtu_sn = 1; // DTU serial number + int32 timestamp = 2; // Timestamp of the data + int32 device_number = 3; // Device number + int32 pv_number = 4; // PV number + int32 package_number = 5; // Package number + int32 current_package = 6; // Current package number + int32 csq = 7; // Carrier Signal Quality (CSQ) + repeated MeterDataMO meter_data = 8; // Meter data array + repeated RpDataMO rp_data = 9; // RpDataMO data array + repeated PvDataMO pv_data = 10; // PvDataMO data array + int32 version = 11; // Version number +} + +message RealDataResDTO { + string timestamp_ymd_hms = 1; // Timestamp in the format YMD_HMS + int32 current_package = 2; // Current package number + int32 error_code = 3; // Error code indicator + int32 offset = 4; // Offset value + int32 timestamp = 5; // Timestamp value +} diff --git a/hoymiles_wifi/protos/RealData.proto b/hoymiles_wifi/protobuf/RealDataHMS.proto similarity index 84% rename from hoymiles_wifi/protos/RealData.proto rename to hoymiles_wifi/protobuf/RealDataHMS.proto index c97346b..e426cf0 100644 --- a/hoymiles_wifi/protos/RealData.proto +++ b/hoymiles_wifi/protobuf/RealDataHMS.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -message RealDataResDTO { - string ymd_hms = 1; - int32 cp = 2; - int32 err_code = 3; - int32 offset = 4; - int32 time = 5; +message HMSRealDataResDTO { + string ymd_hms = 1; // YmdHms + int32 cp = 2; // PackageNow + int32 err_code = 3; // ErrCode + int32 offset = 4; // Offset + int32 time = 5; // Time } message InverterState { diff --git a/hoymiles_wifi/protobuf/RealDataHMS_pb2.py b/hoymiles_wifi/protobuf/RealDataHMS_pb2.py new file mode 100644 index 0000000..ef0c0b5 --- /dev/null +++ b/hoymiles_wifi/protobuf/RealDataHMS_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: RealDataHMS.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11RealDataHMS.proto\"`\n\x11HMSRealDataResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\n\n\x02\x63p\x18\x02 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\"\xe3\x01\n\rInverterState\x12\x0e\n\x06inv_id\x18\x01 \x01(\x03\x12\x0f\n\x07port_id\x18\x02 \x01(\x05\x12\x14\n\x0cgrid_voltage\x18\x03 \x01(\x05\x12\x11\n\tgrid_freq\x18\x04 \x01(\x05\x12\x18\n\x10pv_current_power\x18\x05 \x01(\x05\x12\x10\n\x08unknown1\x18\x07 \x01(\x05\x12\x10\n\x08unknown2\x18\x08 \x01(\x05\x12\x13\n\x0btemperature\x18\t \x01(\x05\x12\x10\n\x08unknown3\x18\n \x01(\x05\x12\x10\n\x08unknown4\x18\x0c \x01(\x05\x12\x11\n\tbit_field\x18\x14 \x01(\x05\"\xa0\x01\n\tPortState\x12\r\n\x05pv_sn\x18\x01 \x01(\x03\x12\x0f\n\x07pv_port\x18\x02 \x01(\x05\x12\x0e\n\x06pv_vol\x18\x03 \x01(\x05\x12\x0e\n\x06pv_cur\x18\x04 \x01(\x05\x12\x10\n\x08pv_power\x18\x05 \x01(\x05\x12\x17\n\x0fpv_energy_total\x18\x06 \x01(\x05\x12\x16\n\x0epv_daily_yield\x18\x07 \x01(\x05\x12\x10\n\x08\x62itfield\x18\x08 \x01(\x05\"\xe3\x01\n\x10HMSStateResponse\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x12\n\ndevice_nub\x18\x03 \x01(\x05\x12\x0e\n\x06pv_nub\x18\x04 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x05 \x01(\x05\x12&\n\x0einverter_state\x18\t \x03(\x0b\x32\x0e.InverterState\x12\x1e\n\nport_state\x18\x0b \x03(\x0b\x32\n.PortState\x12\x18\n\x10pv_current_power\x18\x0c \x01(\x05\x12\x16\n\x0epv_daily_yield\x18\r \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'RealDataHMS_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_HMSREALDATARESDTO']._serialized_start=21 + _globals['_HMSREALDATARESDTO']._serialized_end=117 + _globals['_INVERTERSTATE']._serialized_start=120 + _globals['_INVERTERSTATE']._serialized_end=347 + _globals['_PORTSTATE']._serialized_start=350 + _globals['_PORTSTATE']._serialized_end=510 + _globals['_HMSSTATERESPONSE']._serialized_start=513 + _globals['_HMSSTATERESPONSE']._serialized_end=740 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/RealDataNew.proto b/hoymiles_wifi/protobuf/RealDataNew.proto new file mode 100755 index 0000000..f0eb1be --- /dev/null +++ b/hoymiles_wifi/protobuf/RealDataNew.proto @@ -0,0 +1,123 @@ +syntax = "proto3"; + +message MeterMO { + int32 device_type = 1; // Device type identifier + int64 serial_number = 2; // Serial number of the meter + int32 phase_total_power = 3; // Total power across all phases (Watts) + int32 phase_A_power = 4; // Power in phase A (Watts) + int32 phase_B_power = 5; // Power in phase B (Watts) + int32 phase_C_power = 6; // Power in phase C (Watts) + int32 power_factor_total = 7; // Total power factor + int32 energy_total_power = 8; // Total energy generated (Watt-hours) + int32 energy_phase_A = 9; // Energy generated in phase A (Watt-hours) + int32 energy_phase_B = 10; // Energy generated in phase B (Watt-hours) + int32 energy_phase_C = 11; // Energy generated in phase C (Watt-hours) + int32 energy_total_consumed = 12; // Total energy consumed (Watt-hours) + int32 energy_phase_A_consumed = 13; // Energy consumed in phase A (Watt-hours) + int32 energy_phase_B_consumed = 14; // Energy consumed in phase B (Watt-hours) + int32 energy_phase_C_consumed = 15; // Energy consumed in phase C (Watt-hours) + int32 fault_code = 16; // Fault code indicator + int32 voltage_phase_A = 17; // Voltage in phase A (Volts) + int32 voltage_phase_B = 18; // Voltage in phase B (Volts) + int32 voltage_phase_C = 19; // Voltage in phase C (Volts) + int32 current_phase_A = 20; // Current in phase A (Amperes) + int32 current_phase_B = 21; // Current in phase B (Amperes) + int32 current_phase_C = 22; // Current in phase C (Amperes) + int32 power_factor_phase_A = 23; // Power factor in phase A + int32 power_factor_phase_B = 24; // Power factor in phase B + int32 power_factor_phase_C = 25; // Power factor in phase C +} + +message RpMO { + int64 serial_number = 1; // Serial number of the device + int32 signature = 2; // Signature value + int32 channel = 3; // Channel number + int32 pv_number = 4; // Photovoltaic (PV) number + int32 link_status = 5; // Link status indicator +} + +message RSDMO { + int64 serial_number = 1; // Serial number of the device + int32 firmware_version = 2; // Firmware version + int32 voltage = 3; // Voltage value + int32 power = 4; // Power value + int32 temperature = 5; // Temperature value + int32 warning_number = 6; // Warning number + int32 crc_checksum = 7; // CRC checksum + int32 link_status = 8; // Link status indicator +} + +message SGSMO { + int64 serial_number = 1; // Serial number of the device + int32 firmware_version = 2; // Firmware version + int32 voltage = 3; // Grid voltage (Volts) + int32 frequency = 4; // Grid frequency (Hertz) + int32 active_power = 5; // Active power (Watts) + int32 reactive_power = 6; // Reactive power (VAR) + int32 current = 7; // Current (Amperes) + int32 power_factor = 8; // Power factor + int32 temperature = 9; // Temperature value + int32 warning_number = 10; // Warning number + int32 crc_checksum = 11; // CRC checksum + int32 link_status = 12; // Link status indicator + int32 power_limit = 13; // Power limit (Watts) + int32 modulation_index_signal = 20; // Modulation index signal +} + +message TGSMO { + int64 serial_number = 1; // Serial number of the device + int32 firmware_version = 2; // Firmware version + int32 voltage_phase_A = 3; // Voltage in phase A (Volts) + int32 voltage_phase_B = 4; // Voltage in phase B (Volts) + int32 voltage_phase_C = 5; // Voltage in phase C (Volts) + int32 voltage_line_AB = 6; // Voltage between lines A and B (Volts) + int32 voltage_line_BC = 7; // Voltage between lines B and C (Volts) + int32 voltage_line_CA = 8; // Voltage between lines C and A (Volts) + int32 frequency = 9; // Frequency (Hertz) + int32 active_power = 10; // Active power (Watts) + int32 reactive_power = 11; // Reactive power (VAR) + int32 current_phase_A = 12; // Current in phase A (Amperes) + int32 current_phase_B = 13; // Current in phase B (Amperes) + int32 current_phase_C = 14; // Current in phase C (Amperes) + int32 power_factor = 15; // Power factor + int32 temperature = 16; // Temperature value + int32 warning_number = 17; // Warning number + int32 crc_checksum = 18; // CRC checksum + int32 link_status = 19; // Link status indicator + int32 modulation_index_signal = 20; // Modulation index signal +} + +message PvMO { + int64 serial_number = 1; // Serial number of the device + int32 phase_index = 2; // Phase index + int32 voltage = 3; // Voltage (Volts) + int32 current = 4; // Current (Amperes) + int32 power = 5; // Power (Watts) + int32 energy_total = 6; // Total energy generated (Watt-hours) + int32 energy_daily = 7; // Daily energy generated (Watt-hours) + int32 error_code = 8; // Error code indicator +} + +message RealDataNewReqDTO { + string device_serial_number = 1; // Serial number of the device + int32 timestamp = 2; // Timestamp of the data + int32 active_power = 3; // Active power (Watts) + int32 cumulative_power = 4; // Cumulative power (Watt-hours) + int32 firmware_version = 5; // Firmware version + repeated MeterMO meter_data = 6; // Meter data array + repeated RpMO rp_data = 7; // RpMO data array + repeated RSDMO rsd_data = 8; // RSDMO data array + repeated SGSMO sgs_data = 9; // SGSMO data array + repeated TGSMO tgs_data = 10; // TGSMO data array + repeated PvMO pv_data = 11; // PvMO data array + uint64 dtu_power = 12; // Power of the DTU (Watts) + uint64 dtu_daily_energy = 13; // Daily energy of the DTU (Watt-hours) +} + +message RealDataNewResDTO { + string timestamp_ymd_hms = 1; // Timestamp in the format YMD_HMS + int32 cumulative_power = 2; // Cumulative power (Watt-hours) + int32 error_code = 3; // Error code indicator + int32 offset = 4; // Offset value + int32 timestamp = 5; // Timestamp value +} diff --git a/hoymiles_wifi/protobuf/RealDataNew_pb2.py b/hoymiles_wifi/protobuf/RealDataNew_pb2.py new file mode 100644 index 0000000..b2eb0e0 --- /dev/null +++ b/hoymiles_wifi/protobuf/RealDataNew_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: RealDataNew.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11RealDataNew.proto\"\x9b\x05\n\x07MeterMO\x12\x13\n\x0b\x64\x65vice_type\x18\x01 \x01(\x05\x12\x15\n\rserial_number\x18\x02 \x01(\x03\x12\x19\n\x11phase_total_power\x18\x03 \x01(\x05\x12\x15\n\rphase_A_power\x18\x04 \x01(\x05\x12\x15\n\rphase_B_power\x18\x05 \x01(\x05\x12\x15\n\rphase_C_power\x18\x06 \x01(\x05\x12\x1a\n\x12power_factor_total\x18\x07 \x01(\x05\x12\x1a\n\x12\x65nergy_total_power\x18\x08 \x01(\x05\x12\x16\n\x0e\x65nergy_phase_A\x18\t \x01(\x05\x12\x16\n\x0e\x65nergy_phase_B\x18\n \x01(\x05\x12\x16\n\x0e\x65nergy_phase_C\x18\x0b \x01(\x05\x12\x1d\n\x15\x65nergy_total_consumed\x18\x0c \x01(\x05\x12\x1f\n\x17\x65nergy_phase_A_consumed\x18\r \x01(\x05\x12\x1f\n\x17\x65nergy_phase_B_consumed\x18\x0e \x01(\x05\x12\x1f\n\x17\x65nergy_phase_C_consumed\x18\x0f \x01(\x05\x12\x12\n\nfault_code\x18\x10 \x01(\x05\x12\x17\n\x0fvoltage_phase_A\x18\x11 \x01(\x05\x12\x17\n\x0fvoltage_phase_B\x18\x12 \x01(\x05\x12\x17\n\x0fvoltage_phase_C\x18\x13 \x01(\x05\x12\x17\n\x0f\x63urrent_phase_A\x18\x14 \x01(\x05\x12\x17\n\x0f\x63urrent_phase_B\x18\x15 \x01(\x05\x12\x17\n\x0f\x63urrent_phase_C\x18\x16 \x01(\x05\x12\x1c\n\x14power_factor_phase_A\x18\x17 \x01(\x05\x12\x1c\n\x14power_factor_phase_B\x18\x18 \x01(\x05\x12\x1c\n\x14power_factor_phase_C\x18\x19 \x01(\x05\"i\n\x04RpMO\x12\x15\n\rserial_number\x18\x01 \x01(\x03\x12\x11\n\tsignature\x18\x02 \x01(\x05\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x05\x12\x11\n\tpv_number\x18\x04 \x01(\x05\x12\x13\n\x0blink_status\x18\x05 \x01(\x05\"\xb0\x01\n\x05RSDMO\x12\x15\n\rserial_number\x18\x01 \x01(\x03\x12\x18\n\x10\x66irmware_version\x18\x02 \x01(\x05\x12\x0f\n\x07voltage\x18\x03 \x01(\x05\x12\r\n\x05power\x18\x04 \x01(\x05\x12\x13\n\x0btemperature\x18\x05 \x01(\x05\x12\x16\n\x0ewarning_number\x18\x06 \x01(\x05\x12\x14\n\x0c\x63rc_checksum\x18\x07 \x01(\x05\x12\x13\n\x0blink_status\x18\x08 \x01(\x05\"\xbf\x02\n\x05SGSMO\x12\x15\n\rserial_number\x18\x01 \x01(\x03\x12\x18\n\x10\x66irmware_version\x18\x02 \x01(\x05\x12\x0f\n\x07voltage\x18\x03 \x01(\x05\x12\x11\n\tfrequency\x18\x04 \x01(\x05\x12\x14\n\x0c\x61\x63tive_power\x18\x05 \x01(\x05\x12\x16\n\x0ereactive_power\x18\x06 \x01(\x05\x12\x0f\n\x07\x63urrent\x18\x07 \x01(\x05\x12\x14\n\x0cpower_factor\x18\x08 \x01(\x05\x12\x13\n\x0btemperature\x18\t \x01(\x05\x12\x16\n\x0ewarning_number\x18\n \x01(\x05\x12\x14\n\x0c\x63rc_checksum\x18\x0b \x01(\x05\x12\x13\n\x0blink_status\x18\x0c \x01(\x05\x12\x13\n\x0bpower_limit\x18\r \x01(\x05\x12\x1f\n\x17modulation_index_signal\x18\x14 \x01(\x05\"\xe9\x03\n\x05TGSMO\x12\x15\n\rserial_number\x18\x01 \x01(\x03\x12\x18\n\x10\x66irmware_version\x18\x02 \x01(\x05\x12\x17\n\x0fvoltage_phase_A\x18\x03 \x01(\x05\x12\x17\n\x0fvoltage_phase_B\x18\x04 \x01(\x05\x12\x17\n\x0fvoltage_phase_C\x18\x05 \x01(\x05\x12\x17\n\x0fvoltage_line_AB\x18\x06 \x01(\x05\x12\x17\n\x0fvoltage_line_BC\x18\x07 \x01(\x05\x12\x17\n\x0fvoltage_line_CA\x18\x08 \x01(\x05\x12\x11\n\tfrequency\x18\t \x01(\x05\x12\x14\n\x0c\x61\x63tive_power\x18\n \x01(\x05\x12\x16\n\x0ereactive_power\x18\x0b \x01(\x05\x12\x17\n\x0f\x63urrent_phase_A\x18\x0c \x01(\x05\x12\x17\n\x0f\x63urrent_phase_B\x18\r \x01(\x05\x12\x17\n\x0f\x63urrent_phase_C\x18\x0e \x01(\x05\x12\x14\n\x0cpower_factor\x18\x0f \x01(\x05\x12\x13\n\x0btemperature\x18\x10 \x01(\x05\x12\x16\n\x0ewarning_number\x18\x11 \x01(\x05\x12\x14\n\x0c\x63rc_checksum\x18\x12 \x01(\x05\x12\x13\n\x0blink_status\x18\x13 \x01(\x05\x12\x1f\n\x17modulation_index_signal\x18\x14 \x01(\x05\"\xa3\x01\n\x04PvMO\x12\x15\n\rserial_number\x18\x01 \x01(\x03\x12\x13\n\x0bphase_index\x18\x02 \x01(\x05\x12\x0f\n\x07voltage\x18\x03 \x01(\x05\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\x05\x12\r\n\x05power\x18\x05 \x01(\x05\x12\x14\n\x0c\x65nergy_total\x18\x06 \x01(\x05\x12\x14\n\x0c\x65nergy_daily\x18\x07 \x01(\x05\x12\x12\n\nerror_code\x18\x08 \x01(\x05\"\xd7\x02\n\x11RealDataNewReqDTO\x12\x1c\n\x14\x64\x65vice_serial_number\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x05\x12\x14\n\x0c\x61\x63tive_power\x18\x03 \x01(\x05\x12\x18\n\x10\x63umulative_power\x18\x04 \x01(\x05\x12\x18\n\x10\x66irmware_version\x18\x05 \x01(\x05\x12\x1c\n\nmeter_data\x18\x06 \x03(\x0b\x32\x08.MeterMO\x12\x16\n\x07rp_data\x18\x07 \x03(\x0b\x32\x05.RpMO\x12\x18\n\x08rsd_data\x18\x08 \x03(\x0b\x32\x06.RSDMO\x12\x18\n\x08sgs_data\x18\t \x03(\x0b\x32\x06.SGSMO\x12\x18\n\x08tgs_data\x18\n \x03(\x0b\x32\x06.TGSMO\x12\x16\n\x07pv_data\x18\x0b \x03(\x0b\x32\x05.PvMO\x12\x11\n\tdtu_power\x18\x0c \x01(\x04\x12\x18\n\x10\x64tu_daily_energy\x18\r \x01(\x04\"\x7f\n\x11RealDataNewResDTO\x12\x19\n\x11timestamp_ymd_hms\x18\x01 \x01(\t\x12\x18\n\x10\x63umulative_power\x18\x02 \x01(\x05\x12\x12\n\nerror_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x11\n\ttimestamp\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'RealDataNew_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_METERMO']._serialized_start=22 + _globals['_METERMO']._serialized_end=689 + _globals['_RPMO']._serialized_start=691 + _globals['_RPMO']._serialized_end=796 + _globals['_RSDMO']._serialized_start=799 + _globals['_RSDMO']._serialized_end=975 + _globals['_SGSMO']._serialized_start=978 + _globals['_SGSMO']._serialized_end=1297 + _globals['_TGSMO']._serialized_start=1300 + _globals['_TGSMO']._serialized_end=1789 + _globals['_PVMO']._serialized_start=1792 + _globals['_PVMO']._serialized_end=1955 + _globals['_REALDATANEWREQDTO']._serialized_start=1958 + _globals['_REALDATANEWREQDTO']._serialized_end=2301 + _globals['_REALDATANEWRESDTO']._serialized_start=2303 + _globals['_REALDATANEWRESDTO']._serialized_end=2430 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/RealData_pb2.py b/hoymiles_wifi/protobuf/RealData_pb2.py new file mode 100644 index 0000000..5652a3b --- /dev/null +++ b/hoymiles_wifi/protobuf/RealData_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: RealData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eRealData.proto\"\xc5\x03\n\x0bMeterDataMO\x12\x13\n\x0b\x64\x65vice_kind\x18\x01 \x01(\x05\x12\x10\n\x08meter_sn\x18\x02 \x01(\x03\x12\x19\n\x11meter_total_power\x18\x03 \x01(\x05\x12\x1b\n\x13meter_phase_A_power\x18\x04 \x01(\x05\x12\x1b\n\x13meter_phase_B_power\x18\x05 \x01(\x05\x12\x1b\n\x13meter_phase_C_power\x18\x06 \x01(\x05\x12\x14\n\x0cmeter_factor\x18\x07 \x01(\x05\x12\x1a\n\x12meter_total_energy\x18\x08 \x01(\x05\x12\x1c\n\x14meter_phase_A_energy\x18\t \x01(\x05\x12\x1c\n\x14meter_phase_B_energy\x18\n \x01(\x05\x12\x1c\n\x14meter_phase_C_energy\x18\x0b \x01(\x05\x12\x1c\n\x14meter_total_consumed\x18\x0c \x01(\x05\x12\x1e\n\x16meter_phase_A_consumed\x18\r \x01(\x05\x12\x1e\n\x16meter_phase_B_consumed\x18\x0e \x01(\x05\x12\x1e\n\x16meter_phase_C_consumed\x18\x0f \x01(\x05\x12\x13\n\x0bmeter_fault\x18\x10 \x01(\x05\"m\n\x08RpDataMO\x12\r\n\x05rp_sn\x18\x01 \x01(\x03\x12\x11\n\trp_signal\x18\x02 \x01(\x05\x12\x12\n\nrp_channel\x18\x03 \x01(\x05\x12\x13\n\x0brp_link_nub\x18\x04 \x01(\x05\x12\x16\n\x0erp_link_status\x18\x05 \x01(\x05\"\xdd\x03\n\x08PvDataMO\x12\r\n\x05pv_sn\x18\x01 \x01(\x03\x12\x0f\n\x07pv_port\x18\x02 \x01(\x05\x12\x0e\n\x06pv_vol\x18\x03 \x01(\x05\x12\x0e\n\x06pv_cur\x18\x04 \x01(\x05\x12\x10\n\x08pv_power\x18\x05 \x01(\x05\x12\x17\n\x0fpv_energy_total\x18\x06 \x01(\x05\x12\x10\n\x08grid_vol\x18\x07 \x01(\x05\x12\x14\n\x0cgrid_vol_max\x18\x08 \x01(\x05\x12\x11\n\tgrid_freq\x18\t \x01(\x05\x12\x0e\n\x06grid_p\x18\n \x01(\x05\x12\x0e\n\x06grid_q\x18\x0b \x01(\x05\x12\x0e\n\x06grid_i\x18\x0c \x01(\x05\x12\x0f\n\x07grid_pf\x18\r \x01(\x05\x12\x0f\n\x07pv_temp\x18\x0e \x01(\x05\x12\x15\n\rpv_run_status\x18\x0f \x01(\x05\x12\x14\n\x0cpv_fault_num\x18\x10 \x01(\x05\x12\x14\n\x0cpv_fault_cnt\x18\x11 \x01(\x05\x12\x16\n\x0epv_warning_cnt\x18\x12 \x01(\x05\x12\x16\n\x0epv_link_status\x18\x13 \x01(\x05\x12\x15\n\rpv_send_power\x18\x14 \x01(\x05\x12\x18\n\x10pv_receive_power\x18\x15 \x01(\x05\x12\x0f\n\x07pv_time\x18\x16 \x01(\x05\x12\x11\n\tpv_energy\x18\x17 \x01(\x05\x12\x11\n\tmi_signal\x18\x18 \x01(\x05\"\x86\x02\n\x0eRealDataReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x05\x12\x15\n\rdevice_number\x18\x03 \x01(\x05\x12\x11\n\tpv_number\x18\x04 \x01(\x05\x12\x16\n\x0epackage_number\x18\x05 \x01(\x05\x12\x17\n\x0f\x63urrent_package\x18\x06 \x01(\x05\x12\x0b\n\x03\x63sq\x18\x07 \x01(\x05\x12 \n\nmeter_data\x18\x08 \x03(\x0b\x32\x0c.MeterDataMO\x12\x1a\n\x07rp_data\x18\t \x03(\x0b\x32\t.RpDataMO\x12\x1a\n\x07pv_data\x18\n \x03(\x0b\x32\t.PvDataMO\x12\x0f\n\x07version\x18\x0b \x01(\x05\"{\n\x0eRealDataResDTO\x12\x19\n\x11timestamp_ymd_hms\x18\x01 \x01(\t\x12\x17\n\x0f\x63urrent_package\x18\x02 \x01(\x05\x12\x12\n\nerror_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x11\n\ttimestamp\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'RealData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_METERDATAMO']._serialized_start=19 + _globals['_METERDATAMO']._serialized_end=472 + _globals['_RPDATAMO']._serialized_start=474 + _globals['_RPDATAMO']._serialized_end=583 + _globals['_PVDATAMO']._serialized_start=586 + _globals['_PVDATAMO']._serialized_end=1063 + _globals['_REALDATAREQDTO']._serialized_start=1066 + _globals['_REALDATAREQDTO']._serialized_end=1328 + _globals['_REALDATARESDTO']._serialized_start=1330 + _globals['_REALDATARESDTO']._serialized_end=1453 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/SetConfig.proto b/hoymiles_wifi/protobuf/SetConfig.proto new file mode 100755 index 0000000..37f80d5 --- /dev/null +++ b/hoymiles_wifi/protobuf/SetConfig.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +message SetConfigResDTO { + int32 offset = 1; + uint32 time = 2; + int32 lock_password = 3; + int32 lock_time = 4; + int32 limit_power_mypower = 5; + int32 zero_export_433_addr = 6; + int32 zero_export_enable = 7; + int32 netmode_select = 8; + int32 channel_select = 9; + int32 server_send_time = 10; + int32 serverport = 11; + string apn_set = 12; + string meter_kind = 13; + string meter_interface = 14; + string wifi_ssid = 15; + string wifi_passward = 16; + string server_domain_name = 17; + int32 inv_type = 18; + string dtu_sn = 19; + int32 access_model = 20; + int32 mac_0 = 21; + int32 mac_1 = 22; + int32 mac_2 = 23; + int32 mac_3 = 24; + int32 dhcp_switch = 25; + int32 ip_addr_0 = 26; + int32 ip_addr_1 = 27; + int32 ip_addr_2 = 28; + int32 ip_addr_3 = 29; + int32 subnet_mask_0 = 30; + int32 subnet_mask_1 = 31; + int32 subnet_mask_2 = 32; + int32 subnet_mask_3 = 33; + int32 default_gateway_0 = 34; + int32 default_gateway_1 = 35; + int32 default_gateway_2 = 36; + int32 default_gateway_3 = 37; + string apn_name = 38; + string apn_passward = 39; + int32 sub1g_sweep_switch = 40; + int32 sub1g_work_channel = 41; + int32 cable_dns_0 = 42; + int32 cable_dns_1 = 43; + int32 cable_dns_2 = 44; + int32 cable_dns_3 = 45; + int32 mac_4 = 46; + int32 mac_5 = 47; + string dtu_ap_ssid = 48; + string dtu_ap_pass = 49; + int32 app_page = 50; +} + +message SetConfigReqDTO { + int32 offset = 1; + uint32 time = 2; + int32 err_code = 3; +} diff --git a/hoymiles_wifi/protobuf/SetConfig_pb2.py b/hoymiles_wifi/protobuf/SetConfig_pb2.py new file mode 100644 index 0000000..5c815de --- /dev/null +++ b/hoymiles_wifi/protobuf/SetConfig_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: SetConfig.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fSetConfig.proto\"\xbd\x08\n\x0fSetConfigResDTO\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\r\x12\x15\n\rlock_password\x18\x03 \x01(\x05\x12\x11\n\tlock_time\x18\x04 \x01(\x05\x12\x1b\n\x13limit_power_mypower\x18\x05 \x01(\x05\x12\x1c\n\x14zero_export_433_addr\x18\x06 \x01(\x05\x12\x1a\n\x12zero_export_enable\x18\x07 \x01(\x05\x12\x16\n\x0enetmode_select\x18\x08 \x01(\x05\x12\x16\n\x0e\x63hannel_select\x18\t \x01(\x05\x12\x18\n\x10server_send_time\x18\n \x01(\x05\x12\x12\n\nserverport\x18\x0b \x01(\x05\x12\x0f\n\x07\x61pn_set\x18\x0c \x01(\t\x12\x12\n\nmeter_kind\x18\r \x01(\t\x12\x17\n\x0fmeter_interface\x18\x0e \x01(\t\x12\x11\n\twifi_ssid\x18\x0f \x01(\t\x12\x15\n\rwifi_passward\x18\x10 \x01(\t\x12\x1a\n\x12server_domain_name\x18\x11 \x01(\t\x12\x10\n\x08inv_type\x18\x12 \x01(\x05\x12\x0e\n\x06\x64tu_sn\x18\x13 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_model\x18\x14 \x01(\x05\x12\r\n\x05mac_0\x18\x15 \x01(\x05\x12\r\n\x05mac_1\x18\x16 \x01(\x05\x12\r\n\x05mac_2\x18\x17 \x01(\x05\x12\r\n\x05mac_3\x18\x18 \x01(\x05\x12\x13\n\x0b\x64hcp_switch\x18\x19 \x01(\x05\x12\x11\n\tip_addr_0\x18\x1a \x01(\x05\x12\x11\n\tip_addr_1\x18\x1b \x01(\x05\x12\x11\n\tip_addr_2\x18\x1c \x01(\x05\x12\x11\n\tip_addr_3\x18\x1d \x01(\x05\x12\x15\n\rsubnet_mask_0\x18\x1e \x01(\x05\x12\x15\n\rsubnet_mask_1\x18\x1f \x01(\x05\x12\x15\n\rsubnet_mask_2\x18 \x01(\x05\x12\x15\n\rsubnet_mask_3\x18! \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_0\x18\" \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_1\x18# \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_2\x18$ \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_gateway_3\x18% \x01(\x05\x12\x10\n\x08\x61pn_name\x18& \x01(\t\x12\x14\n\x0c\x61pn_passward\x18\' \x01(\t\x12\x1a\n\x12sub1g_sweep_switch\x18( \x01(\x05\x12\x1a\n\x12sub1g_work_channel\x18) \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_0\x18* \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_1\x18+ \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_2\x18, \x01(\x05\x12\x13\n\x0b\x63\x61\x62le_dns_3\x18- \x01(\x05\x12\r\n\x05mac_4\x18. \x01(\x05\x12\r\n\x05mac_5\x18/ \x01(\x05\x12\x13\n\x0b\x64tu_ap_ssid\x18\x30 \x01(\t\x12\x13\n\x0b\x64tu_ap_pass\x18\x31 \x01(\t\x12\x10\n\x08\x61pp_page\x18\x32 \x01(\x05\"A\n\x0fSetConfigReqDTO\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\r\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'SetConfig_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_SETCONFIGRESDTO']._serialized_start=20 + _globals['_SETCONFIGRESDTO']._serialized_end=1105 + _globals['_SETCONFIGREQDTO']._serialized_start=1107 + _globals['_SETCONFIGREQDTO']._serialized_end=1172 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/WarnData.proto b/hoymiles_wifi/protobuf/WarnData.proto new file mode 100755 index 0000000..a02b8f6 --- /dev/null +++ b/hoymiles_wifi/protobuf/WarnData.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +message WarnReqDTO { + string dtu_sn = 1; + int32 time = 2; + int32 package_nub = 3; + int32 package_now = 4; + int32 warn_device = 5; + repeated WarnMO warns = 6; +} + +message WarnMO { + int64 pv_sn = 1; + int32 code = 2; + int32 num = 3; + int32 s_time = 4; + int32 e_time = 5; + int32 w_data1 = 6; + int32 w_data2 = 7; +} + +message WarnResDTO { + string ymd_hms = 1; + int32 package_now = 2; + int32 err_code = 3; + int32 offset = 4; + int32 time = 5; +} + +message WaveReqDTO { + string dtu_sn = 1; + int32 time = 2; + int32 package_nub = 3; + int32 package_now = 4; + int64 pv_sn = 5; + int32 code = 6; + int32 num = 7; + int32 warn_time = 8; + int32 data_len = 9; + int32 pos = 10; + string warn_data = 11; +} + +message WaveResDTO { + string ymd_hms = 1; + int32 package_now = 2; + int32 err_code = 3; + int32 offset = 4; + int32 time = 5; +} diff --git a/hoymiles_wifi/protobuf/WarnData_pb2.py b/hoymiles_wifi/protobuf/WarnData_pb2.py new file mode 100644 index 0000000..98afc0b --- /dev/null +++ b/hoymiles_wifi/protobuf/WarnData_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: WarnData.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eWarnData.proto\"\x81\x01\n\nWarnReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x04 \x01(\x05\x12\x13\n\x0bwarn_device\x18\x05 \x01(\x05\x12\x16\n\x05warns\x18\x06 \x03(\x0b\x32\x07.WarnMO\"t\n\x06WarnMO\x12\r\n\x05pv_sn\x18\x01 \x01(\x03\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\x12\x0b\n\x03num\x18\x03 \x01(\x05\x12\x0e\n\x06s_time\x18\x04 \x01(\x05\x12\x0e\n\x06\x65_time\x18\x05 \x01(\x05\x12\x0f\n\x07w_data1\x18\x06 \x01(\x05\x12\x0f\n\x07w_data2\x18\x07 \x01(\x05\"b\n\nWarnResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x13\n\x0bpackage_now\x18\x02 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\"\xc3\x01\n\nWaveReqDTO\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x03 \x01(\x05\x12\x13\n\x0bpackage_now\x18\x04 \x01(\x05\x12\r\n\x05pv_sn\x18\x05 \x01(\x03\x12\x0c\n\x04\x63ode\x18\x06 \x01(\x05\x12\x0b\n\x03num\x18\x07 \x01(\x05\x12\x11\n\twarn_time\x18\x08 \x01(\x05\x12\x10\n\x08\x64\x61ta_len\x18\t \x01(\x05\x12\x0b\n\x03pos\x18\n \x01(\x05\x12\x11\n\twarn_data\x18\x0b \x01(\t\"b\n\nWaveResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\x13\n\x0bpackage_now\x18\x02 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'WarnData_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_WARNREQDTO']._serialized_start=19 + _globals['_WARNREQDTO']._serialized_end=148 + _globals['_WARNMO']._serialized_start=150 + _globals['_WARNMO']._serialized_end=266 + _globals['_WARNRESDTO']._serialized_start=268 + _globals['_WARNRESDTO']._serialized_end=366 + _globals['_WAVEREQDTO']._serialized_start=369 + _globals['_WAVEREQDTO']._serialized_end=564 + _globals['_WAVERESDTO']._serialized_start=566 + _globals['_WAVERESDTO']._serialized_end=664 +# @@protoc_insertion_point(module_scope) diff --git a/hoymiles_wifi/protobuf/compile_proto.sh b/hoymiles_wifi/protobuf/compile_proto.sh new file mode 100755 index 0000000..8ca6463 --- /dev/null +++ b/hoymiles_wifi/protobuf/compile_proto.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +for file in $(ls *.proto) +do + protoc --python_out=. $file +done diff --git a/hoymiles_wifi/protos/RealData_pb2.py b/hoymiles_wifi/protos/RealData_pb2.py deleted file mode 100644 index 3d4fc2f..0000000 --- a/hoymiles_wifi/protos/RealData_pb2.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: RealData.proto -# Protobuf Python Version: 4.25.0 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eRealData.proto\"]\n\x0eRealDataResDTO\x12\x0f\n\x07ymd_hms\x18\x01 \x01(\t\x12\n\n\x02\x63p\x18\x02 \x01(\x05\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\x05 \x01(\x05\"\xe3\x01\n\rInverterState\x12\x0e\n\x06inv_id\x18\x01 \x01(\x03\x12\x0f\n\x07port_id\x18\x02 \x01(\x05\x12\x14\n\x0cgrid_voltage\x18\x03 \x01(\x05\x12\x11\n\tgrid_freq\x18\x04 \x01(\x05\x12\x18\n\x10pv_current_power\x18\x05 \x01(\x05\x12\x10\n\x08unknown1\x18\x07 \x01(\x05\x12\x10\n\x08unknown2\x18\x08 \x01(\x05\x12\x13\n\x0btemperature\x18\t \x01(\x05\x12\x10\n\x08unknown3\x18\n \x01(\x05\x12\x10\n\x08unknown4\x18\x0c \x01(\x05\x12\x11\n\tbit_field\x18\x14 \x01(\x05\"\xa0\x01\n\tPortState\x12\r\n\x05pv_sn\x18\x01 \x01(\x03\x12\x0f\n\x07pv_port\x18\x02 \x01(\x05\x12\x0e\n\x06pv_vol\x18\x03 \x01(\x05\x12\x0e\n\x06pv_cur\x18\x04 \x01(\x05\x12\x10\n\x08pv_power\x18\x05 \x01(\x05\x12\x17\n\x0fpv_energy_total\x18\x06 \x01(\x05\x12\x16\n\x0epv_daily_yield\x18\x07 \x01(\x05\x12\x10\n\x08\x62itfield\x18\x08 \x01(\x05\"\xe3\x01\n\x10HMSStateResponse\x12\x0e\n\x06\x64tu_sn\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x05\x12\x12\n\ndevice_nub\x18\x03 \x01(\x05\x12\x0e\n\x06pv_nub\x18\x04 \x01(\x05\x12\x13\n\x0bpackage_nub\x18\x05 \x01(\x05\x12&\n\x0einverter_state\x18\t \x03(\x0b\x32\x0e.InverterState\x12\x1e\n\nport_state\x18\x0b \x03(\x0b\x32\n.PortState\x12\x18\n\x10pv_current_power\x18\x0c \x01(\x05\x12\x16\n\x0epv_daily_yield\x18\r \x01(\x05\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'RealData_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - _globals['_REALDATARESDTO']._serialized_start=18 - _globals['_REALDATARESDTO']._serialized_end=111 - _globals['_INVERTERSTATE']._serialized_start=114 - _globals['_INVERTERSTATE']._serialized_end=341 - _globals['_PORTSTATE']._serialized_start=344 - _globals['_PORTSTATE']._serialized_end=504 - _globals['_HMSSTATERESPONSE']._serialized_start=507 - _globals['_HMSSTATERESPONSE']._serialized_end=734 -# @@protoc_insertion_point(module_scope)