Skip to content

Commit

Permalink
Add SOH for all inverters
Browse files Browse the repository at this point in the history
  • Loading branch information
MartB committed Nov 3, 2024
1 parent 7887be5 commit 92ec347
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions custom_components/foxess_modbus/entities/entity_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,7 @@ def _inner(
batvolt: list[ModbusAddressesSpec],
bat_current: list[ModbusAddressesSpec],
battery_soc: list[ModbusAddressesSpec],
battery_soh: list[ModbusAddressesSpec],
battery_temp: list[ModbusAddressesSpec],
bms_cell_temp_high: list[ModbusAddressesSpec],
bms_cell_temp_low: list[ModbusAddressesSpec],
Expand Down Expand Up @@ -1872,6 +1873,17 @@ def _inner(
signed=False,
validate=[Range(0, 100)],
)
yield ModbusBatterySensorDescription(
key=f"battery_soh{key_suffix}",
addresses=battery_soh,
bms_connect_state_address=bms_connect_state_address,
name=f"Battery{name_infix} SoH",
device_class=SensorDeviceClass.BATTERY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement="%",
signed=False,
validate=[Range(0, 100)],
)
yield ModbusBatterySensorDescription(
key=f"battery_temp{key_suffix}",
addresses=battery_temp,
Expand Down Expand Up @@ -1958,6 +1970,11 @@ def _inner(
ModbusAddressesSpec(holding=[31024], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119),
ModbusAddressesSpec(holding=[31038], models=Inv.H3_SET),
],
battery_soh=[
ModbusAddressesSpec(input=[11104], models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressesSpec(holding=[37624], models= Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2 | Inv.KH_119),
ModbusAddressesSpec(holding=[31090], models=Inv.H3_SET),
],
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),
Expand Down Expand Up @@ -1986,6 +2003,7 @@ def _inner(
batvolt=[ModbusAddressesSpec(holding=[37609], models=Inv.H3_PRO)],
bat_current=[ModbusAddressesSpec(holding=[37610], models=Inv.H3_PRO)],
battery_soc=[ModbusAddressesSpec(holding=[37612], models=Inv.H3_PRO)],
battery_soh=[ModbusAddressesSpec(holding=[37624], models=Inv.H3_PRO)],
battery_temp=[ModbusAddressesSpec(holding=[37611], models=Inv.H3_PRO)],
bms_cell_temp_high=[ModbusAddressesSpec(holding=[37617], models=Inv.H3_PRO)],
bms_cell_temp_low=[ModbusAddressesSpec(holding=[37618], models=Inv.H3_PRO)],
Expand All @@ -1999,6 +2017,7 @@ def _inner(
batvolt=[ModbusAddressesSpec(holding=[38307], models=Inv.H3_PRO)],
bat_current=[ModbusAddressesSpec(holding=[38308], models=Inv.H3_PRO)],
battery_soc=[ModbusAddressesSpec(holding=[38310], models=Inv.H3_PRO)],
battery_soh=[ModbusAddressesSpec(holding=[38322], models=Inv.H3_PRO)],
battery_temp=[ModbusAddressesSpec(holding=[38309], models=Inv.H3_PRO)],
bms_cell_temp_high=[ModbusAddressesSpec(holding=[38315], models=Inv.H3_PRO)],
bms_cell_temp_low=[ModbusAddressesSpec(holding=[38316], models=Inv.H3_PRO)],
Expand Down

0 comments on commit 92ec347

Please sign in to comment.