Skip to content

Commit 1cd307b

Browse files
authored
Merge pull request #590 from paultweedy77/main
Remove unused PV1 & PV2 power registers from H1_G2
2 parents 0ca4041 + d1a4918 commit 1cd307b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

custom_components/foxess_modbus/entities/entity_descriptions.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit
207207
addresses=[
208208
ModbusAddressesSpec(input=[11002], models=Inv.H1_G1 | Inv.KH_PRE119),
209209
ModbusAddressesSpec(holding=[31002], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET),
210-
ModbusAddressesSpec(holding=[39280, 39279], models=Inv.H1_G2),
210+
# This is techincally a 32-bit register on the G2, but it doesn't appear to actually write the upper word,
211+
# which means that negative values are represented incorrectly (as 0x0000FFFF etc)
212+
ModbusAddressesSpec(holding=[39280], models=Inv.H1_G2),
211213
],
212214
name="PV1 Power",
213215
)
@@ -252,7 +254,9 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit
252254
addresses=[
253255
ModbusAddressesSpec(input=[11005], models=Inv.H1_G1 | Inv.KH_PRE119),
254256
ModbusAddressesSpec(holding=[31005], models=Inv.H1_G1 | Inv.H1_LAN | Inv.KH_119 | Inv.H3_SET),
255-
ModbusAddressesSpec(holding=[39282, 39281], models=Inv.H1_G2),
257+
# This is techincally a 32-bit register on the G2, but it doesn't appear to actually write the upper word,
258+
# which means that negative values are represented incorrectly (as 0x0000FFFF etc)
259+
ModbusAddressesSpec(holding=[39282], models=Inv.H1_G2),
256260
],
257261
name="PV2 Power",
258262
)

0 commit comments

Comments
 (0)