Adding support for Mitsubishi Heavy Industries SRKXXZMP-S

This commit is contained in:
jeroenterheerdt 2018-05-11 13:20:55 +02:00
parent fa5e8c1cda
commit 2a0ee63efc
3 changed files with 214 additions and 3 deletions

View File

@ -30,6 +30,16 @@ MitsubishiHeavyZMHeatpumpIR::MitsubishiHeavyZMHeatpumpIR() : MitsubishiHeavyHeat
_mitsubishiModel = MITSUBISHIHEAVY_ZM;
}
MitsubishiHeavyZMPHeatpumpIR::MitsubishiHeavyZMPHeatpumpIR() : MitsubishiHeavyHeatpumpIR()
{
static const char PROGMEM model[] PROGMEM = "mitsubishi_heavy_zmp";
static const char PROGMEM info[] PROGMEM = "{\"mdl\":\"mitsubishi_heavy_zmp\",\"dn\":\"Mitsubishi Heavy ZMP\",\"mT\":18,\"xT\":30,\"fs\":3}";
_model = model;
_info = info;
_mitsubishiModel = MITSUBISHIHEAVY_ZMP;
}
void MitsubishiHeavyHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd)
{
@ -165,7 +175,6 @@ void MitsubishiHeavyZJHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8
{
swingH = MITSUBISHI_HEAVY_ZJ_HS_3DAUTO;
}
sendMitsubishiHeavy(IR, powerMode, operatingMode, fanSpeed, temperature, swingV, swingH, cleanMode);
}
@ -301,6 +310,135 @@ void MitsubishiHeavyZMHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8
sendMitsubishiHeavy(IR, powerMode, operatingMode, fanSpeed, temperature, swingV, swingH, cleanMode, silentMode, _3DAuto);
}
void MitsubishiHeavyZMPHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd, bool cleanModeCmd, bool silentModeCmd, bool _3DAutoCmd)
{
// Sensible defaults for the heat pump mode
uint8_t powerMode = MITSUBISHI_HEAVY_MODE_ON;
uint8_t operatingMode = MITSUBISHI_HEAVY_MODE_HEAT;
uint8_t fanSpeed = MITSUBISHI_HEAVY_ZMP_FAN_AUTO;
uint8_t temperature = 23;
uint8_t swingV = MITSUBISHI_HEAVY_ZMP_VS_STOP;
uint8_t swingH = MITSUBISHI_HEAVY_ZMP_HS_STOP;
uint8_t cleanMode = MITSUBISHI_HEAVY_ZMP_CLEAN_OFF;
if (powerModeCmd == POWER_OFF)
{
powerMode = MITSUBISHI_HEAVY_MODE_OFF;
}
if (operatingModeCmd == MODE_MAINT && powerModeCmd == POWER_OFF)
{
powerMode = MITSUBISHI_HEAVY_MODE_ON;
cleanMode = MITSUBISHI_HEAVY_ZMP_CLEAN_ON;
}
switch (operatingModeCmd)
{
case MODE_AUTO:
operatingMode = MITSUBISHI_HEAVY_MODE_AUTO;
//In MODE_AUTO we need to handle temperature differently. It can range from -6 to +6
temperature = 0x80 - (0x10*temperatureCmd);
break;
case MODE_HEAT:
operatingMode = MITSUBISHI_HEAVY_MODE_HEAT;
break;
case MODE_COOL:
operatingMode = MITSUBISHI_HEAVY_MODE_COOL;
break;
case MODE_DRY:
operatingMode = MITSUBISHI_HEAVY_MODE_DRY;
break;
case MODE_FAN:
//Fan mode has no temperature setting
//ZMP model uses different code for fan mode.
operatingMode = MITSUBISHI_HEAVY_ZMP_MODE_FAN;
temperature = 0;
break;
case MODE_MAINT:
//Specify maintenance mode to activate clean mode
operatingMode = MITSUBISHI_HEAVY_ZMP_MODE_MAINT;
break;
}
switch (fanSpeedCmd)
{
case FAN_AUTO:
fanSpeed = MITSUBISHI_HEAVY_ZMP_FAN_AUTO;
break;
case FAN_1:
fanSpeed = MITSUBISHI_HEAVY_ZMP_FAN1;
break;
case FAN_2:
fanSpeed = MITSUBISHI_HEAVY_ZMP_FAN2;
break;
case FAN_3:
fanSpeed = MITSUBISHI_HEAVY_ZMP_FAN3;
break;
case FAN_4: //Map FAN_4 to HiPower
fanSpeed = MITSUBISHI_HEAVY_ZMP_HIPOWER;
break;
case FAN_5: //Map FAN_5 to Econo
fanSpeed = MITSUBISHI_HEAVY_ZMP_ECONO;
break;
}
if (silentModeCmd)
{
// Silent mode doesn't exist on ZMP model, use ECONO mode instead
fanSpeed = MITSUBISHI_HEAVY_ZMP_SILENT_ON;
}
if ( temperatureCmd > 17 && temperatureCmd < 31)
{
temperature = (~((temperatureCmd - 17) << 4)) & 0xF0;
}
switch (swingVCmd)
{
case VDIR_MANUAL:
swingV = MITSUBISHI_HEAVY_ZMP_VS_STOP;
break;
case VDIR_SWING:
swingV = MITSUBISHI_HEAVY_ZMP_VS_SWING;
break;
case VDIR_UP:
swingV = MITSUBISHI_HEAVY_ZMP_VS_UP;
break;
case VDIR_MUP:
swingV = MITSUBISHI_HEAVY_ZMP_VS_MUP;
break;
case VDIR_MIDDLE:
swingV = MITSUBISHI_HEAVY_ZMP_VS_MIDDLE;
break;
case VDIR_MDOWN:
swingV = MITSUBISHI_HEAVY_ZMP_VS_MDOWN;
break;
case VDIR_DOWN:
swingV = MITSUBISHI_HEAVY_ZMP_VS_DOWN;
break;
}
/* ZMP model has no horizontal swing
*/
Serial.println("Calling sendHeavy from ZMP with");
Serial.print(F("PowerMode: "));
Serial.println(powerMode);
Serial.print(F("OperatingMode: "));
Serial.println(operatingMode);
Serial.print(F("FanSpeed: "));
Serial.println(fanSpeed);
Serial.print(F("Temperature: "));
Serial.println(temperature);
Serial.print(F("swingV: "));
Serial.println(swingV);
Serial.print(F("swingH: "));
Serial.println(swingH);
Serial.print(F("cleanMode: "));
Serial.println(cleanMode);
sendMitsubishiHeavy(IR, powerMode, operatingMode, fanSpeed, temperature, swingV, swingH, cleanMode);
}
void MitsubishiHeavyZJHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode)
{
@ -338,7 +476,6 @@ void MitsubishiHeavyZJHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powe
IR.space(0);
}
void MitsubishiHeavyZMHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode, uint8_t silentMode, uint8_t _3DAuto)
{
uint8_t MitsubishiHeavyZMTemplate[] = { 0x52, 0xAE, 0xC3, 0x1A, 0xE5, 0x90, 0x00, 0xF0, 0x00, 0xF0, 0x00, 0x0D, 0x00, 0x10, 0x00, 0xFF, 0x00, 0x7B, 0x00 };
@ -387,3 +524,43 @@ void MitsubishiHeavyZMHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powe
IR.mark(MITSUBISHI_HEAVY_BIT_MARK);
IR.space(0);
}
void MitsubishiHeavyZMPHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode)
{
uint8_t MitsubishiHeavyZMPTemplate[] = { 0x52, 0xAE, 0xC3, 0x26, 0xD9, 0x11, 0x00, 0x07, 0x00, 0x00, 0x00 };
// 0 1 2 3 4 5 6 7 8 9 10
// Horizontal & vertical air flow + allergen + clean + 3D
MitsubishiHeavyZMPTemplate[5] |= swingH | (swingV & 0b00000010) | cleanMode;
// Vertical air flow + fan speed
MitsubishiHeavyZMPTemplate[7] |= fanSpeed | (swingV & 0b00011000);
// Power state + operating mode + temperature
MitsubishiHeavyZMPTemplate[9] |= operatingMode | powerMode | temperature;
// There is no checksum, but some bytes are inverted
MitsubishiHeavyZMPTemplate[6] = ~MitsubishiHeavyZMPTemplate[5];
MitsubishiHeavyZMPTemplate[8] = ~MitsubishiHeavyZMPTemplate[7];
MitsubishiHeavyZMPTemplate[10] = ~MitsubishiHeavyZMPTemplate[9];
// 38 kHz PWM frequency
IR.setFrequency(38);
// Header
IR.mark(MITSUBISHI_HEAVY_HDR_MARK);
IR.space(MITSUBISHI_HEAVY_HDR_SPACE);
// Data
for (uint8_t i=0; i<sizeof(MitsubishiHeavyZMPTemplate); i++) {
Serial.print(F("Byte "));
Serial.print(i);
Serial.print(F(": "));
Serial.println(MitsubishiHeavyZMPTemplate[i]);
IR.sendIRbyte(MitsubishiHeavyZMPTemplate[i], MITSUBISHI_HEAVY_BIT_MARK, MITSUBISHI_HEAVY_ZERO_SPACE, MITSUBISHI_HEAVY_ONE_SPACE);
}
// End mark
IR.mark(MITSUBISHI_HEAVY_BIT_MARK);
IR.space(0);
}

View File

@ -21,6 +21,8 @@
#define MITSUBISHI_HEAVY_MODE_COOL 0x06
#define MITSUBISHI_HEAVY_MODE_DRY 0x05
#define MITSUBISHI_HEAVY_MODE_FAN 0x04
#define MITSUBISHI_HEAVY_ZMP_MODE_FAN 0xD4 //ZMP model seems to have a different value for operating mode 'fan'
#define MITSUBISHI_HEAVY_ZMP_MODE_MAINT 0x06 //We use the maintenance mode to activate cleaning.
#define MITSUBISHI_HEAVY_MODE_OFF 0x08 // Power OFF
#define MITSUBISHI_HEAVY_MODE_ON 0x00 // Power ON
@ -29,7 +31,7 @@
#define MITSUBISHI_HEAVY_ZJ_FAN1 0xA0
#define MITSUBISHI_HEAVY_ZJ_FAN2 0x80
#define MITSUBISHI_HEAVY_ZJ_FAN3 0x60
#define MITSUBISHI_HEAVY_ZJ_HIPOWER 0x40
#define MITSUBISHI_HEAVY_ZJ_HIPOWER 0x40
#define MITSUBISHI_HEAVY_ZJ_ECONO 0x00
#define MITSUBISHI_HEAVY_ZM_FAN_AUTO 0x0F // Fan speed
@ -40,9 +42,18 @@
#define MITSUBISHI_HEAVY_ZM_HIPOWER 0x07
#define MITSUBISHI_HEAVY_ZM_ECONO 0x09
#define MITSUBISHI_HEAVY_ZMP_FAN_AUTO 0xE0 // Fan speed
#define MITSUBISHI_HEAVY_ZMP_FAN1 0xA0
#define MITSUBISHI_HEAVY_ZMP_FAN2 0x80
#define MITSUBISHI_HEAVY_ZMP_FAN3 0x60
#define MITSUBISHI_HEAVY_ZMP_HIPOWER 0x20
#define MITSUBISHI_HEAVY_ZMP_ECONO 0x00
#define MITSUBISHI_HEAVY_CLEAN_ON 0x00
#define MITSUBISHI_HEAVY_ZMP_CLEAN_ON 0xDF
#define MITSUBISHI_HEAVY_ZJ_CLEAN_OFF 0x20
#define MITSUBISHI_HEAVY_ZM_CLEAN_OFF 0x60
#define MITSUBISHI_HEAVY_ZMP_CLEAN_OFF 0x20
#define MITSUBISHI_HEAVY_ZM_3DAUTO_ON 0x00 // Only available in Auto, Cool and Heat mode
#define MITSUBISHI_HEAVY_ZM_3DAUTO_OFF 0x12
@ -50,6 +61,7 @@
#define MITSUBISHI_HEAVY_ZJ_SILENT_ON 0x00
#define MITSUBISHI_HEAVY_ZM_SILENT_ON 0x00 // NOT available in Fan or Dry mode
#define MITSUBISHI_HEAVY_ZM_SILENT_OFF 0x80
#define MITSUBISHI_HEAVY_ZMP_SILENT_ON 0x00
#define MITSUBISHI_HEAVY_ZJ_VS_SWING 0x0A // Vertical swing
#define MITSUBISHI_HEAVY_ZJ_VS_UP 0x02
@ -67,6 +79,14 @@
#define MITSUBISHI_HEAVY_ZM_VS_DOWN 0x40
#define MITSUBISHI_HEAVY_ZM_VS_STOP 0x20
#define MITSUBISHI_HEAVY_ZMP_VS_SWING 0x0A // Vertical swing
#define MITSUBISHI_HEAVY_ZMP_VS_UP 0x02
#define MITSUBISHI_HEAVY_ZMP_VS_MUP 0x18
#define MITSUBISHI_HEAVY_ZMP_VS_MIDDLE 0x10
#define MITSUBISHI_HEAVY_ZMP_VS_MDOWN 0x08
#define MITSUBISHI_HEAVY_ZMP_VS_DOWN 0x00
#define MITSUBISHI_HEAVY_ZMP_VS_STOP 0x1A
#define MITSUBISHI_HEAVY_ZJ_HS_SWING 0x4C // Horizontal swing - 3D AUTO
#define MITSUBISHI_HEAVY_ZJ_HS_MIDDLE 0x48
#define MITSUBISHI_HEAVY_ZJ_HS_LEFT 0xC8
@ -88,9 +108,13 @@
#define MITSUBISHI_HEAVY_ZM_HS_LEFTRIGHT 0x08
#define MITSUBISHI_HEAVY_ZM_HS_RIGHTLEFT 0x09
//ZMP model does not support horizontal swing
#define MITSUBISHI_HEAVY_ZMP_HS_STOP 0xCC
// MitsubishiHeavy model codes
#define MITSUBISHIHEAVY_ZJ 0
#define MITSUBISHIHEAVY_ZM 1
#define MITSUBISHIHEAVY_ZMP 2
class MitsubishiHeavyHeatpumpIR : public HeatpumpIR
@ -124,5 +148,14 @@ class MitsubishiHeavyZMHeatpumpIR : public MitsubishiHeavyHeatpumpIR
void sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode, uint8_t silentMode, uint8_t _3DAuto);
};
class MitsubishiHeavyZMPHeatpumpIR : public MitsubishiHeavyHeatpumpIR
{
public:
MitsubishiHeavyZMPHeatpumpIR();
void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd, bool cleanModeCmd, bool silentModeCmd, bool _3DAutoCmd);
private:
void sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode);
};
#endif

View File

@ -22,6 +22,7 @@ An Arduino library to control pump/split unit air conditioner. Currently support
* Also Onnline (sold through Onninen) has been reported to work
* Mitsubishi Heavy SRKxxZJ-S (Remote control P/N RKX502A001C)
* Mitsubishi Heavy SRKxxZM-S (Remote Control P/N RLA502A700B)
* Mitsubishi Heavy SRKxxZMP-S (Remote Control P/N RKX502A001P)
* Mitsubishi MSZ FD-25, probably also FD-35 (remote control P/N KM09D 0052376)
* Also FH series has been confirmed to work
* Panasonic E9/E12-CKP (Panasonic remote control P/N A75C2295)