tomikaa87 / gree-remote

Simple remote control utility for Gree Smart air conditioners
GNU General Public License v3.0
281 stars 64 forks source link

Documentation: List of params? #59

Open haraldhh opened 1 year ago

haraldhh commented 1 year ago

Where can I find the list of params that my AC provides, and an explanation what each parameter does?

A thousand thanks for this, I love this CLI utility. I will buy You a beer if I ever meet You.

marcinlubojanski commented 1 year ago

I got it by taking packet trace from the Gree app :D No official list available and not everything is there (f.e. outside temperature is missing for my heat pump). I've made my own automation and exporting data to Grafana :)

List of parameters that I've found (valid for Versati III): Pow Mod CoWatOutTemSet HeWatOutTemSet WatBoxTemSet TemUn AllErr TemRec ColHtWter HetHtWter TemRecB CoHomTemSet HeHomTemSet FastHtWter Quiet Emegcy LefHom SwDisFct SvSt VersatiSeries RomHomTemExt WatBoxExt FocModSwh Emegcy HanFroSwh WatSyExhSwh BordTest ColColetSwh EndTemCotSwh ModelType AllInWatTemHi AllInWatTemLo AllOutWatTemHi AllOutWatTemLo HepOutWatTemHi HepOutWatTemLo WatBoxTemHi WatBoxTemLo RmoHomTemHi RmoHomTemLo WatBoxElcHeRunSta SyAnFroRunSta ElcHe1RunSta ElcHe2RunSta AnFrzzRunSta TemUn AllErr

Temperatures that consist of high and low byte are calculated with formula (Hi - 100) + Lo/10

haraldhh commented 1 year ago

Thanks. How did you get that list? Disassembling the Android app or listening to the communication and tcpdumping it while pressing all buttons?

Some are documented here, with explanation: https://github.com/tomikaa87/gree-remote I think I will manage with those known ones. Just want to be able to run it a 8°C or 16°C depending of the market price of energy.

marcinlubojanski commented 1 year ago

tcpdump, then decode it with the key which you can get with gree.py

haraldhh commented 1 year ago

Guessed that :)

Thanks for that list. Tried them all on my new Gree GWH09AGA-xxx heatpump. Not all of the parameters Your machine supports are supported by mine, which is expected.

$ for i in $params ; do  echo "---------- $i -----------"; python3 gree.py -c <ip-address> -i <id> -k <key> get $i ; sleep 1; done
---------- Pow -----------
Getting parameters: Pow
Pow = 1
---------- Mod -----------
Getting parameters: Mod
Mod = 4
---------- CoWatOutTemSet -----------
Getting parameters: CoWatOutTemSet
---------- HeWatOutTemSet -----------
Getting parameters: HeWatOutTemSet
---------- WatBoxTemSet -----------
Getting parameters: WatBoxTemSet
---------- TemUn -----------
Getting parameters: TemUn
TemUn = 0
---------- AllErr -----------
Getting parameters: AllErr
AllErr = 0
---------- TemRec -----------
Getting parameters: TemRec
TemRec = 0
---------- ColHtWter -----------
Getting parameters: ColHtWter
---------- HetHtWter -----------
Getting parameters: HetHtWter
---------- TemRecB -----------
Getting parameters: TemRecB
---------- CoHomTemSet -----------
Getting parameters: CoHomTemSet
---------- HeHomTemSet -----------
Getting parameters: HeHomTemSet
---------- FastHtWter -----------
Getting parameters: FastHtWter
---------- Quiet -----------
Getting parameters: Quiet
Quiet = 0
---------- Emegcy -----------
Getting parameters: Emegcy
---------- LefHom -----------
Getting parameters: LefHom
---------- SwDisFct -----------
Getting parameters: SwDisFct
---------- SvSt -----------
Getting parameters: SvSt
SvSt = 0
---------- VersatiSeries -----------
Getting parameters: VersatiSeries
---------- RomHomTemExt -----------
Getting parameters: RomHomTemExt
---------- WatBoxExt -----------
Getting parameters: WatBoxExt
---------- FocModSwh -----------
Getting parameters: FocModSwh
---------- Emegcy -----------
Getting parameters: Emegcy
---------- HanFroSwh -----------
Getting parameters: HanFroSwh
---------- WatSyExhSwh -----------
Getting parameters: WatSyExhSwh
---------- BordTest -----------
Getting parameters: BordTest
---------- ColColetSwh -----------
Getting parameters: ColColetSwh
---------- EndTemCotSwh -----------
Getting parameters: EndTemCotSwh
---------- ModelType -----------
Getting parameters: ModelType
ModelType = 32792
---------- AllInWatTemHi -----------
Getting parameters: AllInWatTemHi
---------- AllInWatTemLo -----------
Getting parameters: AllInWatTemLo
---------- AllOutWatTemHi -----------
Getting parameters: AllOutWatTemHi
---------- AllOutWatTemLo -----------
Getting parameters: AllOutWatTemLo
---------- HepOutWatTemHi -----------
Getting parameters: HepOutWatTemHi
---------- HepOutWatTemLo -----------
Getting parameters: HepOutWatTemLo
---------- WatBoxTemHi -----------
Getting parameters: WatBoxTemHi
---------- WatBoxTemLo -----------
Getting parameters: WatBoxTemLo
---------- RmoHomTemHi -----------
Getting parameters: RmoHomTemHi
---------- RmoHomTemLo -----------
Getting parameters: RmoHomTemLo
---------- WatBoxElcHeRunSta -----------
Getting parameters: WatBoxElcHeRunSta
---------- SyAnFroRunSta -----------
Getting parameters: SyAnFroRunSta
---------- ElcHe1RunSta -----------
Getting parameters: ElcHe1RunSta
---------- ElcHe2RunSta -----------
Getting parameters: ElcHe2RunSta
---------- AnFrzzRunSta -----------
Getting parameters: AnFrzzRunSta
---------- TemUn -----------
Getting parameters: TemUn
TemUn = 0
---------- AllErr -----------
Getting parameters: AllErr
AllErr = 0

It does support StHt which is nice, this is the 8°C setting.

haraldhh commented 1 year ago

Is there a way to read individual temperature sensors in a Gree AC? The outside temp sensor would be nice to be able to read.

rubenRP commented 1 year ago

Thanks @marcinlubojanski. Did you find the relation of variables with Status View Params (Specifically, compressor, fan and HP-pump)?

marcinlubojanski commented 1 year ago

Thanks @marcinlubojanski. Did you find the relation of variables with Status View Params (Specifically, compressor, fan and HP-pump)?

Unfortunately not. The app is not trying to get them so don't know the variable names. I was trying to guess outside temperature for few days with millions of combinations but no luck. And of course there is no official documentation whatsoever.

kostirez1 commented 1 year ago

Here are some parameters that I've found by intercepting the firmware update v3.73 file from http://52.59.83.129/wifiModule/image/10132/183744 - ota_sdkshell-5421341282129789759-110255171350184864.bin. Since this host seems to be not available anymore, here is a mirror: https://ulozto.net/file/NinekwAQ2xiF/ota-sdkshell-5421341282129789759-110255171350184864-bin

Here is a full dump of all strings in this binary using the "strings" utility: https://gist.github.com/kostirez1/b9588e4f355a8bb974a282af439fafb1 And a list of strings that I suspect to be the parameters: https://gist.github.com/kostirez1/7140739d2d49d60f11eee7552b6e10b9

Some parameters may not be available depending on the model of your unit, or the current firmware version. Most of the AC related ones did still work on another unit, which is currently stuck on v1.05.

rroyGit commented 1 year ago

Thanks @marcinlubojanski. Did you find the relation of variables with Status View Params (Specifically, compressor, fan and HP-pump)?

Unfortunately not. The app is not trying to get them so don't know the variable names. I was trying to guess outside temperature for few days with millions of combinations but no luck. And of course there is no official documentation whatsoever.

The latest version of Gree+ app shows the outside temp now when requested thru the app. If you get the time, can you please see if you can find out the outside temp param?

marcinlubojanski commented 1 year ago

The latest version of Gree+ app shows the outside temp now when requested thru the app. If you get the time, can you please see if you can find out the outside temp param?

Which version? I have 1.17.2.7 on Android and it's not there, or maybe it depends on device type?

rroyGit commented 1 year ago

Same version. I bought the system recently, so it is likely the latest version - https://www.greecomfort.com/our-products/livo-gen4-wall-mount/

On the app, it's called "Outside HUM", sits next to Sleep option.

edit -Ops, my bad, it's just the humidity ;'(

Anyway, this free weather api serves my need for the moment - https://open-meteo.com/en/docs

mkaluza commented 4 months ago

@marcinlubojanski so I looked at the firmware for my device (multisplit AC Pular) here: https://github.com/maxim-smirnov/gree-wifimodule-firmware/tree/main/362001065279

and got a lot more params. For outside temp, try OutEnvTem or TemsSenOut - for me both show the same value (that changes). Probably is also +40 offset, b/c it said 71 and 70, and there's 30+ deg outside right now.

Just find your firmware and look for any known name (like TemSen) - you'll get them all

marcinlubojanski commented 4 months ago

@mkaluza I tried both those params but they don't work on my device :/ Also not sure where from I could download firmware for Gree Versati III monoblock... This gree wifimodule seems to be different thing.

mkaluza commented 3 months ago

@marcinlubojanski Hi, sorry, I missed the notification. you need to get your device type 'code' first. If you do a search with --verbose param, you should see sth similar to this: search_devices: pack={'t': 'dev', 'cid': '9424b8bafe16', 'bc': '00000000000000000000000000000000', 'brand': 'gree', 'catalog': 'gree', 'mac': '9424b8bafe16', 'mid': '10001', 'model': 'gree', 'name': '', 'lock': 0, 'series': 'gree', 'vender': '1', 'ver': 'V2.0.0', 'ModelType': '32792', 'hid': '362001065279+U-WB05RT13V1.23.bin'}

you can also just do 'get hid' - it is the same property as all other

First part of the 'hid' field is your model 'code' (mine here is 362001065279). Then you go here https://github.com/maxim-smirnov/gree-wifimodule-firmware/tree/main and check if your fw is there. If it is, just get it, if it is not, check out the repo and run firmwareFetch.py YOUR_MODEL_CODE

you don't even need to checkout b/c the script just checks a series of urls like this: https://github.com/maxim-smirnov/gree-wifimodule-firmware/blob/main/362001062107/ota_sdkshell-5525215474150399862.md?plain=1#L1 (obviously use your own model code) The thing is that there are few servers and they can contain different things. You need to check them one by one until you find sth: https://github.com/maxim-smirnov/gree-wifimodule-firmware/blob/main/firmwareFetch.py#L77

marcinlubojanski commented 3 months ago

@mkaluza Unfirtunately it seems that there is no firmware for my model (362001066763). Tried to seach both manuall and via firmwareFetch.py :/

mkaluza commented 3 months ago

@marcinlubojanski yes there is. Though the fetch script has/had an error that makes it fail if the code directory does not exist - so create it first manually and run again. It worked for me:

$ ./firmwareFetch.py 362001066763
Data saved for firmware code 362001066763 from grih.gree.com

Downloading 362001066763 from http://grih.gree.com/wifiModule/image/10495/786432
Downloading 362001066763\U-W06A(P3)V6.0-5121008307837131559.bin from http://grih.gree.com/wifiModule/image/10495/786432
............ done
Wrote 362001066763\U-W06A(P3)V6.0-5121008307837131559.bin
Renaming downloaded/362001066763_v6.0_grih.gree.com.md to 362001066763\U-W06A(P3)V6.0-5121008307837131559.md

Data saved for firmware code 362001066763 from tmp.grih.gree.com

Downloading 362001066763 from http://test.grih.gree.com/wifiModule/image/17838/786432
Downloading 362001066763\U-W06A(P3)V6.04-5063653579341588802.bin from http://test.grih.gree.com/wifiModule/image/17838/786432
............ done
Wrote 362001066763\U-W06A(P3)V6.04-5063653579341588802.bin
Renaming downloaded/362001066763_v6.04_tmp.grih.gree.com.md to 362001066763\U-W06A(P3)V6.04-5063653579341588802.md

Ignore firmware code 362001066763 from kfgrih.gree.com due to response status 405
Data saved for firmware code 362001066763 from test.grih.gree.com

Downloading 362001066763 from http://test.grih.gree.com/wifiModule/image/17838/786432
File 362001066763\U-W06A(P3)V6.04-5063653579341588802.bin already exists - skipping
Error fetching data for firmware code 362001066763 from ru.grih.gree.com: 404 Client Error: Not Found for url: http://ru.grih.gree.com/wifiModule/Lastversion?firmwareCode=362001066763
Ignore firmware code 362001066763 from na.grih.gree.com due to response status 405
Ignore firmware code 362001066763 from hk.grih.gree.com due to response status 405
Data saved for firmware code 362001066763 from eu.grih.gree.com

Downloading 362001066763 from http://eu.grih.gree.com/wifiModule/image/10143/786432
Downloading 362001066763\U-W06A(P3)V6.04-316539128262708362.bin from http://eu.grih.gree.com/wifiModule/image/10143/786432
............ done
Wrote 362001066763\U-W06A(P3)V6.04-316539128262708362.bin
Renaming downloaded/362001066763_v6.04_eu.grih.gree.com.md to 362001066763\U-W06A(P3)V6.04-316539128262708362.md

Ignore firmware code 362001066763 from in.grih.gree.com due to response status 405
Ignore firmware code 362001066763 from sa.grih.gree.com due to response status 405

Or just use one of the urls above :) once you have the file, look for SetTem - you'll find all the names.

marcinlubojanski commented 3 months ago

@mkaluza And look for the names with "strings" command ? I have fund funny stuff :

"<formula1>
  <team name="McLaren">
    <driver>
      <name>Kimi Raikkonen</name>
      <points>112</points>
    </driver>
    <driver>
      <name>Juan Pablo Montoya</name>
      <points>60</points>
    </driver>
  </team>
</formula1>
"

and

" "CreateDate": "2023-07-13 06:46:44",
  "commProtVer": "",
  "desc": "solve Poland problem",
  "forcedUpgrade": 0,
  "r": 200,
  "url": "http://test.grih.gree.com/wifiModule/image/17838/786432","

But I do have lot of variable names to test as well :D

mkaluza commented 3 months ago

@marcinlubojanski lol :D "solve Poland problem" sounds scary though... but anyway, strings, notepad, whatever you like - they are clustered in one place, so you get one, you get all of them. Though I see they appear more than once in the firmware - unlike in mine. Those look promissing:

EnvironmentTem
AirInTem
AirOutTem
LowPressureTem
HighPressureTem

In general - *Tem* :)

marcinlubojanski commented 3 months ago

Unfortunately almost all those "new" variables return 0. I have found additional water temperature sensor which I do not use and variables whenever defrost or heater is on. But nothing really valuable like external temperature :D Anyway in the meantime I have build ESP32 + 5 Xiaomi BT temperature sensors + supla FW. I have temperature for all rooms and external. All goes to Grafana and is also used in my script to control heating :)

mkaluza commented 3 months ago

@marcinlubojanski oh well... was worth a try... I just bought RPi5 as a base for home automation (and probably a home server, those specs are rather amazing...) and was thinking about Tuya sensors, but those from Xiaomi look ok/inexpensive as well. I could use humidity readouts... Though I very much do not want Grafana... it sucks balls deep - it sucked when I had my first take at it few years ago and it still does... but probably there's nothing better anyway :/

mkaluza commented 2 months ago

@marcinlubojanski so there is another way :D I recently plugged into it's internal communication bus :D https://github.com/mkaluza/gree-hacking (that's just a preliminary writeup) And since then I've found this https://github.com/bekmansurov/gree-hvac-protocol - so I'm not the only one :P But unfortunately they have different electrical characteristics - mine has 0 - 30V - 55V "logic" leves and constant frame length, that other one has more 'normal' parameters but variable frame length.... So probably you need to have an oscilloscope to hack it (safely).

But about your stuff - I also got Xiaomi sensors and they work fine. Are you talking to them directly from raspberry? or is that Supla a complete system? (yeah, I will read about it later)

The interesting thing about those params from the firmware is that some of them are not there - there is no 'Lig', 'time' and 'hid' to all of which the AC responds... so maybe there are more... :)

marcinlubojanski commented 2 months ago

@mkaluza at least my Gree should have modbus interface, but I don;t have hardware for it (nor any knowledge). As for the Xiaomi sensors - I have changed the firmware on them to Supla, then connected to ESP32 which runs small code that gathers data and upload to Supla. Then on supla site/app you create unique link for each sensor and this can be then used in any script (there is no need to integrate with supla anyhow). More details in polish over here: https://forum.supla.org/viewtopic.php?t=11193

dgolovach commented 1 week ago

hi, if you are interested, i managed to get params for a gree ducted system with zone controller (AUS version primarily) Working HA implementation is here https://github.com/dgolovach/HomeAssistant-GreeClimateComponent-Ducted-ZoneControl based on https://github.com/RobHofmann/HomeAssistant-GreeClimateComponent though a bit ugly

{"cols":["Pow","Mod","StTem","WdSpd","EnSvSt","StFahFlg","ColdMod","HeatSvStTemMax","CoolSvStTemMin","TemUnit","IndoorType","OMod","LowDeHumi","Quier","RmType","RmNum","VavleAllOn","CSvStTemMinFlg","HSvStTemMaxFlg","AllErr","InProtocol","Demand","IntProVer","MainConProVer","SubConProVer"],"mac":"01","t":"status"}

They split the zones by adding a suffix with a zone id to their MAC

{"t":"subList","r":200,"c":7,"i":5,"list":[{"mac":"05","mid":"5001","name":"zone","model":"gree","lock":0},{"mac":"06","mid":"5001","name":"zone","model":"gree","lock":0}]}