# IRremoteESP8266: src/ir_Haier.h Source File

ir_Haier.h
Go to the documentation of this file.
// Copyright 2018 crankyoldgit
// Supports:
// Brand: Haier, Model: HSU07-HEA03 remote (HAIER_AC)
// Brand: Haier, Model: YR-W02 remote (HAIER_AC_YRW02)
// Brand: Haier, Model: HSU-09HMC203 A/C (HAIER_AC_YRW02)
#ifndef IR_HAIER_H_
#define IR_HAIER_H_
#ifndef UNIT_TEST
#include <Arduino.h>
#endif
#include "IRremoteESP8266.h"
#include "IRsend.h"
#ifdef UNIT_TEST
#include "IRsend_test.h"
#endif
union HaierProtocol{
uint8_t remote_state[kHaierACStateLength];
struct {
// Byte 0
uint8_t Prefix;
// Byte 1
uint8_t Command:4;
uint8_t Temp :4;
// Byte 2
uint8_t CurrHours:5;
uint8_t unknown :1; // value=1
uint8_t Swing :2;
// Byte 3
uint8_t CurrMins:6;
uint8_t OffTimer:1;
uint8_t OnTimer :1;
// Byte 4
uint8_t OffHours:5;
uint8_t Health :1;
uint8_t :0;
// Byte 5
uint8_t OffMins:6;
uint8_t Fan :2;
// Byte 6
uint8_t OnHours:5;
uint8_t Mode :3;
// Byte 7
uint8_t OnMins:6;
uint8_t Sleep :1;
uint8_t :0;
// Byte 8
uint8_t Sum;
};
};
// Constants
const uint8_t kHaierAcPrefix = 0b10100101;
const uint8_t kHaierAcMinTemp = 16;
const uint8_t kHaierAcDefTemp = 25;
const uint8_t kHaierAcMaxTemp = 30;
const uint8_t kHaierAcCmdOff = 0b0000;
const uint8_t kHaierAcCmdOn = 0b0001;
const uint8_t kHaierAcCmdMode = 0b0010;
const uint8_t kHaierAcCmdFan = 0b0011;
const uint8_t kHaierAcCmdTempUp = 0b0110;
const uint8_t kHaierAcCmdTempDown = 0b0111;
const uint8_t kHaierAcCmdSleep = 0b1000;
const uint8_t kHaierAcCmdTimerSet = 0b1001;
const uint8_t kHaierAcCmdTimerCancel = 0b1010;
const uint8_t kHaierAcCmdHealth = 0b1100;
const uint8_t kHaierAcCmdSwing = 0b1101;
const uint8_t kHaierAcSwingOff = 0b00;
const uint8_t kHaierAcSwingUp = 0b01;
const uint8_t kHaierAcSwingDown = 0b10;
const uint8_t kHaierAcSwingChg = 0b11;
const uint8_t kHaierAcAuto = 0;
const uint8_t kHaierAcCool = 1;
const uint8_t kHaierAcDry = 2;
const uint8_t kHaierAcHeat = 3;
const uint8_t kHaierAcFan = 4;
const uint8_t kHaierAcFanAuto = 0;
const uint8_t kHaierAcFanLow = 1;
const uint8_t kHaierAcFanMed = 2;
const uint8_t kHaierAcFanHigh = 3;
const uint16_t kHaierAcMaxTime = (23 * 60) + 59;
const uint8_t kHaierAcSleepBit = 0b01000000;
// Legacy Haier AC defines.
#define HAIER_AC_MIN_TEMP kHaierAcMinTemp
#define HAIER_AC_DEF_TEMP kHaierAcDefTemp
#define HAIER_AC_MAX_TEMP kHaierAcMaxTemp
#define HAIER_AC_CMD_OFF kHaierAcCmdOff
#define HAIER_AC_CMD_ON kHaierAcCmdOn
#define HAIER_AC_CMD_MODE kHaierAcCmdMode
#define HAIER_AC_CMD_FAN kHaierAcCmdFan
#define HAIER_AC_CMD_TEMP_UP kHaierAcCmdTempUp
#define HAIER_AC_CMD_TEMP_DOWN kHaierAcCmdTempDown
#define HAIER_AC_CMD_SLEEP kHaierAcCmdSleep
#define HAIER_AC_CMD_TIMER_SET kHaierAcCmdTimerSet
#define HAIER_AC_CMD_TIMER_CANCEL kHaierAcCmdTimerCancel
#define HAIER_AC_CMD_HEALTH kHaierAcCmdHealth
#define HAIER_AC_CMD_SWING kHaierAcCmdSwing
#define HAIER_AC_SWING_OFF kHaierAcSwingOff
#define HAIER_AC_SWING_UP kHaierAcSwingUp
#define HAIER_AC_SWING_DOWN kHaierAcSwingDown
#define HAIER_AC_SWING_CHG kHaierAcSwingChg
#define HAIER_AC_AUTO kHaierAcAuto
#define HAIER_AC_COOL kHaierAcCool
#define HAIER_AC_DRY kHaierAcDry
#define HAIER_AC_HEAT kHaierAcHeat
#define HAIER_AC_FAN kHaierAcFan
#define HAIER_AC_FAN_AUTO kHaierAcFanAuto
#define HAIER_AC_FAN_LOW kHaierAcFanLow
#define HAIER_AC_FAN_MED kHaierAcFanMed
#define HAIER_AC_FAN_HIGH kHaierAcFanHigh
union HaierYRW02Protocol{
uint8_t raw[kHaierACYRW02StateLength];
struct {
// Byte 0
uint8_t Prefix;
// Byte 1
uint8_t Swing:4;
uint8_t Temp :4; // 16C~30C
// Byte 2
uint8_t :8;
// Byte 3
uint8_t :1;
uint8_t Health:1;
uint8_t :6;
// Byte 4
uint8_t :6;
uint8_t Power:1;
uint8_t :1;
// Byte 5
uint8_t :5;
uint8_t Fan:3;
// Byte 6
uint8_t :6;
uint8_t Turbo:2;
// Byte 7
uint8_t :5;
uint8_t Mode:3;
// Byte 8
uint8_t :7;
uint8_t Sleep:1;
// Byte 9
uint8_t :8;
// Byte 10
uint8_t :8;
// Byte 11
uint8_t :8;
// Byte 12
uint8_t Button:4;
uint8_t :4;
// Byte 13
uint8_t Sum;
};
};
const uint8_t kHaierAcYrw02Prefix = 0xA6;
const uint8_t kHaierAcYrw02SwingOff = 0x0;
const uint8_t kHaierAcYrw02SwingTop = 0x1;
const uint8_t kHaierAcYrw02SwingMiddle = 0x2; // Not available in heat mode.
const uint8_t kHaierAcYrw02SwingBottom = 0x3; // Only available in heat mode.
const uint8_t kHaierAcYrw02SwingDown = 0xA;
const uint8_t kHaierAcYrw02SwingAuto = 0xC; // Airflow
const uint8_t kHaierAcYrw02FanHigh = 0b001;
const uint8_t kHaierAcYrw02FanMed = 0b010;
const uint8_t kHaierAcYrw02FanLow = 0b011;
const uint8_t kHaierAcYrw02FanAuto = 0b101;
const uint8_t kHaierAcYrw02TurboOff = 0x0;
const uint8_t kHaierAcYrw02TurboHigh = 0x1;
const uint8_t kHaierAcYrw02TurboLow = 0x2;
const uint8_t kHaierAcYrw02Auto = 0b000; // 0
const uint8_t kHaierAcYrw02Cool = 0b001; // 1
const uint8_t kHaierAcYrw02Dry = 0b010; // 2
const uint8_t kHaierAcYrw02Heat = 0b100; // 4
const uint8_t kHaierAcYrw02Fan = 0b110; // 5
const uint8_t kHaierAcYrw02ButtonTempUp = 0x0;
const uint8_t kHaierAcYrw02ButtonTempDown = 0x1;
const uint8_t kHaierAcYrw02ButtonSwing = 0x2;
const uint8_t kHaierAcYrw02ButtonFan = 0x4;
const uint8_t kHaierAcYrw02ButtonPower = 0x5;
const uint8_t kHaierAcYrw02ButtonMode = 0x6;
const uint8_t kHaierAcYrw02ButtonHealth = 0x7;
const uint8_t kHaierAcYrw02ButtonTurbo = 0x8;
const uint8_t kHaierAcYrw02ButtonSleep = 0xB;
// Legacy Haier YRW02 remote defines.
#define HAIER_AC_YRW02_SWING_OFF kHaierAcYrw02SwingOff
#define HAIER_AC_YRW02_SWING_TOP kHaierAcYrw02SwingTop
#define HAIER_AC_YRW02_SWING_MIDDLE kHaierAcYrw02SwingMiddle
#define HAIER_AC_YRW02_SWING_BOTTOM kHaierAcYrw02SwingBottom
#define HAIER_AC_YRW02_SWING_DOWN kHaierAcYrw02SwingDown
#define HAIER_AC_YRW02_SWING_AUTO kHaierAcYrw02SwingAuto
#define HAIER_AC_YRW02_FAN_HIGH kHaierAcYrw02FanHigh
#define HAIER_AC_YRW02_FAN_MED kHaierAcYrw02FanMed
#define HAIER_AC_YRW02_FAN_LOW kHaierAcYrw02FanLow
#define HAIER_AC_YRW02_FAN_AUTO kHaierAcYrw02FanAuto
#define HAIER_AC_YRW02_TURBO_OFF kHaierAcYrw02TurboOff
#define HAIER_AC_YRW02_TURBO_HIGH kHaierAcYrw02TurboHigh
#define HAIER_AC_YRW02_TURBO_LOW kHaierAcYrw02TurboLow
#define HAIER_AC_YRW02_AUTO kHaierAcYrw02Auto
#define HAIER_AC_YRW02_COOL kHaierAcYrw02Cool
#define HAIER_AC_YRW02_DRY kHaierAcYrw02Dry
#define HAIER_AC_YRW02_HEAT kHaierAcYrw02Heat
#define HAIER_AC_YRW02_FAN kHaierAcYrw02Fan
#define HAIER_AC_YRW02_BUTTON_TEMP_UP kHaierAcYrw02ButtonTempUp
#define HAIER_AC_YRW02_BUTTON_TEMP_DOWN kHaierAcYrw02ButtonTempDown
#define HAIER_AC_YRW02_BUTTON_SWING kHaierAcYrw02ButtonSwing
#define HAIER_AC_YRW02_BUTTON_FAN kHaierAcYrw02ButtonFan
#define HAIER_AC_YRW02_BUTTON_POWER kHaierAcYrw02ButtonPower
#define HAIER_AC_YRW02_BUTTON_MODE kHaierAcYrw02ButtonMode
#define HAIER_AC_YRW02_BUTTON_HEALTH kHaierAcYrw02ButtonHealth
#define HAIER_AC_YRW02_BUTTON_TURBO kHaierAcYrw02ButtonTurbo
#define HAIER_AC_YRW02_BUTTON_SLEEP kHaierAcYrw02ButtonSleep
// Classes
class IRHaierAC {
public:
explicit IRHaierAC(const uint16_t pin, const bool inverted = false,
const bool use_modulation = true);
#if SEND_HAIER_AC
void send(const uint16_t repeat = kHaierAcDefaultRepeat);
int8_t calibrate(void) { return _irsend.calibrate(); }
#endif // SEND_HAIER_AC
void begin(void);
void setCommand(const uint8_t command);
uint8_t getCommand(void) const;
void setTemp(const uint8_t temp);
uint8_t getTemp(void) const;
void setFan(const uint8_t speed);
uint8_t getFan(void) const;
uint8_t getMode(void) const;
void setMode(const uint8_t mode);
bool getSleep(void) const;
void setSleep(const bool on);
bool getHealth(void) const;
void setHealth(const bool on);
int16_t getOnTimer(void) const;
void setOnTimer(const uint16_t mins);
int16_t getOffTimer(void) const;
void setOffTimer(const uint16_t mins);
void cancelTimers(void);
uint16_t getCurrTime(void) const;
void setCurrTime(const uint16_t mins);
uint8_t getSwing(void) const;
void setSwing(const uint8_t state);
uint8_t* getRaw(void);
void setRaw(const uint8_t new_code[]);
static bool validChecksum(uint8_t state[],
const uint16_t length = kHaierACStateLength);
static uint8_t convertMode(const stdAc::opmode_t mode);
static uint8_t convertFan(const stdAc::fanspeed_t speed);
static uint8_t convertSwingV(const stdAc::swingv_t position);
static stdAc::opmode_t toCommonMode(const uint8_t mode);
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
stdAc::state_t toCommon(void) const;
String toString(void) const;
#ifndef UNIT_TEST
private:
IRsend _irsend;
#else // UNIT_TEST
IRsendTest _irsend;
#endif
HaierProtocol _;
void stateReset(void);
void checksum(void);
};
class IRHaierACYRW02 {
public:
explicit IRHaierACYRW02(const uint16_t pin, const bool inverted = false,
const bool use_modulation = true);
#if SEND_HAIER_AC_YRW02
void send(const uint16_t repeat = kHaierAcYrw02DefaultRepeat);
int8_t calibrate(void) { return _irsend.calibrate(); }
#endif // SEND_HAIER_AC_YRW02
void begin(void);
void setButton(const uint8_t button);
uint8_t getButton(void) const;
void setTemp(const uint8_t temp);
uint8_t getTemp(void) const;
void setFan(const uint8_t speed);
uint8_t getFan(void) const;
uint8_t getMode(void) const;
void setMode(const uint8_t mode);
bool getPower(void) const;
void setPower(const bool on);
void on(void);
void off(void);
bool getSleep(void) const;
void setSleep(const bool on);
bool getHealth(void) const;
void setHealth(const bool on);
uint8_t getTurbo(void) const;
void setTurbo(const uint8_t speed);
uint8_t getSwing(void) const;
void setSwing(const uint8_t pos);
uint8_t* getRaw(void);
void setRaw(const uint8_t new_code[]);
static bool validChecksum(uint8_t state[],
const uint16_t length = kHaierACYRW02StateLength);
static uint8_t convertMode(const stdAc::opmode_t mode);
static uint8_t convertFan(const stdAc::fanspeed_t speed);
static uint8_t convertSwingV(const stdAc::swingv_t position);
static stdAc::opmode_t toCommonMode(const uint8_t mode);
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
stdAc::state_t toCommon(void) const;
String toString(void) const;
#ifndef UNIT_TEST
private:
IRsend _irsend;
#else // UNIT_TEST
IRsendTest _irsend;
#endif // UNIT_TEST
HaierYRW02Protocol _;
void stateReset(void);
void checksum(void);
};
#endif // IR_HAIER_H_
IRHaierACYRW02::toString
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Haier.cpp:871
kHaierAcCmdFan
const uint8_t kHaierAcCmdFan
Definition: ir_Haier.h:76
kHaierAcFanHigh
const uint8_t kHaierAcFanHigh
Definition: ir_Haier.h:99
IRHaierACYRW02::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Haier.cpp:532
kHaierAcYrw02DefaultRepeat
const uint16_t kHaierAcYrw02DefaultRepeat
Definition: IRremoteESP8266.h:960
IRHaierACYRW02::getTemp
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Haier.cpp:646
IRHaierACYRW02::setPower
void setPower(const bool on)
Change the power setting.
Definition: ir_Haier.cpp:671
IRHaierAC::getOffTimer
int16_t getOffTimer(void) const
Get the Off Timer value/setting of the A/C.
Definition: ir_Haier.cpp:267
HaierYRW02Protocol
Native representation of a Haier YRW02 A/C message.
Definition: ir_Haier.h:135
IRHaierAC::getMode
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Haier.cpp:201
IRHaierACYRW02::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Haier.cpp:820
kHaierAcYrw02Fan
const uint8_t kHaierAcYrw02Fan
Definition: ir_Haier.h:201
kHaierAcDefaultRepeat
const uint16_t kHaierAcDefaultRepeat
Definition: IRremoteESP8266.h:957
kHaierAcYrw02FanMed
const uint8_t kHaierAcYrw02FanMed
Definition: ir_Haier.h:189
kHaierAcSwingChg
const uint8_t kHaierAcSwingChg
Definition: ir_Haier.h:88
IRHaierAC::setSwing
void setSwing(const uint8_t state)
Set the Vertical Swing mode of the A/C.
Definition: ir_Haier.cpp:318
HaierYRW02Protocol::Temp
uint8_t Temp
Definition: ir_Haier.h:142
kHaierAcAuto
const uint8_t kHaierAcAuto
Definition: ir_Haier.h:90
kHaierAcYrw02ButtonTurbo
const uint8_t kHaierAcYrw02ButtonTurbo
Definition: ir_Haier.h:210
IRHaierACYRW02::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Haier.h:324
stdAc::swingv_t
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:70
IRHaierACYRW02::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Haier.h:371
kHaierACStateLength
const uint16_t kHaierACStateLength
Definition: IRremoteESP8266.h:955
kHaierAcCmdTempDown
const uint8_t kHaierAcCmdTempDown
Definition: ir_Haier.h:78
IRHaierAC::setRaw
void setRaw(const uint8_t new_code[])
Set the internal state from a valid code for this protocol.
Definition: ir_Haier.cpp:133
IRHaierAC::stateReset
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Haier.cpp:114
HaierProtocol::Swing
uint8_t Swing
Definition: ir_Haier.h:42
IRHaierACYRW02::getHealth
bool getHealth(void) const
Get the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:659
kHaierAcCmdMode
const uint8_t kHaierAcCmdMode
Definition: ir_Haier.h:75
stdAc::fanspeed_t
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
kHaierAcYrw02ButtonHealth
const uint8_t kHaierAcYrw02ButtonHealth
Definition: ir_Haier.h:209
IRHaierAC::getCurrTime
uint16_t getCurrTime(void) const
Get the clock value of the A/C.
Definition: ir_Haier.cpp:277
IRHaierAC::setFan
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Haier.cpp:164
IRHaierACYRW02::on
void on(void)
Change the power setting to On.
Definition: ir_Haier.cpp:677
kHaierAcCmdSleep
const uint8_t kHaierAcCmdSleep
Definition: ir_Haier.h:79
IRHaierACYRW02::_
HaierYRW02Protocol _
Definition: ir_Haier.h:377
IRHaierAC::convertFan
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Haier.cpp:347
HaierProtocol::Prefix
uint8_t Prefix
Definition: ir_Haier.h:35
IRHaierAC::getTemp
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Haier.cpp:225
HaierProtocol::Temp
uint8_t Temp
Definition: ir_Haier.h:38
IRHaierAC::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Haier.cpp:180
HaierProtocol::OnTimer
uint8_t OnTimer
Definition: ir_Haier.h:46
IRHaierACYRW02::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Haier.cpp:807
kHaierAcYrw02Auto
const uint8_t kHaierAcYrw02Auto
Definition: ir_Haier.h:197
IRHaierAC::getRaw
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Haier.cpp:126
kHaierAcCmdSwing
const uint8_t kHaierAcCmdSwing
Definition: ir_Haier.h:83
kHaierAcYrw02Prefix
const uint8_t kHaierAcYrw02Prefix
Definition: ir_Haier.h:179
IRHaierAC::setSleep
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Haier.cpp:244
kHaierAcYrw02SwingTop
const uint8_t kHaierAcYrw02SwingTop
Definition: ir_Haier.h:182
IRHaierACYRW02::getTurbo
uint8_t getTurbo(void) const
Get the Turbo setting of the A/C.
Definition: ir_Haier.cpp:697
HaierProtocol::CurrMins
uint8_t CurrMins
Definition: ir_Haier.h:44
IRsend.h
IRHaierACYRW02::getMode
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Haier.cpp:622
HaierYRW02Protocol::raw
uint8_t raw[kHaierACYRW02StateLength]
The state in native form.
Definition: ir_Haier.h:136
HaierProtocol::Mode
uint8_t Mode
Definition: ir_Haier.h:56
HaierYRW02Protocol::Power
uint8_t Power
Definition: ir_Haier.h:151
IRHaierAC::toString
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Haier.cpp:439
kHaierAcCmdTimerSet
const uint8_t kHaierAcCmdTimerSet
Definition: ir_Haier.h:80
IRHaierAC::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Haier.cpp:191
kHaierAcCmdTempUp
const uint8_t kHaierAcCmdTempUp
Definition: ir_Haier.h:77
IRHaierAC::cancelTimers
void cancelTimers(void)
Cancel/disable the On & Off timers.
Definition: ir_Haier.cpp:298
IRHaierACYRW02::stateReset
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Haier.cpp:557
IRsend
Class for sending all basic IR protocols.
Definition: IRsend.h:182
IRHaierAC::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Haier.h:302
IRHaierACYRW02::setSwing
void setSwing(const uint8_t pos)
Set the Vertical Swing mode of the A/C.
Definition: ir_Haier.cpp:742
IRHaierAC::convertMode
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Haier.cpp:334
IRsend::calibrate
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
kHaierAcFanLow
const uint8_t kHaierAcFanLow
Definition: ir_Haier.h:97
IRHaierACYRW02::getSwing
uint8_t getSwing(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Haier.cpp:736
String
std::string String
Definition: IRremoteESP8266.h:1178
IRHaierAC::getHealth
bool getHealth(void) const
Get the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:238
kHaierAcYrw02ButtonSleep
const uint8_t kHaierAcYrw02ButtonSleep
Definition: ir_Haier.h:211
kHaierAcPrefix
const uint8_t kHaierAcPrefix
Definition: ir_Haier.h:68
kHaierACYRW02StateLength
const uint16_t kHaierACYRW02StateLength
Definition: IRremoteESP8266.h:958
HaierYRW02Protocol::Prefix
uint8_t Prefix
Definition: ir_Haier.h:139
IRHaierAC::setOnTimer
void setOnTimer(const uint16_t mins)
Set & enable the On Timer.
Definition: ir_Haier.cpp:281
HaierYRW02Protocol::Sleep
uint8_t Sleep
Definition: ir_Haier.h:164
kHaierAcSwingOff
const uint8_t kHaierAcSwingOff
Definition: ir_Haier.h:85
kHaierAcSwingDown
const uint8_t kHaierAcSwingDown
Definition: ir_Haier.h:87
IRHaierACYRW02::getPower
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Haier.cpp:665
IRremoteESP8266.h
kHaierAcYrw02FanHigh
const uint8_t kHaierAcYrw02FanHigh
Definition: ir_Haier.h:188
kHaierAcFan
const uint8_t kHaierAcFan
Definition: ir_Haier.h:94
kHaierAcYrw02FanLow
const uint8_t kHaierAcYrw02FanLow
Definition: ir_Haier.h:190
HaierProtocol::Fan
uint8_t Fan
Definition: ir_Haier.h:53
kHaierAcYrw02SwingAuto
const uint8_t kHaierAcYrw02SwingAuto
Definition: ir_Haier.h:186
kHaierAcCool
const uint8_t kHaierAcCool
Definition: ir_Haier.h:91
HaierYRW02Protocol::Turbo
uint8_t Turbo
Definition: ir_Haier.h:158
kHaierAcDefTemp
const uint8_t kHaierAcDefTemp
Definition: ir_Haier.h:71
HaierYRW02Protocol::Mode
uint8_t Mode
Definition: ir_Haier.h:161
kHaierAcYrw02SwingOff
const uint8_t kHaierAcYrw02SwingOff
Definition: ir_Haier.h:181
IRHaierAC::convertSwingV
static uint8_t convertSwingV(const stdAc::swingv_t position)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Haier.cpp:361
IRHaierAC::getSleep
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Haier.cpp:251
IRHaierACYRW02::setFan
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Haier.cpp:723
IRHaierAC::setHealth
void setHealth(const bool on)
Set the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:231
kHaierAcYrw02ButtonTempUp
const uint8_t kHaierAcYrw02ButtonTempUp
Definition: ir_Haier.h:203
HaierYRW02Protocol::Swing
uint8_t Swing
Definition: ir_Haier.h:141
IRHaierACYRW02::off
void off(void)
Change the power setting to Off.
Definition: ir_Haier.cpp:680
IRHaierACYRW02::setHealth
void setHealth(const bool on)
Set the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:652
kHaierAcMinTemp
const uint8_t kHaierAcMinTemp
Definition: ir_Haier.h:70
kHaierAcYrw02SwingDown
const uint8_t kHaierAcYrw02SwingDown
Definition: ir_Haier.h:185
IRHaierAC::validChecksum
static bool validChecksum(uint8_t state[], const uint16_t length=kHaierACStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Haier.cpp:108
IRHaierAC::getSwing
uint8_t getSwing(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Haier.cpp:312
IRHaierAC::_
HaierProtocol _
Definition: ir_Haier.h:308
IRHaierACYRW02::checksum
void checksum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Haier.cpp:543
HaierProtocol::Health
uint8_t Health
Definition: ir_Haier.h:49
kHaierAcCmdHealth
const uint8_t kHaierAcCmdHealth
Definition: ir_Haier.h:82
HaierProtocol::unknown
uint8_t unknown
Definition: ir_Haier.h:41
HaierProtocol::CurrHours
uint8_t CurrHours
Definition: ir_Haier.h:40
HaierProtocol::remote_state
uint8_t remote_state[kHaierACStateLength]
< The state in native IR code form
Definition: ir_Haier.h:32
kHaierAcCmdOn
const uint8_t kHaierAcCmdOn
Definition: ir_Haier.h:74
kHaierAcYrw02SwingMiddle
const uint8_t kHaierAcYrw02SwingMiddle
Definition: ir_Haier.h:183
IRHaierACYRW02::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Haier.cpp:717
kHaierAcYrw02ButtonSwing
const uint8_t kHaierAcYrw02ButtonSwing
Definition: ir_Haier.h:205
kHaierAcYrw02TurboLow
const uint8_t kHaierAcYrw02TurboLow
Definition: ir_Haier.h:195
IRHaierACYRW02::getRaw
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Haier.cpp:570
kHaierAcFanMed
const uint8_t kHaierAcFanMed
Definition: ir_Haier.h:98
IRHaierACYRW02::setSleep
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Haier.cpp:690
kHaierAcYrw02TurboOff
const uint8_t kHaierAcYrw02TurboOff
Definition: ir_Haier.h:193
HaierYRW02Protocol::Health
uint8_t Health
Definition: ir_Haier.h:147
kHaierAcYrw02ButtonTempDown
const uint8_t kHaierAcYrw02ButtonTempDown
Definition: ir_Haier.h:204
IRHaierAC
Class for handling detailed Haier A/C messages.
Definition: ir_Haier.h:244
IRHaierACYRW02::setTemp
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Haier.cpp:628
HaierProtocol::OnMins
uint8_t OnMins
Definition: ir_Haier.h:58
IRHaierAC::setOffTimer
void setOffTimer(const uint16_t mins)
Set & enable the Off Timer.
Definition: ir_Haier.cpp:290
kHaierAcYrw02FanAuto
const uint8_t kHaierAcYrw02FanAuto
Definition: ir_Haier.h:191
kHaierAcYrw02TurboHigh
const uint8_t kHaierAcYrw02TurboHigh
Definition: ir_Haier.h:194
kHaierAcMaxTemp
const uint8_t kHaierAcMaxTemp
Definition: ir_Haier.h:72
IRHaierACYRW02::toCommon
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Haier.cpp:845
IRHaierACYRW02::send
void send(const uint16_t repeat=kHaierAcYrw02DefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Haier.cpp:537
IRHaierACYRW02::setButton
void setButton(const uint8_t button)
Set the Button/Command setting of the A/C.
Definition: ir_Haier.cpp:583
kHaierAcYrw02ButtonFan
const uint8_t kHaierAcYrw02ButtonFan
Definition: ir_Haier.h:206
kHaierAcYrw02Cool
const uint8_t kHaierAcYrw02Cool
Definition: ir_Haier.h:198
IRHaierAC::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Haier.cpp:376
IRHaierACYRW02::setRaw
void setRaw(const uint8_t new_code[])
Set the internal state from a valid code for this protocol.
Definition: ir_Haier.cpp:577
kHaierAcYrw02SwingBottom
const uint8_t kHaierAcYrw02SwingBottom
Definition: ir_Haier.h:184
HaierProtocol::OffHours
uint8_t OffHours
Definition: ir_Haier.h:48
kHaierAcFanAuto
const uint8_t kHaierAcFanAuto
Definition: ir_Haier.h:96
IRHaierACYRW02::convertSwingV
static uint8_t convertSwingV(const stdAc::swingv_t position)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Haier.cpp:792
kHaierAcCmdOff
const uint8_t kHaierAcCmdOff
Definition: ir_Haier.h:73
HaierProtocol::Sleep
uint8_t Sleep
Definition: ir_Haier.h:59
IRHaierACYRW02::IRHaierACYRW02
IRHaierACYRW02(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Haier.cpp:527
IRHaierAC::toCommon
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Haier.cpp:412
IRHaierAC::getOnTimer
int16_t getOnTimer(void) const
Get the On Timer value/setting of the A/C.
Definition: ir_Haier.cpp:257
kHaierAcYrw02Heat
const uint8_t kHaierAcYrw02Heat
Definition: ir_Haier.h:200
IRHaierAC::checksum
void checksum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Haier.cpp:100
IRHaierAC::setCommand
void setCommand(const uint8_t command)
Set the Command/Button setting of the A/C.
Definition: ir_Haier.cpp:139
IRHaierAC::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Haier.h:254
kHaierAcSleepBit
const uint8_t kHaierAcSleepBit
Definition: ir_Haier.h:103
kHaierAcDry
const uint8_t kHaierAcDry
Definition: ir_Haier.h:92
IRHaierACYRW02::validChecksum
static bool validChecksum(uint8_t state[], const uint16_t length=kHaierACYRW02StateLength)
Verify the checksum is valid for a given state.
Definition: ir_Haier.cpp:551
kHaierAcSwingUp
const uint8_t kHaierAcSwingUp
Definition: ir_Haier.h:86
IRHaierAC::toCommonSwingV
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Haier.cpp:401
kHaierAcYrw02ButtonMode
const uint8_t kHaierAcYrw02ButtonMode
Definition: ir_Haier.h:208
kHaierAcHeat
const uint8_t kHaierAcHeat
Definition: ir_Haier.h:93
IRHaierACYRW02::getSleep
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Haier.cpp:684
HaierProtocol
Native representation of a Haier HSU07-HEA03 A/C message.
Definition: ir_Haier.h:30
IRHaierAC::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Haier.cpp:89
kHaierAcMaxTime
const uint16_t kHaierAcMaxTime
Definition: ir_Haier.h:101
IRHaierAC::setCurrTime
void setCurrTime(const uint16_t mins)
Set the clock value for the A/C.
Definition: ir_Haier.cpp:306
IRHaierACYRW02::toCommonSwingV
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Haier.cpp:832
IRHaierACYRW02
Class for handling detailed Haier ACYRW02 A/C messages.
Definition: ir_Haier.h:314
IRHaierAC::IRHaierAC
IRHaierAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Haier.cpp:84
IRHaierAC::setTemp
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Haier.cpp:207
IRHaierAC::getCommand
uint8_t getCommand(void) const
Get the Command/Button setting of the A/C.
Definition: ir_Haier.cpp:158
HaierYRW02Protocol::Fan
uint8_t Fan
Definition: ir_Haier.h:155
IRHaierACYRW02::setTurbo
void setTurbo(const uint8_t speed)
Set the Turbo setting of the A/C.
Definition: ir_Haier.cpp:705
kHaierAcYrw02Dry
const uint8_t kHaierAcYrw02Dry
Definition: ir_Haier.h:199
HaierProtocol::OnHours
uint8_t OnHours
Definition: ir_Haier.h:55
HaierProtocol::OffTimer
uint8_t OffTimer
Definition: ir_Haier.h:45
stdAc::state_t
Structure to hold a common A/C state.
Definition: IRsend.h:97
HaierProtocol::Command
uint8_t Command
Definition: ir_Haier.h:37
HaierYRW02Protocol::Button
uint8_t Button
Definition: ir_Haier.h:172
IRHaierACYRW02::convertMode
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Haier.cpp:765
HaierProtocol::OffMins
uint8_t OffMins
Definition: ir_Haier.h:52
HaierYRW02Protocol::Sum
uint8_t Sum
Definition: ir_Haier.h:175
HaierProtocol::Sum
uint8_t Sum
Definition: ir_Haier.h:62
IRHaierAC::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Haier.cpp:389
kHaierAcYrw02ButtonPower
const uint8_t kHaierAcYrw02ButtonPower
Definition: ir_Haier.h:207
IRHaierACYRW02::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Haier.cpp:606
IRHaierACYRW02::getButton
uint8_t getButton(void) const
Get the Button/Command setting of the A/C.
Definition: ir_Haier.cpp:600
kHaierAcCmdTimerCancel
const uint8_t kHaierAcCmdTimerCancel
Definition: ir_Haier.h:81
IRHaierACYRW02::convertFan
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Haier.cpp:778
stdAc::opmode_t
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46
IRHaierAC::send
void send(const uint16_t repeat=kHaierAcDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Haier.cpp:94