You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works for me on Python3 with gree.py. I have Versati 3 8kW monoblock.
f.e. python ./gree.py -c my_ip_address -i my_gree_id -k my_key --verbose get AllInWatTemHi AllInWatTemLo All OutWatTemHi AllOutWatTemLo WatBoxTemHi WatBoxTemLo RmoHomTemHi RmoHomTemLo RmoHomTemHi = 121 RmoHomTemLo = 9 AllOutWatTemLo = 0 AllInWatTemHi = 130 AllInWatTemLo = 7 WatBoxTemLo = 5 WatBoxTemHi = 140 AllOutWatTemHi = 131
However I wanted to run it on my mips router where only python2 cryptography modules are available. I have tried to port gree.py into python2 and all seems to work besides proper encoding of "pack", decoding works fine.
I believe the problem is with different sting/bytes usage in python2 vs3.
I have changed this line: #pack_encrypted = encryptor.update(bytes(pack_padded, encoding='utf-8')) + encryptor.finalize() pack_encrypted = encryptor.update(pack_padded.decode('utf8')) + encryptor.finalize()
but still it doesn't work properly - the encripted string is wrong and as the result I'm not able to even propely connect (getting timeouts). If I paste there already encrypted string (encrypted on my laptop using python3), then it works.
Any help how to properly encode this in python2 is greatly appreciated.
If you've setup the encryptor to use AES-128 ECB, it should produce the same result. If you think the byte encoding is wrong, you can try 'ascii' instead of 'utf-8' because most likely the packets won't contain any special characters. You can try printing the encoding result and see if there is any issue.
No description provided.
The text was updated successfully, but these errors were encountered: