diff --git a/GreeHeatpumpIR.cpp b/GreeHeatpumpIR.cpp index 7fa3bf4..5e6f0eb 100644 --- a/GreeHeatpumpIR.cpp +++ b/GreeHeatpumpIR.cpp @@ -37,7 +37,7 @@ GreeYAAHeatpumpIR::GreeYAAHeatpumpIR() : GreeHeatpumpIR() } // Support for YAC1FBF remote -GreeYACHeatpumpIR::GreeYACHeatpumpIR() : GreeHeatpumpIR() +GreeYACHeatpumpIR::GreeYACHeatpumpIR() : GreeiFeelHeatpumpIR() { static const char model[] PROGMEM = "greeyac"; static const char info[] PROGMEM = "{\"mdl\":\"greeyac\",\"dn\":\"Gree YAC\",\"mT\":16,\"xT\":30,\"fs\":3}"; @@ -47,6 +47,17 @@ GreeYACHeatpumpIR::GreeYACHeatpumpIR() : GreeHeatpumpIR() greeModel = GREE_YAC; } +// Support for YT1F remote +GreeYTHeatpumpIR::GreeYTHeatpumpIR() : GreeiFeelHeatpumpIR() +{ + static const char model[] PROGMEM = "greeyt"; + static const char info[] PROGMEM = "{\"mdl\":\"greeyt\",\"dn\":\"Gree YT\",\"mT\":16,\"xT\":30,\"fs\":3}"; + + _model = model; + _info = info; + greeModel = GREE_YT; +} + void GreeHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd) { send(IR, powerModeCmd, operatingModeCmd, fanSpeedCmd, temperatureCmd, swingVCmd, swingHCmd, false); @@ -143,7 +154,7 @@ void GreeHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingM } } - if (greeModel == GREE_YAA || greeModel == GREE_YAC) + if (greeModel == GREE_YAA || greeModel == GREE_YAC || greeModel == GREE_YT) { switch (swingVCmd) { @@ -211,11 +222,15 @@ void GreeHeatpumpIR::sendGree(IRSender& IR, uint8_t powerMode, uint8_t operating { (void)swingH; - uint8_t GreeTemplate[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 }; + uint8_t GreeTemplate[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // 0 1 2 3 4 5 6 7 uint8_t i; + if (greeModel != GREE_YT) { + GreeTemplate[5] = 0x20; + } + // Set the Fan speed, operating mode and power state GreeTemplate[0] = fanSpeed | operatingMode | powerMode; // Set the temperature @@ -230,18 +245,26 @@ void GreeHeatpumpIR::sendGree(IRSender& IR, uint8_t powerMode, uint8_t operating } if (greeModel == GREE_YAC) { - GreeTemplate[4] |= (swingH << 4); + GreeTemplate[4] |= (swingH << 4); // GREE_YT will ignore packets where this is set + } + if (greeModel == GREE_YAC || greeModel == GREE_YT) + { if (iFeelMode) { GreeTemplate[5] |= GREE_IFEEL_BIT; } } - if (greeModel == GREE_YAA || greeModel == GREE_YAC) + if (greeModel == GREE_YAA || greeModel == GREE_YAC || greeModel == GREE_YT) { GreeTemplate[2] = GREE_LIGHT_BIT; // bits 0..3 always 0000, bits 4..7 TURBO,LIGHT,HEALTH,X-FAN GreeTemplate[3] = 0x50; // bits 4..7 always 0101 - GreeTemplate[6] = 0x20; // YAA1FB, FAA1FB1, YB1F2 bits 4..7 always 0010 + if (greeModel != GREE_YT) { + GreeTemplate[6] = 0x20; // YAA1FB, FAA1FB1, YB1F2 bits 4..7 always 0010 + } + if (greeModel == GREE_YT) { + GreeTemplate[2] |= (1 << 6); // HEALTH is always on for GREE_YT + } if (turboMode) { GreeTemplate[2] |= GREE_TURBO_BIT; @@ -311,7 +334,7 @@ void GreeHeatpumpIR::sendGree(IRSender& IR, uint8_t powerMode, uint8_t operating } // Sends current sensed temperatures, YAC remotes/supporting units only -void GreeYACHeatpumpIR::send(IRSender& IR, uint8_t currentTemperature) +void GreeiFeelHeatpumpIR::send(IRSender& IR, uint8_t currentTemperature) { uint8_t GreeTemplate[] = { 0x00, 0x00 }; diff --git a/GreeHeatpumpIR.h b/GreeHeatpumpIR.h index 108a20b..f50b8cd 100644 --- a/GreeHeatpumpIR.h +++ b/GreeHeatpumpIR.h @@ -38,7 +38,7 @@ #define GREE_AIRCON1_FAN3 0x30 // * high #define GREE_AIRCON1_TURBO 0x80 // * turbo mode on YAN -// Only available on YAN +// Only available on YAN and YT // Vertical air directions. Note that these cannot be set on all heat pumps #define GREE_VDIR_AUTO 0x00 #define GREE_VDIR_MANUAL 0x00 @@ -62,7 +62,7 @@ #define GREE_IFEEL_BIT 0x08 -// Only available on YAA and YAC +// Only available on YAA, YAC, and YT // byte 0 #define GREE_VSWING (1 << 6) // byte 2 @@ -78,6 +78,7 @@ #define GREE_YAN 1 #define GREE_YAA 2 #define GREE_YAC 3 +#define GREE_YT 4 class GreeHeatpumpIR : public HeatpumpIR @@ -125,11 +126,8 @@ class GreeYAAHeatpumpIR : public GreeHeatpumpIR } }; -class GreeYACHeatpumpIR : public GreeHeatpumpIR +class GreeiFeelHeatpumpIR : public GreeHeatpumpIR { - public: - GreeYACHeatpumpIR(); - public: void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd, bool turboMode, bool iFeelMode) { @@ -138,4 +136,16 @@ class GreeYACHeatpumpIR : public GreeHeatpumpIR void send(IRSender& IR, uint8_t currentTemperature); }; +class GreeYACHeatpumpIR : public GreeiFeelHeatpumpIR +{ + public: + GreeYACHeatpumpIR(); +}; + +class GreeYTHeatpumpIR : public GreeiFeelHeatpumpIR +{ + public: + GreeYTHeatpumpIR(); +}; + #endif