Skip to content

Commit

Permalink
Update plugin_solax
Browse files Browse the repository at this point in the history
  • Loading branch information
wills106 committed Feb 14, 2023
1 parent d1552cd commit 09b323c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/solax_modbus/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "solax_modbus",
"name": "SolaX Inverter Modbus",
"version": "2023.02.6.2",
"version": "2023.02.6.3",
"documentation": "https://github.com/wills106/homsassistant-solax-modbus",
"issue_tracker": "https://github.com/wills106/homsassistant-solax-modbus/issues",
"requirements": ["pymodbus>=2.5.3", "pymodbus<=3.1.1"],
Expand Down
9 changes: 4 additions & 5 deletions custom_components/solax_modbus/plugin_solax.py
Original file line number Diff line number Diff line change
Expand Up @@ -4438,7 +4438,7 @@ def determineInverterType(self, hub, configdict):
seriesnumber = _read_serialnr(hub, 0x0)
if not seriesnumber:
seriesnumber = _read_serialnr(hub, 0x300) # bug in endian.Little decoding?
if seriesnumber and not seriesnumber.startswith("M"):
if seriesnumber and not seriesnumber.startswith(("M", "X")):
ba = bytearray(seriesnumber,"ascii") # convert to bytearray for swapping
ba[0::2], ba[1::2] = ba[1::2], ba[0::2] # swap bytes ourselves - due to bug in Endian.Little ?
res = str(ba, "ascii") # convert back to string
Expand All @@ -4459,8 +4459,6 @@ def determineInverterType(self, hub, configdict):
elif seriesnumber.startswith('HUE'): invertertype = HYBRID | GEN3 | X1 # Gen3 X1 Late
elif seriesnumber.startswith('XRE'): invertertype = HYBRID | GEN3 | X1 # Gen3 X1 Alternative
elif seriesnumber.startswith('XAC'): invertertype = AC | GEN3 | X1 # X1AC
elif seriesnumber.startswith('XB3'): invertertype = PV | GEN3 | X1 # X1-Boost G3, should work with other kW raiting assuming they use Hybrid registers
elif seriesnumber.startswith('XM3'): invertertype = PV | GEN3 | X1 # X1-Mini G3, should work with other kW raiting assuming they use Hybrid registers
elif seriesnumber.startswith('H3DE'): invertertype = HYBRID | GEN3 | X3 # Gen3 X3
elif seriesnumber.startswith('H3E'): invertertype = HYBRID | GEN3 | X3 # Gen3 X3
elif seriesnumber.startswith('H3LE'): invertertype = HYBRID | GEN3 | X3 # Gen3 X3
Expand All @@ -4475,8 +4473,9 @@ def determineInverterType(self, hub, configdict):
elif seriesnumber.startswith('PRE'): invertertype = AC | GEN4 | X1 # RetroFit
elif seriesnumber.startswith('PRI'): invertertype = AC | GEN4 | X1 # RetroFit
elif seriesnumber.startswith('H34'): invertertype = HYBRID | GEN4 | X3 # Gen4 X3
elif seriesnumber.startswith('XB3'): invertertype = MIC | GEN2 | X1 # X1-Boost G3, should work with other kW raiting assuming they use Hybrid registers
elif seriesnumber.startswith('XM3'): invertertype = MIC | GEN2 | X1 # X1-Mini G3, should work with other kW raiting assuming they use Hybrid registers
elif seriesnumber.startswith('XB3'): invertertype = MIC | GEN2 | X1 # X1-Boost
elif seriesnumber.startswith('XM3'): invertertype = MIC | GEN2 | X1 # X1-Mini G3
elif seriesnumber.startswith('XMA'): invertertype = MIC | GEN2 | X1 # X1-Mini G3
elif seriesnumber.startswith('MC103T'): invertertype = MIC | GEN | X3 # MIC X3
elif seriesnumber.startswith('MP153T'): invertertype = MIC | GEN | X3 # MIC X3
elif seriesnumber.startswith('MC203T'): invertertype = MIC | GEN | X3 # MIC X3
Expand Down

0 comments on commit 09b323c

Please sign in to comment.