cmroche / greeclimate

Python package for controlling Gree based minisplit systems
GNU General Public License v3.0
44 stars 22 forks source link

Support for Sinclair Heapumps #68

Open TheEris opened 1 year ago

TheEris commented 1 year ago

this is pretty much copypaste of my other issue from gree-remote, link here

I've got myself a few months back a heat pump from Sinclair (model: smh-100irb and smh-60irb) and it didn't work out of the box, so I've started digging. Here is the complete flow I was able to dig out from the EWPE Smart app with Wireshark (the heat pump is there as "ATW HP"). For now I've created a flow in node-red that reads the states (in, out and room temp) and pushes it into HA.

All the pack data is decrypted for easier reading.

after inital discovery and binding:

{
    "pack":"{
        "t":"status",
        "mac":"<MAC>",
        "cols":[
            "AllInWatTemHi",
            "AllInWatTemLo",
            "AllOutWatTemHi",
            "AllOutWatTemLo",
            "HepOutWatTemHi",
            "HepOutWatTemLo",
            "WatBoxTemHi",
            "WatBoxTemLo",
            "RmoHomTemHi",
            "RmoHomTemLo",
            "WatBoxElcHeRunSta",
            "SyAnFroRunSta",
            "ElcHe1RunSta",
            "ElcHe2RunSta",
            "AnFrzzRunSta",
            "TemUn",
            "AllErr"
        ]
    }",
    "i":0,
    "cid":"app",
    "uid":0,
    "tcid":"<MAC>",
    "t":"pack"
}

with response

{
    "t":"pack",
    "i":0,
    "uid":0,
    "cid":"<MAC>",
    "tcid":"app",
    "pack":"{
        "t":"dat",
        "r":200,
        "mac":"<MAC>",
        "cols":[
            "AllInWatTemHi",
            "AllInWatTemLo",
            "AllOutWatTemHi",
            "AllOutWatTemLo",
            "HepOutWatTemHi",
            "HepOutWatTemLo",
            "WatBoxTemHi",
            "WatBoxTemLo",
            "RmoHomTemHi",
            "RmoHomTemLo",
            "WatBoxElcHeRunSta",
            "SyAnFroRunSta",
            "ElcHe1RunSta",
            "ElcHe2RunSta",
            "AnFrzzRunSta",
            "TemUn",
            "AllErr"
        ],
        "dat":[
            132,
            4,
            132,
            2,
            70,
            0,
            100,
            0,
            70,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
        ]
    }"
}

input water temp: (dat[0]-100)+dat[1]0.1 = 32.4 output water temp: (dat[2]-100)+dat[3]0.1 = 32.2 same goes for other variables that have two parts wih Hi-Lo ending (HepOutWatTem shows -30 because i dont have it configured)

{
    "pack":"{
        "t":"status",
        "mac":"<MAC>",
        "cols":[
            "Pow",
            "Mod",
            "CoWatOutTemSet",
            "HeWatOutTemSet",
            "WatBoxTemSet",
            "TemUn",
            "TemRec",
            "AllErr",
            "host",
            "name",
            "ColHtWter",
            "HetHtWter",
            "LefHom",
            "TemRecB",
            "RomHomTemExt",
            "CoHomTemSet",
            "HeHomTemSet"
            ]
    }"
    "i":0,
    "cid":"app",
    "uid":2179292,
    "tcid":"<MAC>",
    "t":"pack"
}

{
    "t":"pack",
    "i":0,
    "uid":2179292,
    "cid":"<MAC>",
    "tcid":"app",
    "pack":"{
        "t":"dat",
        "r":200,
        "mac":"<MAC>",
        "cols":[
            "Pow",
            "Mod",
            "CoWatOutTemSet",
            "HeWatOutTemSet",
            "WatBoxTemSet",
            "TemUn",
            "TemRec",
            "AllErr",
            "host",
            "name",
            "ColHtWter",
            "HetHtWter",
            "LefHom",
            "TemRecB",
            "RomHomTemExt",
            "CoHomTemSet",
            "HeHomTemSet"],
        "dat":[
            1,
            1,
            18,
            35,
            50,
            0,
            0,
            0,
            "eu.dis.gree.com",
            "",
            0,
            0,
            0,
            0,
            0,
            24,
            20
            ]
    }"
}

everything else works fine, i can even controll the unit if i change the fields.

cmroche commented 4 months ago

Can you describe what all of these new fields are please? @TheEris

I understand the Hi/Lo relation, but not really what the fields are reporting.

TheEris commented 4 months ago

@cmroche I've figured out only the most basic info as i wanted to just tract the water temperature. In the end i dont even control it from this. Here is what I know:

AllInWatTemHi/Lo - Water temperature returning to the pump AllOutWatTemHi/Lo - Water temperature from the pump RmoHomTemHi/Lo - temperature in the room (if you have room sensor)

as for the AnFrzzRunSta that should be anti freeze cycle, it newer changed from 0 rest are sensors that i dont have installed, so i cannot say what it is for sure.

Ill try to dig up some old notes when i was figuring it out the first time, or ill just try to reverse-engineer it again this weekend as now i have nodered setup for easy control of the packets.

cmroche commented 4 months ago

@TheEris Which sensor replaces TemSet then as the "Current Temperature" reported on the Climate device in HASS?

cmroche commented 4 months ago

Also, could you tell me what the HID value is? Usually dumped to logs, or you can query it.

TheEris commented 4 months ago

That would be HeWatOutTemSet for heating and CoWatOutTemSet for cooling (as the temperature you want the water to be), you switch modes with Mod, I'll come back with values for Mod probably later this weekend

as for the HID value, im not sure what is that ?

cmroche commented 4 months ago

Send:

2024-06-27 17:08:28.325 DEBUG (MainThread) [greeclimate.network] Sending packet: {"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "f4911e7aca59", "pack": {"mac": "f4911e7aca59", "t": "status", "cols": ["hid"]}}

Will report

2024-06-27 17:08:28.601 DEBUG (MainThread) [greeclimate.network] Received packet: {"t": "pack", "i": 0, "uid": 0, "cid": "f4911e7aca59", "tcid": "", "pack": {"t": "dat", "mac": "f4911e7aca59", "r": 200, "cols": ["hid"], "dat": ["362001000762+U-CS532AE(LT)V3.31.bin"]}}

If you enable debug logs for greeclimate in hass this will dump out to the logs.

Or, just read back the value of HID like you would any other property on the device.

TheEris commented 4 months ago

ok, just got the HID value,

362001066763+U-W06A(P3)V6.04.bin

its same for both pumps (models smh-100irb and smh-60irb)

cmroche commented 4 months ago

@TheEris One more please, when binding, the devices will respond with a "bindok" message, could you paste the whole message (for both) please.

TheEris commented 4 months ago

@cmroche sure

its the same response for both models, just different key and mac, pack is decoded in this snipped for easier reading (original is encoded with the default key a3K8Bx%2r8Y7#xDh)

{
    "t":"pack",
    "i":1,
    "uid":0,
    "cid":"<MAC>",
    "tcid":"app",
    "pack":"{
        "t":"bindok",
        "mac":"<MAC>",
        "key":"<KEY>",
        "r":200
    }"
}

btw, the whole discovery and values ive managed to find is in my older post here