diff --git a/IVTHeatpumpIR.cpp b/IVTHeatpumpIR.cpp new file mode 100644 index 0000000..1b90fcc --- /dev/null +++ b/IVTHeatpumpIR.cpp @@ -0,0 +1,18 @@ +#include + + +IVTHeatpumpIR::IVTHeatpumpIR() : SharpHeatpumpIR() +{ + static const char PROGMEM model[] PROGMEM = "ivt"; + static const char PROGMEM info[] PROGMEM = "{\"mdl\":\"ivt\",\"dn\":\"IVT AY-XP12FR-N\",\"mT\":18,\"xT\":32,\"fs\":3,\"maint\":[10]}}"; + + _model = model; + _info = info; +} + +void IVTHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd) +{ + _sharpModel = MODEL_IVT; + + SharpHeatpumpIR::send(IR, powerModeCmd, operatingModeCmd, fanSpeedCmd, temperatureCmd, swingVCmd, swingHCmd); +} diff --git a/IVTHeatpumpIR.h b/IVTHeatpumpIR.h new file mode 100644 index 0000000..0ea2dc2 --- /dev/null +++ b/IVTHeatpumpIR.h @@ -0,0 +1,20 @@ +/* + IVT heatpump control for IVT AY-XP12FR-N, remote control CRMC-A673JBEZ (almost the same as Sharp) + + Also see: https://github.com/skarlsso/IRRemoteIVT/blob/master/IRRemoteIVT +*/ +#ifndef IVTHeatpumpIR_h +#define IVTHeatpumpIR_h + +#include +#include + + +class IVTHeatpumpIR : public SharpHeatpumpIR +{ + public: + IVTHeatpumpIR(); + void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd); +}; + +#endif diff --git a/SharpHeatpumpIR.cpp b/SharpHeatpumpIR.cpp index 2ff656a..bd42d26 100644 --- a/SharpHeatpumpIR.cpp +++ b/SharpHeatpumpIR.cpp @@ -8,6 +8,8 @@ SharpHeatpumpIR::SharpHeatpumpIR() : HeatpumpIR() _model = model; _info = info; + + _sharpModel = MODEL_SHARP; } @@ -18,7 +20,7 @@ void SharpHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operating // Sensible defaults for the heat pump mode - uint8_t powerMode = SHARP_AIRCON1_MODE_ON; + uint8_t powerMode = _sharpModel == MODEL_SHARP ? SHARP_AIRCON1_MODE_ON : SHARP_AIRCON2_MODE_ON; uint8_t operatingMode = SHARP_AIRCON1_MODE_HEAT; uint8_t fanSpeed = SHARP_AIRCON1_FAN_AUTO; uint8_t temperature = 23; diff --git a/SharpHeatpumpIR.h b/SharpHeatpumpIR.h index 6fb02bd..1f3fbe7 100644 --- a/SharpHeatpumpIR.h +++ b/SharpHeatpumpIR.h @@ -1,14 +1,15 @@ /* Sharp AY-ZP40KR heatpump control (remote control P/N CRMC-A788JBEZ) - Probably also works on IVT (as those are Sharp units with different branding) - Also see: https://github.com/skarlsso/IRRemoteIVT/blob/master/IRRemoteIVT.ino + Also see: https://github.com/skarlsso/IRRemoteIVT/blob/master/IRRemoteIVT */ #ifndef SharpHeatpumpIR_h #define SharpHeatpumpIR_h #include +#define MODEL_SHARP 0 +#define MODEL_IVT 1 // Sharp timing constants #define SHARP_AIRCON1_HDR_MARK 3540 // 3820 @@ -28,6 +29,9 @@ #define SHARP_AIRCON1_FAN2 0x50 #define SHARP_AIRCON1_FAN3 0x70 +// IVT codes +#define SHARP_AIRCON2_MODE_ON 0x11 // Power ON + class SharpHeatpumpIR : public HeatpumpIR { @@ -35,8 +39,9 @@ class SharpHeatpumpIR : public HeatpumpIR SharpHeatpumpIR(); void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd); - private: + protected: void sendSharp(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature); + uint8_t _sharpModel; // Tells whether this is Sharp or IVT }; #endif diff --git a/keywords.txt b/keywords.txt index 4d6bf60..4b116ae 100644 --- a/keywords.txt +++ b/keywords.txt @@ -26,6 +26,7 @@ HisenseHeatpumpIR KEYWORD1 GreeHeatpumpIR KEYWORD1 FuegoHeatpumpIR KEYWORD1 ToshibaHeatpumpIR KEYWORD1 +IVTHeatpumpIR KEYWORD1 IRSender KEYWORD1 IRSenderPWM KEYWORD1