Skip to content

Commit d1a4918

Browse files
committed
Add comment explaining what's going on
1 parent 855229b commit d1a4918

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

custom_components/foxess_modbus/entities/entity_descriptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ 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+
# 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)
210212
ModbusAddressesSpec(holding=[39280], models=Inv.H1_G2),
211213
],
212214
name="PV1 Power",
@@ -252,6 +254,8 @@ 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),
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)
255259
ModbusAddressesSpec(holding=[39282], models=Inv.H1_G2),
256260
],
257261
name="PV2 Power",

0 commit comments

Comments
 (0)