Skip to content

Commit

Permalink
Add Mitsubishi AC "fan only" mode (#1527)
Browse files Browse the repository at this point in the history
This PR adds "fan only" mode for Mitsubishi AC units. I noticed that it was missing previously and always defaulted to "Auto" instead.

The IR code for this was captured from the remote that came with my indoor unit (Mitsubishi MSZ-SF25VE) and the resulting change to the library has been real-world tested with that device as well. I can't say if it will apply to all Mitsubishi AC units, as I only have this type available for testing.

The commits mostly just add the kMitsubishiAcFan constant and raw bitfield data.
Adds functionality to set the mode of Mitsubishi air conditioners to "fan only". Tested with MSZ-SF25VE indoor units.
  • Loading branch information
sth519 authored Jul 8, 2021
1 parent 88eefdf commit 2f0583e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ir_Mitsubishi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ void IRMitsubishiAC::setMode(const uint8_t mode) {
case kMitsubishiAcCool: _.raw[8] = 0b00110110; break;
case kMitsubishiAcDry: _.raw[8] = 0b00110010; break;
case kMitsubishiAcHeat: _.raw[8] = 0b00110000; break;
case kMitsubishiAcFan: _.raw[8] = 0b00110111; break;
default:
_.raw[8] = 0b00110000;
_.Mode = kMitsubishiAcAuto;
Expand Down Expand Up @@ -612,6 +613,7 @@ uint8_t IRMitsubishiAC::convertMode(const stdAc::opmode_t mode) {
case stdAc::opmode_t::kCool: return kMitsubishiAcCool;
case stdAc::opmode_t::kHeat: return kMitsubishiAcHeat;
case stdAc::opmode_t::kDry: return kMitsubishiAcDry;
case stdAc::opmode_t::kFan: return kMitsubishiAcFan;
default: return kMitsubishiAcAuto;
}
}
Expand Down Expand Up @@ -679,6 +681,7 @@ stdAc::opmode_t IRMitsubishiAC::toCommonMode(const uint8_t mode) {
case kMitsubishiAcCool: return stdAc::opmode_t::kCool;
case kMitsubishiAcHeat: return stdAc::opmode_t::kHeat;
case kMitsubishiAcDry: return stdAc::opmode_t::kDry;
case kMitsubishiAcFan: return stdAc::opmode_t::kFan;
default: return stdAc::opmode_t::kAuto;
}
}
Expand Down Expand Up @@ -780,7 +783,7 @@ String IRMitsubishiAC::toString(void) const {
result += addBoolToString(_.Power, kPowerStr, false);
result += addModeToString(_.Mode, kMitsubishiAcAuto, kMitsubishiAcCool,
kMitsubishiAcHeat, kMitsubishiAcDry,
kMitsubishiAcAuto);
kMitsubishiAcFan);
result += addTempFloatToString(getTemp());
result += addFanToString(getFan(), kMitsubishiAcFanRealMax,
kMitsubishiAcFanRealMax - 3,
Expand Down
3 changes: 3 additions & 0 deletions src/ir_Mitsubishi.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
// Brand: Mitsubishi Electric, Model: SG153/M21EDF426 remote (MITSUBISHI_AC)
// Brand: Mitsubishi Electric, Model: MSZ-GV2519 A/C (MITSUBISHI_AC)
// Brand: Mitsubishi Electric, Model: RH151/M21ED6426 remote (MITSUBISHI_AC)
// Brand: Mitsubishi Electric, Model: MSZ-SF25VE3 A/C (MITSUBISHI_AC)
// Brand: Mitsubishi Electric, Model: SG15D remote (MITSUBISHI_AC)

#ifndef IR_MITSUBISHI_H_
#define IR_MITSUBISHI_H_
Expand Down Expand Up @@ -94,6 +96,7 @@ const uint8_t kMitsubishiAcAuto = 0b100;
const uint8_t kMitsubishiAcCool = 0b011;
const uint8_t kMitsubishiAcDry = 0b010;
const uint8_t kMitsubishiAcHeat = 0b001;
const uint8_t kMitsubishiAcFan = 0b111;
const uint8_t kMitsubishiAcFanAuto = 0;
const uint8_t kMitsubishiAcFanMax = 5;
const uint8_t kMitsubishiAcFanRealMax = 4;
Expand Down

0 comments on commit 2f0583e

Please sign in to comment.