Skip to content

Commit

Permalink
Fix swapped pv1<->pv2 modes (change by gowima)
Browse files Browse the repository at this point in the history
Byte order in the implementation of ByteH|L and EnumH|L
is big endian, which is in accordance to the GoodWe Modbus
register documentation. So the byte sequence left to right
in a register is H - L. Modes are stored as a byte sequence
pv4_mode ... pv1_mode. ---> ByteH/ByteL have to be exchanged
pairwase for mode 4, 3 and 2, 1.
  • Loading branch information
mletenay committed Jan 16, 2024
1 parent f602130 commit 88a1ff7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions goodwe/et.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class ET(Inverter):
max(0, read_bytes4(data, 35113)) +
max(0, read_bytes4(data, 35117)),
"PV Power", "W", Kind.PV),
ByteL("pv4_mode", 35119, "PV4 Mode code", "", Kind.PV), # l
EnumL("pv4_mode_label", 35119, PV_MODES, "PV4 Mode", Kind.PV),
ByteH("pv3_mode", 35119, "PV3 Mode code", "", Kind.PV), # h
EnumH("pv3_mode_label", 35119, PV_MODES, "PV3 Mode", Kind.PV),
ByteL("pv2_mode", 35120, "PV2 Mode code", "", Kind.PV), # l
EnumL("pv2_mode_label", 35120, PV_MODES, "PV2 Mode", Kind.PV),
ByteH("pv1_mode", 35120, "PV1 Mode code", "", Kind.PV), # h
EnumH("pv1_mode_label", 35120, PV_MODES, "PV1 Mode", Kind.PV),
ByteH("pv4_mode", 35119, "PV4 Mode code", "", Kind.PV),
EnumH("pv4_mode_label", 35119, PV_MODES, "PV4 Mode", Kind.PV),
ByteL("pv3_mode", 35119, "PV3 Mode code", "", Kind.PV),
EnumL("pv3_mode_label", 35119, PV_MODES, "PV3 Mode", Kind.PV),
ByteH("pv2_mode", 35120, "PV2 Mode code", "", Kind.PV),
EnumH("pv2_mode_label", 35120, PV_MODES, "PV2 Mode", Kind.PV),
ByteL("pv1_mode", 35120, "PV1 Mode code", "", Kind.PV),
EnumL("pv1_mode_label", 35120, PV_MODES, "PV1 Mode", Kind.PV),
Voltage("vgrid", 35121, "On-grid L1 Voltage", Kind.AC),
Current("igrid", 35122, "On-grid L1 Current", Kind.AC),
Frequency("fgrid", 35123, "On-grid L1 Frequency", Kind.AC),
Expand Down

0 comments on commit 88a1ff7

Please sign in to comment.