Closed hviljoen closed 2 years ago
try the other way around
python ./InverterData.py
and share if this works for you.
Thank you very much for your prompt response:
Same error (Im running the code as is , no changes from my side)
C:\Projects\deye-inverter>python ./InverterData.py
Traceback (most recent call last):
File "./InverterData.py", line 111, in
ok, let me try something
with open("./DYRealTime.txt", "rb") as txtfile: parameters=json.loads(txtfile.read().decode("UTF-8"))
try this. It should work fine.
Extract of changes: while a<=i: p1=56+(a4) p2=60+(a4) response=twosComplement_hex(str(''.join(hex(ord(chr(x)))[2:].zfill(2) for x in bytearray(data))+' '+re.sub('[^\x20-\x7f]', '', ''))[p1:p2]) hexpos=str("0x") + str(hex(a+pini)[2:].zfill(4)).upper() with open("./DYRealTime.txt", "rb") as txtfile: parameters=json.loads(txtfile.read().decode("UTF-8")) for parameter in parameters: for item in parameter["items"]: title=item["titleEN"] ratio=item["ratio"] unit=item["unit"] for register in item["registers"]:
ERROR:
C:\Projects\deye-inverter>python ./InverterData.py
Traceback (most recent call last):
File "./InverterData.py", line 108, in
does your inverter S/N start by 17?
It looks that the data retrieved does not match what is expected.
It actually does not - it starts with 21*
:(
Then I'm sorry, this script works with S/N 17* I can't help you decoding the S/N 21 as long as I don't have one.
If you don't mind, I will close the issue.
Thank you very much for your assistance - any pointers on how I should go about decoding this for 21, then I can maybe contribute ?
@hviljoen, I have taken the script and customised it a bit. I am happy to share it with you and see if it works for your inverter. It doesn't give you all the info, but the main stuff. Sadly, I have no idea how to contact you directly to send the script.
It is still a work in progress which is why I haven't contributed to the project yet.
Thank you very much - I would be extremely grateful if you can send it to henning.schalk.viljoen@gmail.com
Im extremely frustrated with the delay in data from the Solarman app, hence the reason im want to push this into my Smart Home Application
thank you very much!
Cool, mailed you the script.
@hviljoen, I have taken the script and customised it a bit. I am happy to share it with you and see if it works for your inverter. It doesn't give you all the info, but the main stuff. Sadly, I have no idea how to contact you directly to send the script.
If you don't mind, share here the changes and I can pinpoint you to get all the data. Hopefully few parameters will differ...
@tomislavravic could you please share the same with me as well? (email: zzaskoczenia1@gmail.com)
@tomislavravic @hviljoen Could you please share the changes for the 21xxxxx ? Regards, w00dst0ck
@hviljoen, I have taken the script and customised it a bit. I am happy to share it with you and see if it works for your inverter. It doesn't give you all the info, but the main stuff. Sadly, I have no idea how to contact you directly to send the script.
@hviljoen able to share the script? thank you very much
This is a great project - would love to get it going... Having trouble towards the end though...
C:\Projects\deye-inverter>py InverterData.py Traceback (most recent call last): File "InverterData.py", line 109, in
parameters=json.loads(txtfile.read())
File "C:\Users\henni\AppData\Local\Programs\Python\Python37\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1035: character maps to
If line 108 is changed to:
with open("./DYRealTime.txt", "rb") as txtfile:
Then the following error is produced:
Traceback (most recent call last): File "InverterData.py", line 106, in
response=twosComplement_hex(str(''.join(hex(ord(chr(x)))[2:].zfill(2) for x in bytearray(data))+' '+re.sub('[^\x20-\x7f]', '', ''))[p1:p2])
File "InverterData.py", line 13, in twosComplement_hex
val = int(hexval, bits)
ValueError: invalid literal for int() with base 16: ''