-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hello.
I have one SUN-6K-SG03LP1-EU with one Pylontech 5000 and I'm trying to use this code to read and write from/to the inverter.
I'm having a bit of a hard time understanding how it work as I don't recognize the language/coding show in the examples despite having some programming background (mostly C).
I managed to install it, but doesn't seem to be reading the inverter correctly:
I read the inverter serial number correctly, so it is working up to some level.
[dividi@rocky deye-controller-master]$ deye-read 192.168.192.12 2913021234
[ Device_Type]: Hybrid
[ Modbus_Address]: 1
[ Inverter_Serial]: 2401081234
[ Rated_Power]: 0
Traceback (most recent call last):
File "/home/dividi/.local/bin/deye-read", line 8, in
sys.exit(read_from_inverter())
File "/home/dividi/.local/lib/python3.9/site-packages/deye_controller/deye_reader.py", line 105, in read_from_inverter
read_inverter(opts.address, opts.serial, batt_only=opts.battery, power_only=opts.power, combo=opts.combo,
File "/home/dividi/.local/lib/python3.9/site-packages/deye_controller/deye_reader.py", line 46, in read_inverter
string = '[{:>35s}]: {} {}'.format(reg.description.title(), reg.format(), suffix)
File "/home/dividi/.local/lib/python3.9/site-packages/deye_controller/modbus/protocol.py", line 141, in format
as_bytes = to_bytes(self.value)
File "/home/dividi/.local/lib/python3.9/site-packages/deye_controller/modbus/utils.py", line 15, in to_bytes
return bytes.fromhex(''.join([struct.pack('>h', x).hex() for x in val]))
File "/home/dividi/.local/lib/python3.9/site-packages/deye_controller/modbus/utils.py", line 15, in
return bytes.fromhex(''.join([struct.pack('>h', x).hex() for x in val]))
struct.error: 'h' format requires -32768 <= number <= 32767
[dividi@rocky deye-controller-master]$
Is there any hint hot to get this working, possibly need to adapt some code to my inverter, but I don't yet have a ModBus manual that I'm sure is accurate for my inverter.
Thanks in advance.
Cheers.