From 35d471dac2e5b597681c345aec85230076de0fee Mon Sep 17 00:00:00 2001 From: Ollie Clapinson Date: Wed, 22 Jan 2025 16:10:00 +0000 Subject: [PATCH 1/3] Import KH v1.33 changes from https://github.com/ocl80/foxess_modbus_ocl80 --- .../foxess_modbus/common/types.py | 5 +- .../entities/entity_descriptions.py | 252 ++++++++++++------ .../entities/modbus_fault_sensor.py | 4 +- .../entities/remote_control_description.py | 2 +- .../foxess_modbus/inverter_profiles.py | 4 +- 5 files changed, 173 insertions(+), 94 deletions(-) diff --git a/custom_components/foxess_modbus/common/types.py b/custom_components/foxess_modbus/common/types.py index bae4cb53..c08d74c6 100644 --- a/custom_components/foxess_modbus/common/types.py +++ b/custom_components/foxess_modbus/common/types.py @@ -67,8 +67,9 @@ class Inv(Flag): H1_G2 = auto() KH_PRE119 = auto() - KH_119 = auto() - KH_SET = KH_PRE119 | KH_119 + KH_PRE133 = auto() + KH_133 = auto() + KH_SET = KH_PRE119 | KH_PRE133 | KH_133 H3 = auto() AIO_H3 = auto() diff --git a/custom_components/foxess_modbus/entities/entity_descriptions.py b/custom_components/foxess_modbus/entities/entity_descriptions.py index fed90d06..788bc596 100644 --- a/custom_components/foxess_modbus/entities/entity_descriptions.py +++ b/custom_components/foxess_modbus/entities/entity_descriptions.py @@ -17,7 +17,7 @@ from .inverter_model_spec import ModbusAddressesSpec from .inverter_model_spec import ModbusAddressSpec from .modbus_battery_sensor import ModbusBatterySensorDescription -from .modbus_fault_sensor import H3_PRO_FAULTS +from .modbus_fault_sensor import H3_PRO_KH_133_FAULTS from .modbus_fault_sensor import STANDARD_FAULTS from .modbus_fault_sensor import FaultSet from .modbus_fault_sensor import ModbusFaultSensorDescription @@ -42,7 +42,8 @@ BMS_CONNECT_STATE_ADDRESS = [ ModbusAddressSpec(input=11058, models=Inv.H1_G1 | Inv.KH_PRE119), ModbusAddressSpec(holding=31029, models=Inv.H1_G1 | Inv.H1_LAN), - ModbusAddressSpec(holding=31028, models=Inv.KH_119 | Inv.H1_G2), + ModbusAddressSpec(holding=31028, models=Inv.KH_PRE133 | Inv.H1_G2), + ModbusAddressSpec(holding=37002, models=Inv.KH_133), ModbusAddressSpec(holding=31042, models=Inv.H3_SET), ] @@ -68,7 +69,8 @@ def _master_version(address: list[ModbusAddressSpec], is_hex: bool) -> ModbusVer ) yield _master_version( address=[ - ModbusAddressSpec(holding=30016, models=Inv.KH_119), + ModbusAddressSpec(holding=30016, models=Inv.KH_PRE133), + ModbusAddressSpec(holding=36001, models=Inv.KH_133), ModbusAddressSpec(holding=36001, models=Inv.H1_G2), ], is_hex=True, @@ -93,8 +95,8 @@ def _slave_version(address: list[ModbusAddressSpec], is_hex: bool) -> ModbusVers ) yield _slave_version( address=[ - ModbusAddressSpec(holding=30017, models=Inv.KH_119), - ModbusAddressSpec(holding=36002, models=Inv.H1_G2), + ModbusAddressSpec(holding=30017, models=Inv.KH_PRE133), + ModbusAddressSpec(holding=36002, models=Inv.H1_G2 | Inv.KH_133), ], is_hex=True, ) @@ -117,8 +119,8 @@ def _manager_version(address: list[ModbusAddressSpec], is_hex: bool) -> ModbusVe ) yield _manager_version( address=[ - ModbusAddressSpec(holding=30018, models=Inv.KH_119 | Inv.H3_SET), - ModbusAddressSpec(holding=36003, models=Inv.H1_G2 | Inv.H3_PRO), + ModbusAddressSpec(holding=30018, models=Inv.KH_PRE133 | Inv.H3_SET), + ModbusAddressSpec(holding=36003, models=Inv.H1_G2 | Inv.H3_PRO | Inv.KH_133), ], is_hex=True, ) @@ -185,8 +187,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv1_voltage", addresses=[ ModbusAddressesSpec(input=[11000], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31000], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET), - ModbusAddressesSpec(holding=[39070], models=Inv.H1_G2 | Inv.H3_PRO), + ModbusAddressesSpec(holding=[31000], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), + ModbusAddressesSpec(holding=[39070], models=Inv.H1_G2 | Inv.H3_PRO | Inv.KH_133), ], name="PV1 Voltage", ) @@ -194,15 +196,15 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv1_current", addresses=[ ModbusAddressesSpec(input=[11001], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31001], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec(holding=[31001], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), ], name="PV1 Current", - scale=0.1, + scale=0.01, ) yield _pv_current( key="pv1_current", addresses=[ - ModbusAddressesSpec(holding=[39071], models=Inv.H1_G2 | Inv.H3_PRO), + ModbusAddressesSpec(holding=[39071], models=Inv.H1_G2 | Inv.H3_PRO | Inv.KH_133), ], name="PV1 Current", scale=0.01, @@ -211,11 +213,11 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv1_power", addresses=[ ModbusAddressesSpec(input=[11002], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31002], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec(holding=[31002], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), # This is techincally a 32-bit register on the G2, but it doesn't appear to actually write the upper word, # which means that negative values are represented incorrectly (as 0x0000FFFF etc) ModbusAddressesSpec(holding=[39280], models=Inv.H1_G2), - ModbusAddressesSpec(holding=[39280, 39279], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[39280, 39279], models=Inv.H3_PRO | Inv.KH_133), ], name="PV1 Power", ) @@ -234,8 +236,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv2_voltage", addresses=[ ModbusAddressesSpec(input=[11003], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31003], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET), - ModbusAddressesSpec(holding=[39072], models=Inv.H1_G2 | Inv.H3_PRO), + ModbusAddressesSpec(holding=[31003], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), + ModbusAddressesSpec(holding=[39072], models=Inv.H1_G2 | Inv.H3_PRO | Inv.KH_133), ], name="PV2 Voltage", ) @@ -243,15 +245,15 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv2_current", addresses=[ ModbusAddressesSpec(input=[11004], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31004], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec(holding=[31004], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), ], name="PV2 Current", - scale=0.1, + scale=0.01, ) yield _pv_current( key="pv2_current", addresses=[ - ModbusAddressesSpec(holding=[39073], models=Inv.H1_G2 | Inv.H3_PRO), + ModbusAddressesSpec(holding=[39073], models=Inv.H1_G2 | Inv.H3_PRO | Inv.KH_133), ], name="PV2 Current", scale=0.01, @@ -260,11 +262,11 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv2_power", addresses=[ ModbusAddressesSpec(input=[11005], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31005], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec(holding=[31005], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), # This is techincally a 32-bit register on the G2, but it doesn't appear to actually write the upper word, # which means that negative values are represented incorrectly (as 0x0000FFFF etc) ModbusAddressesSpec(holding=[39282], models=Inv.H1_G2), - ModbusAddressesSpec(holding=[39282, 39281], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[39282, 39281], models=Inv.H3_PRO | Inv.KH_133), ], name="PV2 Power", ) @@ -283,8 +285,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv3_voltage", addresses=[ ModbusAddressesSpec(input=[11096], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31039], models=Inv.KH_119), - ModbusAddressesSpec(holding=[39074], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[31039], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39074], models=Inv.H3_PRO | Inv.KH_133), ], name="PV3 Voltage", ) @@ -292,10 +294,11 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv3_current", addresses=[ ModbusAddressesSpec(input=[11097], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31040], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31040], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39075], models=Inv.KH_133), ], name="PV3 Current", - scale=0.1, + scale=0.01, ) yield _pv_current( key="pv3_current", @@ -309,7 +312,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv3_power", addresses=[ ModbusAddressesSpec(input=[11098], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31041], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31041], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39284, 39283], models=Inv.KH_133), ModbusAddressesSpec(holding=[39284, 39283], models=Inv.H3_PRO), ], name="PV3 Power", @@ -329,8 +333,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv4_voltage", addresses=[ ModbusAddressesSpec(input=[11099], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31042], models=Inv.KH_119), - ModbusAddressesSpec(holding=[39076], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[31042], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39076], models=Inv.H3_PRO | Inv.KH_133), ], name="PV4 Voltage", ) @@ -338,10 +342,11 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv4_current", addresses=[ ModbusAddressesSpec(input=[11100], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31043], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31043], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39077], models=Inv.KH_133), ], name="PV4 Current", - scale=0.1, + scale=0.01, ) yield _pv_current( key="pv4_current", @@ -355,8 +360,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit key="pv4_power", addresses=[ ModbusAddressesSpec(input=[11101], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31044], models=Inv.KH_119), - ModbusAddressesSpec(holding=[39286, 39285], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[31044], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39286, 39285], models=Inv.H3_PRO | Inv.KH_133), ], name="PV4 Power", ) @@ -492,8 +497,8 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="load_power", addresses=[ ModbusAddressesSpec(input=[11023], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31016], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2), - ModbusAddressesSpec(holding=[31054, 31053], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31016], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_133), + ModbusAddressesSpec(holding=[31054, 31053], models=Inv.KH_PRE133), ], name="Load Power", device_class=SensorDeviceClass.POWER, @@ -508,7 +513,9 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="rvolt", # Ideally rename to grid_voltage? addresses=[ ModbusAddressesSpec(input=[11009], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31006], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31006], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], entity_registry_enabled_default=False, name="Grid Voltage", @@ -524,7 +531,9 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="rcurrent", addresses=[ ModbusAddressesSpec(input=[11010], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31007], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31007], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], name="Inverter Current", device_class=SensorDeviceClass.CURRENT, @@ -538,8 +547,8 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="rpower", addresses=[ ModbusAddressesSpec(input=[11011], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31008], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2), - ModbusAddressesSpec(holding=[31046, 31045], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31008], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_133), + ModbusAddressesSpec(holding=[31046, 31045], models=Inv.KH_PRE133), ], name="Inverter Power", device_class=SensorDeviceClass.POWER, @@ -589,7 +598,9 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="eps_rvolt", addresses=[ ModbusAddressesSpec(input=[11015], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31010], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31010], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], entity_registry_enabled_default=False, name="EPS Voltage", @@ -605,7 +616,9 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="eps_rcurrent", addresses=[ ModbusAddressesSpec(input=[11016], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31011], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31011], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], entity_registry_enabled_default=False, name="EPS Current", @@ -620,8 +633,8 @@ def _h1_current_voltage_power_entities() -> Iterable[EntityFactory]: key="eps_rpower", addresses=[ ModbusAddressesSpec(input=[11017], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31012], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2), - ModbusAddressesSpec(holding=[31048, 31047], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31012], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_133), + ModbusAddressesSpec(holding=[31048, 31047], models=Inv.KH_PRE133), ], entity_registry_enabled_default=False, name="EPS Power", @@ -694,7 +707,8 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod icon="mdi:transmission-tower-import", scale=scale, round_to=0.01, - post_process=lambda v: v if v > 0 else 0, + # On KH133 negative grid_ct is feed-in / grid export + post_process=lambda v: abs(v) if v < 0 else 0, validate=[Range(0, 100)], ) yield ModbusSensorDescription( @@ -707,7 +721,8 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod icon="mdi:transmission-tower-export", scale=scale, round_to=0.01, - post_process=lambda v: abs(v) if v < 0 else 0, + # On KH133 positive grid_ct is grid consumption / grid import + post_process=lambda v: v if v > 0 else 0, validate=[Range(0, 100)], ) @@ -721,7 +736,8 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod yield from _grid_ct( addresses=[ ModbusAddressesSpec(input=[11021], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31050, 31049], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31050, 31049], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[39169, 39168], models=Inv.KH_133), ], scale=-0.001, ) @@ -750,7 +766,8 @@ def _ct2_meter(addresses: list[ModbusAddressesSpec], scale: float) -> ModbusSens yield _ct2_meter( addresses=[ ModbusAddressesSpec(input=[11022], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31052, 31051], models=Inv.KH_119), + ModbusAddressesSpec(holding=[31052, 31051], models=Inv.KH_PRE133), + ModbusAddressesSpec(holding=[31015], models=Inv.KH_133), ], scale=-0.001, ) @@ -1182,7 +1199,9 @@ def _invbatvolt(index: int | None, addresses: list[ModbusAddressesSpec]) -> Enti index=None, addresses=[ ModbusAddressesSpec(input=[11006], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31020], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31020], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], ) yield _invbatvolt(index=1, addresses=[ModbusAddressesSpec(holding=[39227], models=Inv.H3_PRO)]) @@ -1208,7 +1227,9 @@ def _invbatcurrent(index: int | None, scale: float, addresses: list[ModbusAddres scale=0.1, addresses=[ ModbusAddressesSpec(input=[11007], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31021], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31021], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], ) yield _invbatcurrent( @@ -1263,7 +1284,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite index=None, addresses=[ ModbusAddressesSpec(input=[11008], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31022], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31022], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31036], models=Inv.H3_SET), ModbusAddressesSpec(holding=[39238, 39237], models=Inv.H3_PRO), ], @@ -1291,7 +1314,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite key="rfreq", addresses=[ ModbusAddressesSpec(input=[11014], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31009], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31009], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31015], models=Inv.H3_SET), ModbusAddressesSpec(holding=[38847, 38846], models=Inv.H3_PRO), ], @@ -1309,7 +1334,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite key="eps_frequency", addresses=[ ModbusAddressesSpec(input=[11020], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31013], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31013], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31025], models=Inv.H3_SET), ], entity_registry_enabled_default=False, @@ -1326,7 +1353,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite key="invtemp", addresses=[ ModbusAddressesSpec(input=[11024], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31018], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31018], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31032], models=Inv.H3_SET), ModbusAddressesSpec(holding=[39141], models=Inv.H3_PRO), ], @@ -1342,7 +1371,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite key="ambtemp", addresses=[ ModbusAddressesSpec(input=[11025], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31019], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31019], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31033], models=Inv.H3_SET), ], name="Ambient Temp", @@ -1357,7 +1388,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite key="bms_charge_rate", addresses=[ ModbusAddressesSpec(input=[11041], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31025], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31025], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], entity_registry_enabled_default=False, bms_connect_state_address=BMS_CONNECT_STATE_ADDRESS, @@ -1373,7 +1406,9 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite key="bms_discharge_rate", addresses=[ ModbusAddressesSpec(input=[11042], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31026], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31026], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ], entity_registry_enabled_default=False, bms_connect_state_address=BMS_CONNECT_STATE_ADDRESS, @@ -1438,9 +1473,9 @@ def _inverter_fault_code(addresses: list[ModbusAddressesSpec], fault_set: FaultS yield _inverter_fault_code( addresses=[ - ModbusAddressesSpec(holding=[39067, 39068, 39069], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[39067, 39068, 39069], models=Inv.H3_PRO | Inv.KH_133), ], - fault_set=H3_PRO_FAULTS, + fault_set=H3_PRO_KH_133_FAULTS, ) yield ModbusInverterStateSensorDescription( @@ -1456,7 +1491,7 @@ def _inverter_fault_code(addresses: list[ModbusAddressesSpec], fault_set: FaultS key="inverter_state", address=[ ModbusAddressSpec(input=11056, models=Inv.KH_PRE119), - ModbusAddressSpec(holding=31027, models=Inv.KH_119), + ModbusAddressSpec(holding=31027, models=Inv.KH_PRE133 | Inv.KH_133), ], name="Inverter State", states=KH_INVERTER_STATES, @@ -1495,7 +1530,9 @@ def _solar_energy_total(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _solar_energy_total( addresses=[ ModbusAddressesSpec(input=[11070, 11069], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32001, 32000], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32001, 32000], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39602, 39601], models=Inv.H3_PRO), ], ) @@ -1517,7 +1554,9 @@ def _solar_energy_today(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _solar_energy_today( addresses=[ ModbusAddressesSpec(input=[11071], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32002], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32002], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39604, 39603], models=Inv.H3_PRO), ], ) @@ -1539,7 +1578,9 @@ def _battery_charge_total(addresses: list[ModbusAddressesSpec]) -> EntityFactory yield _battery_charge_total( addresses=[ ModbusAddressesSpec(input=[11073, 11072], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32004, 32003], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32004, 32003], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39606, 39605], models=Inv.H3_PRO), ], ) @@ -1574,7 +1615,8 @@ def _battery_charge_today(addresses: list[ModbusAddressesSpec]) -> EntityFactory yield _battery_charge_today( addresses=[ ModbusAddressesSpec(input=[11074], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32005], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec(holding=[32005], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec(holding=[32005], models=Inv.KH_PRE133 | Inv.KH_133), ModbusAddressesSpec(holding=[39608, 39607], models=Inv.H3_PRO), ], ) @@ -1596,7 +1638,9 @@ def _battery_discharge_total(addresses: list[ModbusAddressesSpec]) -> EntityFact yield _battery_discharge_total( addresses=[ ModbusAddressesSpec(input=[11076, 11075], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32007, 32006], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32007, 32006], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39610, 39609], models=Inv.H3_PRO), ], ) @@ -1631,7 +1675,9 @@ def _battery_discharge_today(addresses: list[ModbusAddressesSpec]) -> EntityFact yield _battery_discharge_today( addresses=[ ModbusAddressesSpec(input=[11077], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32008], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32008], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39612, 39611], models=Inv.H3_PRO), ], ) @@ -1653,7 +1699,9 @@ def _feed_in_energy_total(addresses: list[ModbusAddressesSpec]) -> EntityFactory yield _feed_in_energy_total( addresses=[ ModbusAddressesSpec(input=[11079, 11078], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32010, 32009], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32010, 32009], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39614, 39613], models=Inv.H3_PRO), ], ) @@ -1688,7 +1736,9 @@ def _feed_in_energy_today(addresses: list[ModbusAddressesSpec]) -> EntityFactory yield _feed_in_energy_today( addresses=[ ModbusAddressesSpec(input=[11080], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32011], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32011], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39616, 39615], models=Inv.H3_PRO), ], ) @@ -1710,7 +1760,9 @@ def _grid_consumption_energy_total(addresses: list[ModbusAddressesSpec]) -> Enti yield _grid_consumption_energy_total( addresses=[ ModbusAddressesSpec(input=[11082, 11081], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32013, 32012], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32013, 32012], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39618, 39617], models=Inv.H3_PRO), ], ) @@ -1745,7 +1797,9 @@ def _grid_consumption_energy_today(addresses: list[ModbusAddressesSpec]) -> Enti yield _grid_consumption_energy_today( addresses=[ ModbusAddressesSpec(input=[11083], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32014], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32014], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39620, 39619], models=Inv.H3_PRO), ], ) @@ -1767,7 +1821,9 @@ def _total_yield_total(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _total_yield_total( addresses=[ ModbusAddressesSpec(input=[11085, 11084], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32016, 32015], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32016, 32015], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39622, 39621], models=Inv.H3_PRO), ], ) @@ -1789,7 +1845,9 @@ def _total_yield_today(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _total_yield_today( addresses=[ ModbusAddressesSpec(input=[11086], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32017], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32017], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39624, 39623], models=Inv.H3_PRO), ], ) @@ -1811,7 +1869,9 @@ def _input_energy_total(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _input_energy_total( addresses=[ ModbusAddressesSpec(input=[11088, 11087], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32019, 32018], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32019, 32018], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39626, 39625], models=Inv.H3_PRO), ], ) @@ -1833,7 +1893,9 @@ def _input_energy_today(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _input_energy_today( addresses=[ ModbusAddressesSpec(input=[11089], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32020], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32020], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39628, 39627], models=Inv.H3_PRO), ], ) @@ -1859,7 +1921,7 @@ def _load_power_total(addresses: list[ModbusAddressesSpec]) -> EntityFactory: # models=H1_SET, input=[11091, 11090] # ), ModbusAddressesSpec(input=[11091, 11090], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32022, 32021], models=Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec(holding=[32022, 32021], models=Inv.KH_PRE133 | Inv.KH_133 | Inv.H1_G2 | Inv.H3_SET), ModbusAddressesSpec(holding=[39630, 39629], models=Inv.H3_PRO), ], ) @@ -1898,7 +1960,9 @@ def _load_energy_today(addresses: list[ModbusAddressesSpec]) -> EntityFactory: yield _load_energy_today( addresses=[ ModbusAddressesSpec(input=[11092], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[32023], models=Inv.H1_G1 | Inv.KH_119 | Inv.H1_G2 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[32023], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[39632, 39631], models=Inv.H3_PRO), ], ) @@ -2049,7 +2113,9 @@ def _inner( ], battery_soc=[ ModbusAddressesSpec(input=[11036], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31024], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31024], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31038], models=Inv.H3_SET), ], battery_soh=[ @@ -2059,7 +2125,9 @@ def _inner( ], battery_temp=[ ModbusAddressesSpec(input=[11038], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[31023], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec( + holding=[31023], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[31037], models=Inv.H3_SET), ], bms_cell_temp_high=[ @@ -2114,7 +2182,7 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="work_mode", address=[ ModbusAddressSpec(input=41000, models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressSpec(holding=41000, models=Inv.H1_G1 | Inv.KH_119), + ModbusAddressSpec(holding=41000, models=Inv.H1_G1 | Inv.KH_PRE133 | Inv.KH_133), ], name="Work Mode", options_map={0: "Self Use", 1: "Feed-in First", 2: "Back-up"}, @@ -2148,7 +2216,9 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="max_charge_current", addresses=[ ModbusAddressesSpec(input=[41007], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[41007], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[41007], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[46607], models=Inv.H3_PRO), ], name="Max Charge Current", @@ -2162,7 +2232,7 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="max_charge_current", address=[ ModbusAddressSpec(input=41007, models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressSpec(holding=41007, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressSpec(holding=41007, models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133), ModbusAddressSpec(holding=46607, models=Inv.H3_PRO), ], name="Max Charge Current", @@ -2180,7 +2250,9 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="max_discharge_current", addresses=[ ModbusAddressesSpec(input=[41008], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[41008], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[41008], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[46608], models=Inv.H3_PRO), ], name="Max Discharge Current", @@ -2194,7 +2266,7 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="max_discharge_current", address=[ ModbusAddressSpec(input=41008, models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressSpec(holding=41008, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressSpec(holding=41008, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133 | Inv.H3_SET), ModbusAddressSpec(holding=46608, models=Inv.H3_PRO), ], name="Max Discharge Current", @@ -2213,7 +2285,9 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="min_soc", addresses=[ ModbusAddressesSpec(input=[41009], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[41009], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[41009], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[46609], models=Inv.H3_PRO), ], name="Min SoC", @@ -2227,7 +2301,7 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="min_soc", address=[ ModbusAddressSpec(input=41009, models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressSpec(holding=41009, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressSpec(holding=41009, models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133), ModbusAddressSpec(holding=46609, models=Inv.H3_PRO), ], name="Min SoC", @@ -2246,7 +2320,9 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="max_soc", addresses=[ ModbusAddressesSpec(input=[41010], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[41010], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[41010], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[46610], models=Inv.H3_PRO), ], name="Max SoC", @@ -2260,7 +2336,7 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="max_soc", address=[ ModbusAddressSpec(input=41010, models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressSpec(holding=41010, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressSpec(holding=41010, models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133), ModbusAddressSpec(holding=46610, models=Inv.H3_PRO), ], name="Max SoC", @@ -2279,7 +2355,9 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="min_soc_on_grid", addresses=[ ModbusAddressesSpec(input=[41011], models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressesSpec(holding=[41011], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressesSpec( + holding=[41011], models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133 + ), ModbusAddressesSpec(holding=[46611], models=Inv.H3_PRO), ], name="Min SoC (On Grid)", @@ -2293,7 +2371,7 @@ def _configuration_entities() -> Iterable[EntityFactory]: key="min_soc_on_grid", address=[ ModbusAddressSpec(input=41011, models=Inv.H1_G1 | Inv.KH_PRE119), - ModbusAddressSpec(holding=41011, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET), + ModbusAddressSpec(holding=41011, models=Inv.H1_G1 | Inv.H1_G2 | Inv.H3_SET | Inv.KH_PRE133 | Inv.KH_133), ModbusAddressSpec(holding=46611, models=Inv.H3_PRO), ], name="Min SoC (On Grid)", diff --git a/custom_components/foxess_modbus/entities/modbus_fault_sensor.py b/custom_components/foxess_modbus/entities/modbus_fault_sensor.py index cd5127a9..1e2dbd15 100644 --- a/custom_components/foxess_modbus/entities/modbus_fault_sensor.py +++ b/custom_components/foxess_modbus/entities/modbus_fault_sensor.py @@ -166,7 +166,7 @@ def __post_init__(self) -> None: masks={"Grid Lost Fault": ["Grid Voltage Fault", "Grid Frequency Fault"]}, ) -H3_PRO_FAULTS = FaultSet( +H3_PRO_KH_133_FAULTS = FaultSet( faults=[ [ "PV Over-voltage", @@ -215,7 +215,7 @@ def __post_init__(self) -> None: None, None, "Meter Lost Fault", - None, + "BMS Lost Fault", # KH_133 only, None, None, None, diff --git a/custom_components/foxess_modbus/entities/remote_control_description.py b/custom_components/foxess_modbus/entities/remote_control_description.py index 6538b4b7..f2c6dcc9 100644 --- a/custom_components/foxess_modbus/entities/remote_control_description.py +++ b/custom_components/foxess_modbus/entities/remote_control_description.py @@ -88,7 +88,7 @@ pwr_limit_bat_up=None, pv_voltages=[31000, 31003, 31039, 31042], ), - models=Inv.KH_119, + models=Inv.KH_PRE133 | Inv.KH_133, ), RemoteControlAddressSpec( # The H3 doesn't support anything above 44005, and the active/reactive power regisers are 2 values diff --git a/custom_components/foxess_modbus/inverter_profiles.py b/custom_components/foxess_modbus/inverter_profiles.py index 95200cb1..3c0db1a6 100644 --- a/custom_components/foxess_modbus/inverter_profiles.py +++ b/custom_components/foxess_modbus/inverter_profiles.py @@ -84,7 +84,7 @@ def __init__( ) # See https://github.com/nathanmarlor/foxess_modbus/pull/512 KH_REGISTERS = SpecialRegisterConfig( - invalid_register_ranges=[(41001, 41006), (41012, 41012), (41019, 43999)], + invalid_register_ranges=[(41001, 41006), (41012, 41012), (41019, 43999), (31045, 31999)], individual_read_register_ranges=[(41000, 41999)], ) # See https://github.com/nathanmarlor/foxess_modbus/discussions/553 @@ -308,7 +308,7 @@ def inverter_capacity(self, inverter_model: str) -> int: InverterModelProfile(InverterModel.KH, r"^KH([\d\.]+)").add_connection_type( ConnectionType.AUX, RegisterType.HOLDING, - versions={Version(1, 19): Inv.KH_PRE119, None: Inv.KH_119}, + versions={Version(1, 19): Inv.KH_PRE119, Version(1, 33): Inv.KH_PRE133, None: Inv.KH_133}, special_registers=KH_REGISTERS, ), # The H3 seems to use holding registers for everything From 9a5d828dc6ddcc51e7222f0dac6d5e0beaa405d8 Mon Sep 17 00:00:00 2001 From: Antony Male Date: Wed, 22 Jan 2025 16:27:22 +0000 Subject: [PATCH 2/3] Fix changes which would have broken other inverters --- .../entities/entity_descriptions.py | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/custom_components/foxess_modbus/entities/entity_descriptions.py b/custom_components/foxess_modbus/entities/entity_descriptions.py index 788bc596..9fea1c01 100644 --- a/custom_components/foxess_modbus/entities/entity_descriptions.py +++ b/custom_components/foxess_modbus/entities/entity_descriptions.py @@ -199,7 +199,7 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit ModbusAddressesSpec(holding=[31001], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), ], name="PV1 Current", - scale=0.01, + scale=0.1, ) yield _pv_current( key="pv1_current", @@ -248,7 +248,7 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit ModbusAddressesSpec(holding=[31004], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_PRE133 | Inv.H3_SET), ], name="PV2 Current", - scale=0.01, + scale=0.1, ) yield _pv_current( key="pv2_current", @@ -295,15 +295,14 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit addresses=[ ModbusAddressesSpec(input=[11097], models=Inv.KH_PRE119), ModbusAddressesSpec(holding=[31040], models=Inv.KH_PRE133), - ModbusAddressesSpec(holding=[39075], models=Inv.KH_133), ], name="PV3 Current", - scale=0.01, + scale=0.1, ) yield _pv_current( key="pv3_current", addresses=[ - ModbusAddressesSpec(holding=[39075], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[39075], models=Inv.H3_PRO | Inv.KH_133), ], name="PV3 Current", scale=0.01, @@ -343,15 +342,14 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit addresses=[ ModbusAddressesSpec(input=[11100], models=Inv.KH_PRE119), ModbusAddressesSpec(holding=[31043], models=Inv.KH_PRE133), - ModbusAddressesSpec(holding=[39077], models=Inv.KH_133), ], name="PV4 Current", - scale=0.01, + scale=0.1, ) yield _pv_current( key="pv4_current", addresses=[ - ModbusAddressesSpec(holding=[39077], models=Inv.H3_PRO), + ModbusAddressesSpec(holding=[39077], models=Inv.H3_PRO | Inv.KH_133), ], name="PV4 Current", scale=0.01, @@ -707,8 +705,7 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod icon="mdi:transmission-tower-import", scale=scale, round_to=0.01, - # On KH133 negative grid_ct is feed-in / grid export - post_process=lambda v: abs(v) if v < 0 else 0, + post_process=lambda v: v if v > 0 else 0, validate=[Range(0, 100)], ) yield ModbusSensorDescription( @@ -721,8 +718,7 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod icon="mdi:transmission-tower-export", scale=scale, round_to=0.01, - # On KH133 positive grid_ct is grid consumption / grid import - post_process=lambda v: v if v > 0 else 0, + post_process=lambda v: abs(v) if v < 0 else 0, validate=[Range(0, 100)], ) @@ -730,6 +726,7 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod addresses=[ ModbusAddressesSpec(input=[11021], models=Inv.H1_G1), ModbusAddressesSpec(holding=[31014], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2), + ModbusAddressesSpec(holding=[39169, 39168], models=Inv.KH_133), ], scale=0.001, ) @@ -737,7 +734,6 @@ def _grid_ct(addresses: list[ModbusAddressesSpec], scale: float) -> Iterable[Mod addresses=[ ModbusAddressesSpec(input=[11021], models=Inv.KH_PRE119), ModbusAddressesSpec(holding=[31050, 31049], models=Inv.KH_PRE133), - ModbusAddressesSpec(holding=[39169, 39168], models=Inv.KH_133), ], scale=-0.001, ) @@ -2120,7 +2116,7 @@ def _inner( ], battery_soh=[ ModbusAddressesSpec(input=[11104], models=Inv.KH_PRE119), - ModbusAddressesSpec(holding=[37624], models=Inv.H1_G2 | Inv.KH_119), + ModbusAddressesSpec(holding=[37624], models=Inv.H1_G2 | Inv.KH_PRE133 | Inv.KH_133), ModbusAddressesSpec(holding=[31090], models=Inv.H3_SET), ], battery_temp=[ From 54890a5fce4f4842cff9deb52ff098379d812d53 Mon Sep 17 00:00:00 2001 From: Antony Male Date: Wed, 22 Jan 2025 16:24:55 +0000 Subject: [PATCH 3/3] Update snapshot tests --- ...ty_descriptions_for_model[Inv.H3_PRO].json | 2 +- ...ty_descriptions_for_model[Inv.KH_133].json | 951 ++++++++++++++++++ ...escriptions_for_model[Inv.KH_PRE133].json} | 0 3 files changed, 952 insertions(+), 1 deletion(-) create mode 100644 tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_133].json rename tests/__snapshots__/test_entity_descriptions/{test_entity_descriptions_for_model[Inv.KH_119].json => test_entity_descriptions_for_model[Inv.KH_PRE133].json} (100%) diff --git a/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.H3_PRO].json b/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.H3_PRO].json index 8070c35c..d97b9a0e 100644 --- a/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.H3_PRO].json +++ b/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.H3_PRO].json @@ -1093,7 +1093,7 @@ null, null, "Meter Lost Fault", - null, + "BMS Lost Fault", null, null, null, diff --git a/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_133].json b/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_133].json new file mode 100644 index 00000000..00cf645f --- /dev/null +++ b/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_133].json @@ -0,0 +1,951 @@ +[ + { + "addresses": { + "holding": [ + 31019 + ] + }, + "key": "ambtemp", + "name": "Ambient Temp", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31022 + ] + }, + "key": "battery_charge", + "name": "Battery Charge", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32005 + ] + }, + "key": "battery_charge_today", + "name": "Battery Charge Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32004, + 32003 + ] + }, + "key": "battery_charge_total", + "name": "Battery Charge Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31022 + ] + }, + "key": "battery_discharge", + "name": "Battery Discharge", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32008 + ] + }, + "key": "battery_discharge_today", + "name": "Battery Discharge Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32007, + 32006 + ] + }, + "key": "battery_discharge_total", + "name": "Battery Discharge Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31024 + ] + }, + "key": "battery_soc", + "name": "Battery SoC", + "scale": null, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 37624 + ] + }, + "key": "battery_soh", + "name": "Battery SoH", + "scale": null, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31023 + ] + }, + "key": "battery_temp", + "name": "Battery Temp", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31025 + ] + }, + "key": "bms_charge_rate", + "name": "BMS Charge Rate", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31026 + ] + }, + "key": "bms_discharge_rate", + "name": "BMS Discharge Rate", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31015 + ] + }, + "key": "ct2_meter", + "name": "CT2 Meter", + "scale": -0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31013 + ] + }, + "key": "eps_frequency", + "name": "EPS Frequency", + "scale": 0.01, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31011 + ] + }, + "key": "eps_rcurrent", + "name": "EPS Current", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31012 + ] + }, + "key": "eps_rpower", + "name": "EPS Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31010 + ] + }, + "key": "eps_rvolt", + "name": "EPS Voltage", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39169, + 39168 + ] + }, + "key": "feed_in", + "name": "Feed-in", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32011 + ] + }, + "key": "feed_in_energy_today", + "name": "Feed-in Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32010, + 32009 + ] + }, + "key": "feed_in_energy_total", + "name": "Feed-in Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39169, + 39168 + ] + }, + "key": "grid_consumption", + "name": "Grid Consumption", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32014 + ] + }, + "key": "grid_consumption_energy_today", + "name": "Grid Consumption Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32013, + 32012 + ] + }, + "key": "grid_consumption_energy_total", + "name": "Grid Consumption Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39169, + 39168 + ] + }, + "key": "grid_ct", + "name": "Grid CT", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32020 + ] + }, + "key": "input_energy_today", + "name": "Input Energy Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32019, + 32018 + ] + }, + "key": "input_energy_total", + "name": "Input Energy Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31021 + ] + }, + "key": "invbatcurrent", + "name": "Inverter Battery Current", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31022 + ] + }, + "key": "invbatpower", + "name": "Inverter Battery Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31020 + ] + }, + "key": "invbatvolt", + "name": "Inverter Battery Voltage", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39067, + 39068, + 39069 + ] + }, + "faults": [ + [ + "PV Over-voltage", + "DC arc fault", + "String reverse connection", + null, + null, + null, + null, + "Grid Lost Fault", + "Grid Voltage Fault", + null, + null, + "Grid Frequency Fault", + null, + null, + "Output Over-current Fault", + "Output DC Over-current Fault" + ], + [ + "Residual Current Consistency Fault", + "Ground Connection Fault", + "Low Insulation Resistante Fault", + "Inverter Over-temperature Fault", + null, + null, + null, + null, + null, + "Energy Storage Equipment Abnormal Fault", + "Isolated Island Fault", + null, + null, + null, + "Off-grid Output Overload Fault", + null + ], + [ + null, + null, + null, + "External Fan Fault", + "Energy Storage Reverse Connection Fault", + null, + null, + null, + null, + "Meter Lost Fault", + "BMS Lost Fault", + null, + null, + null, + null, + null + ] + ], + "key": "inverter_fault_code", + "name": "Inverter Fault Code", + "type": "fault-sensor" + }, + { + "addresses": { + "holding": [ + 31027 + ] + }, + "key": "inverter_state", + "name": "Inverter State", + "states": [ + "Self Test", + "Waiting", + "Checking", + "On Grid", + "Off Grid / EPS", + "Recoverable Fault", + "Unrecoverable Fault" + ], + "type": "inverter-state-sensor" + }, + { + "addresses": { + "holding": [ + 31018 + ] + }, + "key": "invtemp", + "name": "Inverter Temp", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32023 + ] + }, + "key": "load_energy_today", + "name": "Load Energy Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31016 + ] + }, + "key": "load_power", + "name": "Load Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32022, + 32021 + ] + }, + "key": "load_power_total", + "name": "Load Energy Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 36003 + ] + }, + "is_hex": true, + "key": "manager_version", + "name": "Version: Manager", + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 36001 + ] + }, + "is_hex": true, + "key": "master_version", + "name": "Version: Master", + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41007 + ] + }, + "key": "max_charge_current", + "name": "Max Charge Current", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41007 + ] + }, + "key": "max_charge_current", + "name": "Max Charge Current", + "scale": 0.1, + "type": "number" + }, + { + "addresses": { + "holding": [ + 41008 + ] + }, + "key": "max_discharge_current", + "name": "Max Discharge Current", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41008 + ] + }, + "key": "max_discharge_current", + "name": "Max Discharge Current", + "scale": 0.1, + "type": "number" + }, + { + "addresses": { + "holding": [ + 41010 + ] + }, + "key": "max_soc", + "name": "Max SoC", + "scale": null, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41010 + ] + }, + "key": "max_soc", + "name": "Max SoC", + "scale": null, + "type": "number" + }, + { + "addresses": { + "holding": [ + 41009 + ] + }, + "key": "min_soc", + "name": "Min SoC", + "scale": null, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41009 + ] + }, + "key": "min_soc", + "name": "Min SoC", + "scale": null, + "type": "number" + }, + { + "addresses": { + "holding": [ + 41011 + ] + }, + "key": "min_soc_on_grid", + "name": "Min SoC (On Grid)", + "scale": null, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41011 + ] + }, + "key": "min_soc_on_grid", + "name": "Min SoC (On Grid)", + "scale": null, + "type": "number" + }, + { + "addresses": { + "holding": [ + 39071 + ] + }, + "key": "pv1_current", + "name": "PV1 Current", + "scale": 0.01, + "signed": true, + "type": "sensor" + }, + { + "key": "pv1_energy_total", + "method": "left", + "name": "PV1 Power Total", + "register_types": "dict_keys(['input', 'holding'])", + "source": "pv1_power", + "type": "integration-sensor", + "unit_time": "h" + }, + { + "addresses": { + "holding": [ + 39280, + 39279 + ] + }, + "key": "pv1_power", + "name": "PV1 Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39070 + ] + }, + "key": "pv1_voltage", + "name": "PV1 Voltage", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39073 + ] + }, + "key": "pv2_current", + "name": "PV2 Current", + "scale": 0.01, + "signed": true, + "type": "sensor" + }, + { + "key": "pv2_energy_total", + "method": "left", + "name": "PV2 Power Total", + "register_types": "dict_keys(['input', 'holding'])", + "source": "pv2_power", + "type": "integration-sensor", + "unit_time": "h" + }, + { + "addresses": { + "holding": [ + 39282, + 39281 + ] + }, + "key": "pv2_power", + "name": "PV2 Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39072 + ] + }, + "key": "pv2_voltage", + "name": "PV2 Voltage", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39075 + ] + }, + "key": "pv3_current", + "name": "PV3 Current", + "scale": 0.01, + "signed": true, + "type": "sensor" + }, + { + "key": "pv3_energy_total", + "method": "left", + "name": "PV3 Power Total", + "register_types": "dict_keys(['input', 'holding'])", + "source": "pv3_power", + "type": "integration-sensor", + "unit_time": "h" + }, + { + "addresses": { + "holding": [ + 39284, + 39283 + ] + }, + "key": "pv3_power", + "name": "PV3 Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39074 + ] + }, + "key": "pv3_voltage", + "name": "PV3 Voltage", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39077 + ] + }, + "key": "pv4_current", + "name": "PV4 Current", + "scale": 0.01, + "signed": true, + "type": "sensor" + }, + { + "key": "pv4_energy_total", + "method": "left", + "name": "PV4 Power Total", + "register_types": "dict_keys(['input', 'holding'])", + "source": "pv4_power", + "type": "integration-sensor", + "unit_time": "h" + }, + { + "addresses": { + "holding": [ + 39286, + 39285 + ] + }, + "key": "pv4_power", + "name": "PV4 Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 39076 + ] + }, + "key": "pv4_voltage", + "name": "PV4 Voltage", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "key": "pv_power_now", + "name": "PV Power", + "register_types": "dict_keys(['input', 'holding'])", + "sources": [ + "pv1_power", + "pv2_power", + "pv3_power", + "pv4_power" + ], + "type": "lambda" + }, + { + "addresses": { + "holding": [ + 31007 + ] + }, + "key": "rcurrent", + "name": "Inverter Current", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31009 + ] + }, + "key": "rfreq", + "name": "Grid Frequency", + "scale": 0.01, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31008 + ] + }, + "key": "rpower", + "name": "Inverter Power", + "scale": 0.001, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 31006 + ] + }, + "key": "rvolt", + "name": "Grid Voltage", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 36002 + ] + }, + "is_hex": true, + "key": "slave_version", + "name": "Version: Slave", + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32002 + ] + }, + "key": "solar_energy_today", + "name": "Solar Generation Today", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32001, + 32000 + ] + }, + "key": "solar_energy_total", + "name": "Solar Generation Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32017 + ] + }, + "key": "total_yield_today", + "name": "Yield Today", + "scale": 0.1, + "signed": true, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 32016, + 32015 + ] + }, + "key": "total_yield_total", + "name": "Yield Total", + "scale": 0.1, + "signed": false, + "type": "sensor" + }, + { + "addresses": { + "holding": [ + 41000 + ] + }, + "key": "work_mode", + "name": "Work Mode", + "type": "select", + "values": { + "0": "Self Use", + "1": "Feed-in First", + "2": "Back-up" + } + } +] diff --git a/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_119].json b/tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_PRE133].json similarity index 100% rename from tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_119].json rename to tests/__snapshots__/test_entity_descriptions/test_entity_descriptions_for_model[Inv.KH_PRE133].json