Skip to content

Instantly share code, notes, and snippets.

@grav
Last active September 28, 2022 13:09
Show Gist options
  • Save grav/6004ded69263f54dc391c86adf20f89c to your computer and use it in GitHub Desktop.
Save grav/6004ded69263f54dc391c86adf20f89c to your computer and use it in GitHub Desktop.

Altech Heat pump

Controlling using Python

Clone https://github.com/tomikaa87/gree-remote

Install lib:

pip install --user cryptography

Find device

To discover ip, device id and key, run this command (use your own network's broadcast ip, check eg ifconfig):

$ cd PythonCLI
$ python gree.py search -b 192.168.1.255
Searching for devices using broadcast address: 192.168.1.255
Search finished, found 1 device(s)
Binding device: [ip] (1e7a87ae, ID: [device-id])
Bind to [device-id] succeeded, key = [key]

Get and set parameters

Command reference: https://github.com/tomikaa87/gree-remote#reading-status-of-a-device

Use ip, device-id and key from above.

Get current set temperature:

$ python gree.py get SetTem -c [ip] -i [device-id] -k [key]
Getting parameters: SetTem
SetTem = 17

Get current sensor reading:

$ python gree.py get TemSen -c ...
Getting parameters: TemSen
TemSen = 59

(this value is offset by 40 to avoid negative, so eg 59 = 19 degrees)

Set temperature

$ python gree.py set SetTem=17 -c ...
Setting parameters: SetTem=17
{"opt":["SetTem"],"p":[17],"t":"cmd"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment