Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support Gree Versati III Heat Pump - GRS-CQ10Pd/NhH-E 10kw #56

Open
peca2345 opened this issue Dec 25, 2022 · 2 comments
Open

Add support Gree Versati III Heat Pump - GRS-CQ10Pd/NhH-E 10kw #56

peca2345 opened this issue Dec 25, 2022 · 2 comments

Comments

@peca2345
Copy link

peca2345 commented Dec 25, 2022

No description provided.

@marcinlubojanski
Copy link

marcinlubojanski commented Dec 31, 2022

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.

@tomikaa87
Copy link
Owner

Hi @marcinlubojanski,

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants