Toshiba Daiseikai added, based on Carrier NQV.

This commit is contained in:
Bill Seremetis 2016-12-12 03:42:06 +02:00
parent 3d90bfb2bd
commit ca26d28ca6
6 changed files with 325 additions and 1 deletions

View File

@ -19,6 +19,15 @@ CarrierNQVHeatpumpIR::CarrierNQVHeatpumpIR() : CarrierHeatpumpIR()
_info = info;
}
DaiseikaiHeatpumpIR::DaiseikaiHeatpumpIR() : CarrierHeatpumpIR()
{
static const char PROGMEM model[] PROGMEM = "carrier_nqv";
static const char PROGMEM info[] PROGMEM = "{\"mdl\":\"carrier_nqv\",\"dn\":\"Carrier NQV\",\"mT\":17,\"xT\":30,\"fs\":6}";
_model = model;
_info = info;
}
CarrierMCAHeatpumpIR::CarrierMCAHeatpumpIR() : CarrierHeatpumpIR()
{
static const char PROGMEM model[] PROGMEM = "carrier_mca";
@ -297,3 +306,162 @@ void CarrierMCAHeatpumpIR::sendCarrier(IRSender& IR, uint8_t powerMode, uint8_t
IR.mark(CARRIER_AIRCON2_BIT_MARK);
IR.space(0);
}
void DaiseikaiHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd)
{
(void)swingVCmd;
(void)swingHCmd;
// Sensible defaults for the heat pump mode
uint8_t operatingMode = DAISEIKAI_AIRCON1_MODE_HEAT;
uint8_t fanSpeed = DAISEIKAI_AIRCON1_FAN_AUTO;
uint8_t temperature = 23;
if (powerModeCmd == POWER_OFF)
{
operatingMode = DAISEIKAI_AIRCON1_MODE_OFF;
}
else
{
switch (operatingModeCmd)
{
case MODE_AUTO:
operatingMode = DAISEIKAI_AIRCON1_MODE_AUTO;
break;
case MODE_HEAT:
operatingMode = DAISEIKAI_AIRCON1_MODE_HEAT;
break;
case MODE_COOL:
operatingMode = DAISEIKAI_AIRCON1_MODE_COOL;
break;
case MODE_DRY:
operatingMode = DAISEIKAI_AIRCON1_MODE_DRY;
fanSpeedCmd = FAN_AUTO; // Fan speed is always 'AUTO' in DRY mode
break;
case MODE_FAN:
operatingMode = DAISEIKAI_AIRCON1_MODE_FAN;
temperatureCmd = 22; // Temperature is always 22 in FAN mode
break;
}
}
switch (fanSpeedCmd)
{
case FAN_AUTO:
fanSpeed = DAISEIKAI_AIRCON1_FAN_AUTO;
break;
case FAN_1:
fanSpeed = DAISEIKAI_AIRCON1_FAN1;
break;
case FAN_2:
fanSpeed = DAISEIKAI_AIRCON1_FAN2;
break;
case FAN_3:
fanSpeed = DAISEIKAI_AIRCON1_FAN3;
break;
case FAN_4:
fanSpeed = DAISEIKAI_AIRCON1_FAN4;
break;
case FAN_5:
fanSpeed = DAISEIKAI_AIRCON1_FAN5;
break;
}
if (temperatureCmd > 16 && temperatureCmd < 31)
{
temperature = temperatureCmd;
}
sendCarrier(IR, operatingMode, fanSpeed, temperature);
}
// Send the Carrier code
// Carrier has the LSB and MSB in different format than Panasonic
void DaiseikaiHeatpumpIR::sendCarrier(IRSender& IR, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature)
{
uint8_t sendBuffer[] = { 0x4f, 0xb0, 0xc0, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00 }; // The data is on the last four bytes
static const uint8_t temperatures[] PROGMEM = { 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e, 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b };
uint8_t checksum = 0;
// PROGMEM arrays cannot be addressed directly, see http://forum.arduino.cc/index.php?topic=106603.0
sendBuffer[5] = pgm_read_byte(&(temperatures[(temperature-17)]));
sendBuffer[6] = operatingMode | fanSpeed;
// Checksum
for (int i=0; i<8; i++) {
checksum += IR.bitReverse(sendBuffer[i]);
}
// There's something really strange with the checksum calculation...
// With these many of the codes matchs with the code from the real Carrier remote
// Still certain temperatures do not work with fan speeds 1, 2 or 5
switch (sendBuffer[6] & 0xF0) {
case 0x00: // MODE_AUTO - certain temperature / fan speed combinations do not work
checksum += 0x02;
switch (sendBuffer[6] & 0x0F) {
case 0x02: // FAN1
case 0x03: // FAN5
case 0x06: // FAN2
checksum += 0x80;
break;
}
break;
case 0x40: // MODE_DRY - all settings should work
checksum += 0x02;
break;
case 0xC0: // MODE_HEAT - certain temperature / fan speed combinations do not work
switch (sendBuffer[6] & 0x0F) {
case 0x05: // FAN4
case 0x06: // FAN2
checksum += 0xC0;
break;
}
break;
case 0x20: // MODE_FAN - all settings should work
checksum += 0x02;
switch (sendBuffer[6] & 0x0F) {
case 0x02: // FAN1
case 0x03: // FAN5
case 0x06: // FAN2
checksum += 0x80;
break;
}
break;
}
sendBuffer[8] = IR.bitReverse(checksum);
// 38 kHz PWM frequency
IR.setFrequency(38);
// Header
IR.mark(DAISEIKAI_AIRCON1_HDR_MARK);
IR.space(DAISEIKAI_AIRCON1_HDR_SPACE);
// Payload
for (size_t i=0; i<sizeof(sendBuffer); i++) {
IR.sendIRbyte(sendBuffer[i], DAISEIKAI_AIRCON1_BIT_MARK, DAISEIKAI_AIRCON1_ZERO_SPACE, DAISEIKAI_AIRCON1_ONE_SPACE);
}
// Pause + new header
IR.mark(DAISEIKAI_AIRCON1_BIT_MARK);
IR.space(DAISEIKAI_AIRCON1_MSG_SPACE);
IR.mark(DAISEIKAI_AIRCON1_HDR_MARK);
IR.space(DAISEIKAI_AIRCON1_HDR_SPACE);
// Payload again
for (size_t i=0; i<sizeof(sendBuffer); i++) {
IR.sendIRbyte(sendBuffer[i], DAISEIKAI_AIRCON1_BIT_MARK, DAISEIKAI_AIRCON1_ZERO_SPACE, DAISEIKAI_AIRCON1_ONE_SPACE);
}
// End mark
IR.mark(DAISEIKAI_AIRCON1_BIT_MARK);
IR.space(0);
}

View File

@ -29,6 +29,29 @@
#define CARRIER_AIRCON1_FAN4 0x05
#define CARRIER_AIRCON1_FAN5 0x03
// Toshiba Daiseikai (RAS-10G2KVP-E RAS-10G2AVP-E and RAS-13G2KVP-E RAS-13G2AVP-E) timing constants (remote control P/N WH-TA01EE)
// https://github.com/ToniA/arduino-heatpumpir/issues/23
#define DAISEIKAI_AIRCON1_HDR_MARK 4320
#define DAISEIKAI_AIRCON1_HDR_SPACE 4350
#define DAISEIKAI_AIRCON1_BIT_MARK 500
#define DAISEIKAI_AIRCON1_ONE_SPACE 1650
#define DAISEIKAI_AIRCON1_ZERO_SPACE 550
#define DAISEIKAI_AIRCON1_MSG_SPACE 7400
// Toshiba Daiseikai (Carrier) codes. Same as CarrierNQV ?
#define DAISEIKAI_AIRCON1_MODE_AUTO 0x00 // Operating mode
#define DAISEIKAI_AIRCON1_MODE_HEAT 0xC0
#define DAISEIKAI_AIRCON1_MODE_COOL 0x80
#define DAISEIKAI_AIRCON1_MODE_DRY 0x40
#define DAISEIKAI_AIRCON1_MODE_FAN 0x20
#define DAISEIKAI_AIRCON1_MODE_OFF 0xE0 // Power OFF
#define DAISEIKAI_AIRCON1_FAN_AUTO 0x00 // Fan speed
#define DAISEIKAI_AIRCON1_FAN1 0x02
#define DAISEIKAI_AIRCON1_FAN2 0x06
#define DAISEIKAI_AIRCON1_FAN3 0x01
#define DAISEIKAI_AIRCON1_FAN4 0x05
#define DAISEIKAI_AIRCON1_FAN5 0x03
// Carrier (42MCA009515LS) timing constants (remote control P/N R11CG/E)
#define CARRIER_AIRCON2_HDR_MARK 4510
@ -85,4 +108,17 @@ class CarrierMCAHeatpumpIR : public CarrierHeatpumpIR
void sendCarrier(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature);
};
class DaiseikaiHeatpumpIR : public CarrierHeatpumpIR
{
public:
DaiseikaiHeatpumpIR();
public:
void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd);
private:
void sendCarrier(IRSender& IR, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature);
};
#endif

View File

@ -11,6 +11,9 @@ Currently supports at least these models
* Also other Midea models sold as 'Ultimate', even some inverter models
* Also Onnline (sold through Onninen) has been reported to work
* Carrier 42NQV035G / 38NYV035H2 (Carrier remote control P/N WH-L05SE)
* Toshiba Daiseikai (Toshiba remote control P/N WH-TA01EE).
* Fully compatible with CarrierNQV functions instead of Daiseikai functions.
* Tested with: RAS-10G2KVP-E RAS-10G2AVP-E and RAS-13G2KVP-E RAS-13G2AVP-E
* Fujitsu Nocria AWYZ14 (remote control P/N AR-PZ2)
* Mitsubishi MSZ FD-25, probably also FD-35 (remote control P/N KM09D 0052376)
* Hisense AUD (remote control Y-H1-01, Y-H1-02(E), Y-J1, Y-E4-07) probably AUC model

View File

@ -0,0 +1,58 @@
#include <Arduino.h>
#include <CarrierHeatpumpIR.h>
IRSenderPWM irSender(9); // IR led on Duemilanove digital pin 3, using Arduino PWM
//IRSenderBlaster irSender(3); // IR led on Duemilanove digital pin 3, using IR Blaster (generates the 38 kHz carrier)
CarrierNQVHeatpumpIR *heatpumpIR;
int redLED = 6;
int orangeLED = 5;
int greenLED = 4;
int blueLED = 3;
void setup()
{
Serial.begin(9600);
pinMode(redLED, OUTPUT);
pinMode(orangeLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(blueLED, OUTPUT);
delay(500);
heatpumpIR = new CarrierNQVHeatpumpIR();
Serial.println(F("Starting"));
}
void loop()
{
const char* buf;
Serial.print(F("Sending IR to "));
// Print the model
buf = heatpumpIR->model();
// 'model' is a PROGMEM pointer, so need to write a byte at a time
while (char modelChar = pgm_read_byte(buf++))
{
Serial.print(modelChar);
}
Serial.print(F(", info: "));
// Print the info
buf = heatpumpIR->info();
// 'info' is a PROGMEM pointer, so need to write a byte at a time
while (char infoChar = pgm_read_byte(buf++))
{
Serial.print(infoChar);
}
Serial.println();
digitalWrite(orangeLED,HIGH);
delay(4000);
heatpumpIR->send(irSender, POWER_ON, MODE_HEAT, FAN_AUTO, 24, VDIR_AUTO, HDIR_AUTO);
digitalWrite(orangeLED,LOW);
digitalWrite(redLED, HIGH);
// don't loop()
for(;;)
;
}

View File

@ -0,0 +1,58 @@
#include <Arduino.h>
#include <CarrierHeatpumpIR.h>
IRSenderPWM irSender(9); // IR led on Duemilanove digital pin 3, using Arduino PWM
//IRSenderBlaster irSender(3); // IR led on Duemilanove digital pin 3, using IR Blaster (generates the 38 kHz carrier)
DaiseikaiHeatpumpIR *heatpumpIR;
int redLED = 6;
int orangeLED = 5;
int greenLED = 4;
int blueLED = 3;
void setup()
{
Serial.begin(9600);
pinMode(redLED, OUTPUT);
pinMode(orangeLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(blueLED, OUTPUT);
delay(500);
heatpumpIR = new DaiseikaiHeatpumpIR();
Serial.println(F("Starting"));
}
void loop()
{
const char* buf;
Serial.print(F("Sending IR to "));
// Print the model
buf = heatpumpIR->model();
// 'model' is a PROGMEM pointer, so need to write a byte at a time
while (char modelChar = pgm_read_byte(buf++))
{
Serial.print(modelChar);
}
Serial.print(F(", info: "));
// Print the info
buf = heatpumpIR->info();
// 'info' is a PROGMEM pointer, so need to write a byte at a time
while (char infoChar = pgm_read_byte(buf++))
{
Serial.print(infoChar);
}
Serial.println();
digitalWrite(orangeLED,HIGH);
delay(4000);
heatpumpIR->send(irSender, POWER_ON, MODE_AUTO, FAN_AUTO, 24, VDIR_AUTO, HDIR_AUTO);
digitalWrite(orangeLED,LOW);
digitalWrite(redLED, HIGH);
// don't loop()
for(;;)
;
}

View File

@ -7,6 +7,7 @@ PanasonicNKEHeatpumpIR KEYWORD1
PanasonicLKEHeatpumpIR KEYWORD1
CarrierHeatpumpIR KEYWORD1
CarrierNQVHeatpumpIR KEYWORD1
DaiseikaiHeatpumpIR KEYWORD1
CarrierMCAHeatpumpIR KEYWORD1
MideaHeatpumpIR KEYWORD1
FujitsuHeatpumpIR KEYWORD1
@ -41,4 +42,4 @@ send KEYWORD2
model KEYWORD2
info KEYWORD2
sendPanasonicCKPCancelTimer KEYWORD2
sendPanasonicCKPCancelTimer KEYWORD2