Seeing everyone on here connecting their Midea AC via XYE or USB, I wanted to connect my own system.
Unfortunately it's a semi-commercial "mini VRF" V8 system which is only connected via PQE, and the connectivity options may be a bit different.
Here is a summary of my project to connect to this, in order to monitor the system.
HARDWARE:
- outdoor unit: MDV-V200WN1(AU)
- 5 indoor units: mih80ghn18, mih25ghn18, etc
- ESP32D
- MAX485
MIDEA INTERFACES
There are 4 sets of connectors - M1M2, X1X2, PQE, D1(X)D2(Y).
The only thing connecting any of my indoor units is that theyr'e chained together with PQE.
At this point, I don't believe there is any way to control the system via PQE.
- M1M2: a new protocol for VRF units to communicate with each other and outdoor unit - not in use
- X1X2: for wired controller. I don't have a wired controller so I can't reverse engineer how to control this.
- PQE: the old protocol for VRF units to communicate with eachother and outdoor unit. This is what is in use in my system
- D1(X)D2(Y): "to other idus or group controller comm bus". None of it is wired up to other units and I don't have a wired controller so i assume it's not useful to me.
WHAT IS PQE
PQE is not for controlling the unit on/off, mode, or temperature set points.It's a bus where all units say what they are trying to do, and then the outdoor unit can control the refridgerant flow to make that happen.
Since these aren't user issuable commands, it's probably possible to really f something up by transmitting on this line - and I'm not even sure how i would do that anyway in a way that slotted in with all the other comms.
WIRING
The ESP32 needs to be wired to the MAX485, on the TTL side.
Ground to ground, 3.3v to 3.3v, and for me, MAX485 RX to GPI018 (or whatever).
On the 485 side, P and Q to A+ and B- (I don't think it matters which way with my MAX module) and Ground to Ground.
**PROTOCOL **
It is UART at 4800 baud.
The structure is usually some kind of poll request, then all the units respond one after another with information.
Byte 0 and 1 look like preamble or the frame start markers.
Byte 2 appears to be a message type.
Some message types (D0, D1, D2) appear to be information from the unit.
For D0, D1, D2 messages, byte 3 is often the unit number the message refers to. But, if byte 3 is 0x80, the unit number appears later in the frame, in byte 5.
I've put together some code to log transition of bytes within the different types of messages, keyed on both the type and the unit number.
Heres some example of how I keyed the different types of messages:for different units
- d0_n
- d0 messages with unit number in byte 3. e.g. d0_0, d0_1, etc
- d0_80_
- d0 messages with 80 in byte 3 and unit number in byte 5. d0_80_0, do_80_1, etc
Anway, d0_80_xx messages appear to have the goods.
-
byte 5 = unit number
- for me, from 0 to 4
- Couldn't see any way to map them to the actual units except to just turn on one at a time and watch the logs
-
byte 7 = mode
- The lowest bits of byte 7 appear to give the current base mode of the unit. 00 = off, 01 = fan, 02 = heat, 03 = AC
- Changing into a weird mode like dehumidifier set some of the upper bits too (for the 4 basic modes, the rest of the bits were 0)
-
Byte 9 = temp setpoint
- last 7 bits are the whole part of the temp in celcius.
- The most significant bit just says whether you should add a 0.5 to the end.
What Next
That''s mostly what I came for... the temp and the mode for each unit. But I'll keep snooping and then I'll surface the information back to HA.
I know that you can get wired controllers for these systems that can control multiple units, but I suspect you need the D1D2 group control wired up between the units.
I also know there are gateways for Midea VRF ACs. It's possible that there are other commands that a gateway can issue which causes the units to change their mode and set point etc and that this can happen over the PQE bus.
However, without a gateway to look at, I have nothing to reverse engineer in terms of what the commands look like or the timing for sending them. So I doubt I will ever be able to use this to control the units.
However, this integration will at least give me the status of all the units on my HA dash, so I know if I've left anything on. Then I can use IR blasters in a couple of the rooms so they can be controlled.