Mitsubishi ZM-S support
This commit is contained in:
parent
7c45e2ca41
commit
594a5a030c
|
@ -1,13 +1,33 @@
|
|||
#include <MitsubishiHeavyHeatpumpIR.h>
|
||||
|
||||
|
||||
MitsubishiHeavyHeatpumpIR::MitsubishiHeavyHeatpumpIR()
|
||||
// These are protected methods, i.e. generic MitsubishiHeavy instances cannot be created directly
|
||||
MitsubishiHeavyHeatpumpIR::MitsubishiHeavyHeatpumpIR() : HeatpumpIR()
|
||||
{
|
||||
static const char PROGMEM model[] PROGMEM = "mitsubishi_heavy";
|
||||
static const char PROGMEM info[] PROGMEM = "{\"mdl\":\"mitsubishi_heavy\",\"dn\":\"Mitsubishi Heavy\",\"mT\":18,\"xT\":30,\"fs\":5}"; ///////
|
||||
}
|
||||
|
||||
|
||||
// The different models just set the model accordingly
|
||||
|
||||
MitsubishiHeavyZJHeatpumpIR::MitsubishiHeavyZJHeatpumpIR() : MitsubishiHeavyHeatpumpIR()
|
||||
{
|
||||
static const char PROGMEM model[] PROGMEM = "mitsubishi_heavy_zj";
|
||||
static const char PROGMEM info[] PROGMEM = "{\"mdl\":\"mitsubishi_heavy_zj\",\"dn\":\"Mitsubishi Heavy ZJ\",\"mT\":18,\"xT\":30,\"fs\":5}"; ///////
|
||||
|
||||
_model = model;
|
||||
_info = info;
|
||||
|
||||
_mitsubishiModel = MITSUBISHIHEAVY_ZJ;
|
||||
}
|
||||
|
||||
MitsubishiHeavyZMHeatpumpIR::MitsubishiHeavyZMHeatpumpIR() : MitsubishiHeavyHeatpumpIR()
|
||||
{
|
||||
static const char PROGMEM model[] PROGMEM = "mitsubishi_heavy_zm";
|
||||
static const char PROGMEM info[] PROGMEM = "{\"mdl\":\"mitsubishi_heavy_zm\",\"dn\":\"Mitsubishi Heavy ZM\",\"mT\":18,\"xT\":30,\"fs\":5}"; ///////
|
||||
|
||||
_model = model;
|
||||
_info = info;
|
||||
|
||||
_mitsubishiModel = MITSUBISHIHEAVY_ZM;
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,6 +54,10 @@ void MitsubishiHeavyHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t
|
|||
powerMode = MITSUBISHI_AIRCON2_MODE_OFF;
|
||||
}
|
||||
|
||||
if ( _mitsubishiModel == MITSUBISHIHEAVY_ZM ) {
|
||||
cleanMode = MITSUBISHI_AIRCON2_CLN_OFF_ZM;
|
||||
}
|
||||
|
||||
if (cleanModeCmd == true && powerModeCmd == POWER_OFF && (operatingModeCmd == MODE_AUTO || operatingModeCmd == MODE_COOL || operatingModeCmd == MODE_DRY))
|
||||
{
|
||||
powerMode = MITSUBISHI_AIRCON2_MODE_ON;
|
||||
|
@ -83,7 +107,11 @@ void MitsubishiHeavyHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t
|
|||
|
||||
if ( temperatureCmd > 17 && temperatureCmd < 31)
|
||||
{
|
||||
temperature = (~((temperatureCmd - 17) << 4)) & 0xF0;
|
||||
if ( _mitsubishiModel == MITSUBISHIHEAVY_ZJ ) {
|
||||
temperature = (~((temperatureCmd - 17) << 4)) & 0xF0;
|
||||
} else {
|
||||
temperature = (~(temperatureCmd - 17) & 0x0F);
|
||||
}
|
||||
}
|
||||
|
||||
switch (swingVCmd)
|
||||
|
@ -136,31 +164,32 @@ void MitsubishiHeavyHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t
|
|||
break;
|
||||
}
|
||||
|
||||
sendMitsubishiHeavy(IR, powerMode, operatingMode, fanSpeed, temperature, swingV, swingH, cleanMode);
|
||||
if ( _mitsubishiModel == MITSUBISHIHEAVY_ZJ ) {
|
||||
sendMitsubishiHeavyZJ(IR, powerMode, operatingMode, fanSpeed, temperature, swingV, swingH, cleanMode);
|
||||
} else {
|
||||
sendMitsubishiHeavyZM(IR, powerMode, operatingMode, fanSpeed, temperature, swingV, swingH, cleanMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MitsubishiHeavyHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode)
|
||||
void MitsubishiHeavyHeatpumpIR::sendMitsubishiHeavyZJ(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingV, uint8_t swingH, uint8_t cleanMode)
|
||||
{
|
||||
(void)swingV;
|
||||
(void)swingH;
|
||||
uint8_t MitsubishiHeavyZJTemplate[] = { 0x52, 0xAE, 0xC3, 0x26, 0xD9, 0x11, 0x00, 0x07, 0x00, 0x00, 0x00 };
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
|
||||
uint8_t MitsubishiHeavyTemplate[] = { 0x52, 0xAE, 0xC3, 0x26, 0xD9, 0x11, 0x00, 0x07, 0x00, 0x00, 0x00 };
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
|
||||
// Vertical air flow + allergen + clean + 3D
|
||||
MitsubishiHeavyTemplate[5] |= swingH | (swingV & 0b00000010) | cleanMode;
|
||||
// Horizontal & vertical air flow + allergen + clean + 3D
|
||||
MitsubishiHeavyZJTemplate[5] |= swingH | (swingV & 0b00000010) | cleanMode;
|
||||
|
||||
// Vertical air flow + fan speed
|
||||
MitsubishiHeavyTemplate[7] |= fanSpeed | (swingV & 0b00011000);
|
||||
MitsubishiHeavyZJTemplate[7] |= fanSpeed | (swingV & 0b00011000);
|
||||
|
||||
// Power state + operating mode + fan speed
|
||||
MitsubishiHeavyTemplate[9] |= operatingMode | powerMode | temperature;
|
||||
// Power state + operating mode + temperature
|
||||
MitsubishiHeavyZJTemplate[9] |= operatingMode | powerMode | temperature;
|
||||
|
||||
// There is no checksum, but some bytes are inverted
|
||||
MitsubishiHeavyTemplate[6] = ~MitsubishiHeavyTemplate[5];
|
||||
MitsubishiHeavyTemplate[8] = ~MitsubishiHeavyTemplate[7];
|
||||
MitsubishiHeavyTemplate[10] = ~MitsubishiHeavyTemplate[9];
|
||||
MitsubishiHeavyZJTemplate[6] = ~MitsubishiHeavyZJTemplate[5];
|
||||
MitsubishiHeavyZJTemplate[8] = ~MitsubishiHeavyZJTemplate[7];
|
||||
MitsubishiHeavyZJTemplate[10] = ~MitsubishiHeavyZJTemplate[9];
|
||||
|
||||
// 38 kHz PWM frequency
|
||||
IR.setFrequency(38);
|
||||
|
@ -170,11 +199,58 @@ void MitsubishiHeavyHeatpumpIR::sendMitsubishiHeavy(IRSender& IR, uint8_t powerM
|
|||
IR.space(MITSUBISHI_AIRCON2_HDR_SPACE);
|
||||
|
||||
// Data
|
||||
for (uint8_t i=0; i<sizeof(MitsubishiHeavyTemplate); i++) {
|
||||
IR.sendIRbyte(MitsubishiHeavyTemplate[i], MITSUBISHI_AIRCON2_BIT_MARK, MITSUBISHI_AIRCON2_ZERO_SPACE, MITSUBISHI_AIRCON2_ONE_SPACE);
|
||||
for (uint8_t i=0; i<sizeof(MitsubishiHeavyZJTemplate); i++) {
|
||||
IR.sendIRbyte(MitsubishiHeavyZJTemplate[i], MITSUBISHI_AIRCON2_BIT_MARK, MITSUBISHI_AIRCON2_ZERO_SPACE, MITSUBISHI_AIRCON2_ONE_SPACE);
|
||||
}
|
||||
|
||||
// End mark
|
||||
IR.mark(MITSUBISHI_AIRCON2_BIT_MARK);
|
||||
IR.space(0);
|
||||
}
|
||||
|
||||
|
||||
void MitsubishiHeavyHeatpumpIR::sendMitsubishiHeavyZM(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 MitsubishiHeavyZMTemplate[] = { 0x52, 0xAE, 0xC3, 0x1A, 0xE5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x7B, 0x00 };
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
||||
|
||||
// Power state + operating mode
|
||||
MitsubishiHeavyZMTemplate[5] |= operatingMode | powerMode | cleanMode;
|
||||
|
||||
// Temperature
|
||||
MitsubishiHeavyZMTemplate[7] |= temperature;
|
||||
|
||||
// Fan speed
|
||||
MitsubishiHeavyZMTemplate[9] |= fanSpeed;
|
||||
|
||||
// Vertical air flow
|
||||
MitsubishiHeavyZMTemplate[11] |= swingH | (swingV & 0b00000010);
|
||||
|
||||
// Horizontal air flow
|
||||
MitsubishiHeavyZMTemplate[13] |= (swingV & 0b00011000);
|
||||
|
||||
// There is no checksum, but some bytes are inverted
|
||||
MitsubishiHeavyZMTemplate[6] = ~MitsubishiHeavyZMTemplate[5];
|
||||
MitsubishiHeavyZMTemplate[8] = ~MitsubishiHeavyZMTemplate[7];
|
||||
MitsubishiHeavyZMTemplate[10] = ~MitsubishiHeavyZMTemplate[9];
|
||||
MitsubishiHeavyZMTemplate[12] = ~MitsubishiHeavyZMTemplate[11];
|
||||
MitsubishiHeavyZMTemplate[14] = ~MitsubishiHeavyZMTemplate[13];
|
||||
MitsubishiHeavyZMTemplate[16] = ~MitsubishiHeavyZMTemplate[15];
|
||||
MitsubishiHeavyZMTemplate[18] = ~MitsubishiHeavyZMTemplate[17];
|
||||
|
||||
// 38 kHz PWM frequency
|
||||
IR.setFrequency(38);
|
||||
|
||||
// Header
|
||||
IR.mark(MITSUBISHI_AIRCON2_HDR_MARK);
|
||||
IR.space(MITSUBISHI_AIRCON2_HDR_SPACE);
|
||||
|
||||
// Data
|
||||
for (uint8_t i=0; i<sizeof(MitsubishiHeavyZMTemplate); i++) {
|
||||
IR.sendIRbyte(MitsubishiHeavyZMTemplate[i], MITSUBISHI_AIRCON2_BIT_MARK, MITSUBISHI_AIRCON2_ZERO_SPACE, MITSUBISHI_AIRCON2_ONE_SPACE);
|
||||
}
|
||||
|
||||
// End mark
|
||||
IR.mark(MITSUBISHI_AIRCON2_BIT_MARK);
|
||||
IR.space(0);
|
||||
}
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#define MITSUBISHI_AIRCON2_CLEAN_ON 0x00
|
||||
#define MITSUBISHI_AIRCON2_CLEAN_OFF 0x20
|
||||
#define MITSUBISHI_AIRCON2_CLN_OFF_ZM 0x60
|
||||
|
||||
#define MITSUBISHI_AIRCON2_VS_AUTO 0x0A // Vertical swing
|
||||
#define MITSUBISHI_AIRCON2_VS_UP 0x02
|
||||
|
@ -52,15 +53,37 @@
|
|||
#define MITSUBISHI_AIRCON2_HS_3DAUTO 0x04
|
||||
|
||||
|
||||
// MitsubishiHeavy model codes
|
||||
#define MITSUBISHIHEAVY_ZJ 0
|
||||
#define MITSUBISHIHEAVY_ZM 1
|
||||
|
||||
|
||||
class MitsubishiHeavyHeatpumpIR : public HeatpumpIR
|
||||
{
|
||||
public:
|
||||
protected: // Cannot create generic MitsubishiHeavy heatpump instances
|
||||
MitsubishiHeavyHeatpumpIR();
|
||||
uint8_t _mitsubishiModel; // Tells whether this is ZJ or ZM (or other supported model...)
|
||||
|
||||
public:
|
||||
void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd);
|
||||
void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd, bool cleanModeCmd);
|
||||
|
||||
private:
|
||||
void sendMitsubishiHeavy(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingVCmd, uint8_t swingHCmd, uint8_t cleanMode);
|
||||
void sendMitsubishiHeavyZJ(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingVCmd, uint8_t swingHCmd, uint8_t cleanMode);
|
||||
void sendMitsubishiHeavyZM(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature, uint8_t swingVCmd, uint8_t swingHCmd, uint8_t cleanMode);
|
||||
};
|
||||
|
||||
class MitsubishiHeavyZJHeatpumpIR : public MitsubishiHeavyHeatpumpIR
|
||||
{
|
||||
public:
|
||||
MitsubishiHeavyZJHeatpumpIR();
|
||||
};
|
||||
|
||||
class MitsubishiHeavyZMHeatpumpIR : public MitsubishiHeavyHeatpumpIR
|
||||
{
|
||||
public:
|
||||
MitsubishiHeavyZMHeatpumpIR();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,7 +15,7 @@ Currently supports at least these models
|
|||
* Sharp AY-ZP40KR (remote control P/N CRMC-A788JBEZ), possibly also IVT
|
||||
* Daikin RXS25G2V1B / FVXS25FV1B (Remote control P/N ARC452A1)
|
||||
* Mitsubishi Heavy SRKxxZJ-S (Remote control P/N RKX502A001C)
|
||||
|
||||
* Mitsubishi Heavy SRKxxZM-S (Remote Control P/N RLA502A700B)
|
||||
|
||||
## Instructions
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ HeatpumpIR *heatpumpIR[] = {new PanasonicCKPHeatpumpIR(), new PanasonicDKEHeatpu
|
|||
new PanasonicNKEHeatpumpIR(), new CarrierHeatpumpIR(), new MideaHeatpumpIR(),
|
||||
new FujitsuHeatpumpIR(), new MitsubishiFDHeatpumpIR(), new MitsubishiFEHeatpumpIR(),
|
||||
new SamsungHeatpumpIR(), new SharpHeatpumpIR(), new DaikinHeatpumpIR(),
|
||||
new MitsubishiHeavyHeatpumpIR(), NULL};
|
||||
new MitsubishiHeavyZJHeatpumpIR(), new MitsubishiHeavyZMHeatpumpIR(), NULL};
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
|
|
@ -14,6 +14,9 @@ SamsungHeatpumpIR KEYWORD1
|
|||
SharpHeatpumpIR KEYWORD1
|
||||
DaikinHeatpumpIR KEYWORD1
|
||||
MitsubishiHeavyHeatpumpIR KEYWORD1
|
||||
MitsubishiHeavyZJHeatpumpIR KEYWORD1
|
||||
MitsubishiHeavyZMHeatpumpIR KEYWORD1
|
||||
|
||||
|
||||
IRSender KEYWORD1
|
||||
IRSenderPWM KEYWORD1
|
||||
|
|
Loading…
Reference in New Issue