IRremoteESP8266: src/ir_Haier.h Source File

IRremoteESP8266

ir_Haier.h
Go to the documentation of this file.
1 // Copyright 2018 crankyoldgit
11
12 // Supports:
13 // Brand: Haier, Model: HSU07-HEA03 remote (HAIER_AC)
14 // Brand: Haier, Model: YR-W02 remote (HAIER_AC_YRW02)
15 // Brand: Haier, Model: HSU-09HMC203 A/C (HAIER_AC_YRW02)
16
17 #ifndef IR_HAIER_H_
18 #define IR_HAIER_H_
19
20 #ifndef UNIT_TEST
21 #include <Arduino.h>
22 #endif
23 #include "IRremoteESP8266.h"
24 #include "IRsend.h"
25 #ifdef UNIT_TEST
26 #include "IRsend_test.h"
27 #endif
28
30 union HaierProtocol{
32 uint8_t remote_state[kHaierACStateLength];
33 struct {
34 // Byte 0
35 uint8_t Prefix;
36 // Byte 1
37 uint8_t Command:4;
38 uint8_t Temp :4;
39 // Byte 2
40 uint8_t CurrHours:5;
41 uint8_t unknown :1; // value=1
42 uint8_t Swing :2;
43 // Byte 3
44 uint8_t CurrMins:6;
45 uint8_t OffTimer:1;
46 uint8_t OnTimer :1;
47 // Byte 4
48 uint8_t OffHours:5;
49 uint8_t Health :1;
50 uint8_t :0;
51 // Byte 5
52 uint8_t OffMins:6;
53 uint8_t Fan :2;
54 // Byte 6
55 uint8_t OnHours:5;
56 uint8_t Mode :3;
57 // Byte 7
58 uint8_t OnMins:6;
59 uint8_t Sleep :1;
60 uint8_t :0;
61 // Byte 8
62 uint8_t Sum;
63 };
64 };
65
66 // Constants
67
68 const uint8_t kHaierAcPrefix = 0b10100101;
69
70 const uint8_t kHaierAcMinTemp = 16;
71 const uint8_t kHaierAcDefTemp = 25;
72 const uint8_t kHaierAcMaxTemp = 30;
73 const uint8_t kHaierAcCmdOff = 0b0000;
74 const uint8_t kHaierAcCmdOn = 0b0001;
75 const uint8_t kHaierAcCmdMode = 0b0010;
76 const uint8_t kHaierAcCmdFan = 0b0011;
77 const uint8_t kHaierAcCmdTempUp = 0b0110;
78 const uint8_t kHaierAcCmdTempDown = 0b0111;
79 const uint8_t kHaierAcCmdSleep = 0b1000;
80 const uint8_t kHaierAcCmdTimerSet = 0b1001;
81 const uint8_t kHaierAcCmdTimerCancel = 0b1010;
82 const uint8_t kHaierAcCmdHealth = 0b1100;
83 const uint8_t kHaierAcCmdSwing = 0b1101;
84
85 const uint8_t kHaierAcSwingOff = 0b00;
86 const uint8_t kHaierAcSwingUp = 0b01;
87 const uint8_t kHaierAcSwingDown = 0b10;
88 const uint8_t kHaierAcSwingChg = 0b11;
89
90 const uint8_t kHaierAcAuto = 0;
91 const uint8_t kHaierAcCool = 1;
92 const uint8_t kHaierAcDry = 2;
93 const uint8_t kHaierAcHeat = 3;
94 const uint8_t kHaierAcFan = 4;
95
96 const uint8_t kHaierAcFanAuto = 0;
97 const uint8_t kHaierAcFanLow = 1;
98 const uint8_t kHaierAcFanMed = 2;
99 const uint8_t kHaierAcFanHigh = 3;
100
101 const uint16_t kHaierAcMaxTime = (23 * 60) + 59;
102
103 const uint8_t kHaierAcSleepBit = 0b01000000;
104
105 // Legacy Haier AC defines.
106 #define HAIER_AC_MIN_TEMP kHaierAcMinTemp
107 #define HAIER_AC_DEF_TEMP kHaierAcDefTemp
108 #define HAIER_AC_MAX_TEMP kHaierAcMaxTemp
109 #define HAIER_AC_CMD_OFF kHaierAcCmdOff
110 #define HAIER_AC_CMD_ON kHaierAcCmdOn
111 #define HAIER_AC_CMD_MODE kHaierAcCmdMode
112 #define HAIER_AC_CMD_FAN kHaierAcCmdFan
113 #define HAIER_AC_CMD_TEMP_UP kHaierAcCmdTempUp
114 #define HAIER_AC_CMD_TEMP_DOWN kHaierAcCmdTempDown
115 #define HAIER_AC_CMD_SLEEP kHaierAcCmdSleep
116 #define HAIER_AC_CMD_TIMER_SET kHaierAcCmdTimerSet
117 #define HAIER_AC_CMD_TIMER_CANCEL kHaierAcCmdTimerCancel
118 #define HAIER_AC_CMD_HEALTH kHaierAcCmdHealth
119 #define HAIER_AC_CMD_SWING kHaierAcCmdSwing
120 #define HAIER_AC_SWING_OFF kHaierAcSwingOff
121 #define HAIER_AC_SWING_UP kHaierAcSwingUp
122 #define HAIER_AC_SWING_DOWN kHaierAcSwingDown
123 #define HAIER_AC_SWING_CHG kHaierAcSwingChg
124 #define HAIER_AC_AUTO kHaierAcAuto
125 #define HAIER_AC_COOL kHaierAcCool
126 #define HAIER_AC_DRY kHaierAcDry
127 #define HAIER_AC_HEAT kHaierAcHeat
128 #define HAIER_AC_FAN kHaierAcFan
129 #define HAIER_AC_FAN_AUTO kHaierAcFanAuto
130 #define HAIER_AC_FAN_LOW kHaierAcFanLow
131 #define HAIER_AC_FAN_MED kHaierAcFanMed
132 #define HAIER_AC_FAN_HIGH kHaierAcFanHigh
133
135 union HaierYRW02Protocol{
136 uint8_t raw[kHaierACYRW02StateLength];
137 struct {
138 // Byte 0
139 uint8_t Prefix;
140 // Byte 1
141 uint8_t Swing:4;
142 uint8_t Temp :4; // 16C~30C
143 // Byte 2
144 uint8_t :8;
145 // Byte 3
146 uint8_t :1;
147 uint8_t Health:1;
148 uint8_t :6;
149 // Byte 4
150 uint8_t :6;
151 uint8_t Power:1;
152 uint8_t :1;
153 // Byte 5
154 uint8_t :5;
155 uint8_t Fan:3;
156 // Byte 6
157 uint8_t :6;
158 uint8_t Turbo:2;
159 // Byte 7
160 uint8_t :5;
161 uint8_t Mode:3;
162 // Byte 8
163 uint8_t :7;
164 uint8_t Sleep:1;
165 // Byte 9
166 uint8_t :8;
167 // Byte 10
168 uint8_t :8;
169 // Byte 11
170 uint8_t :8;
171 // Byte 12
172 uint8_t Button:4;
173 uint8_t :4;
174 // Byte 13
175 uint8_t Sum;
176 };
177 };
178
179 const uint8_t kHaierAcYrw02Prefix = 0xA6;
180
181 const uint8_t kHaierAcYrw02SwingOff = 0x0;
182 const uint8_t kHaierAcYrw02SwingTop = 0x1;
183 const uint8_t kHaierAcYrw02SwingMiddle = 0x2; // Not available in heat mode.
184 const uint8_t kHaierAcYrw02SwingBottom = 0x3; // Only available in heat mode.
185 const uint8_t kHaierAcYrw02SwingDown = 0xA;
186 const uint8_t kHaierAcYrw02SwingAuto = 0xC; // Airflow
187
188 const uint8_t kHaierAcYrw02FanHigh = 0b001;
189 const uint8_t kHaierAcYrw02FanMed = 0b010;
190 const uint8_t kHaierAcYrw02FanLow = 0b011;
191 const uint8_t kHaierAcYrw02FanAuto = 0b101;
192
193 const uint8_t kHaierAcYrw02TurboOff = 0x0;
194 const uint8_t kHaierAcYrw02TurboHigh = 0x1;
195 const uint8_t kHaierAcYrw02TurboLow = 0x2;
196
197 const uint8_t kHaierAcYrw02Auto = 0b000; // 0
198 const uint8_t kHaierAcYrw02Cool = 0b001; // 1
199 const uint8_t kHaierAcYrw02Dry = 0b010; // 2
200 const uint8_t kHaierAcYrw02Heat = 0b100; // 4
201 const uint8_t kHaierAcYrw02Fan = 0b110; // 5
202
203 const uint8_t kHaierAcYrw02ButtonTempUp = 0x0;
204 const uint8_t kHaierAcYrw02ButtonTempDown = 0x1;
205 const uint8_t kHaierAcYrw02ButtonSwing = 0x2;
206 const uint8_t kHaierAcYrw02ButtonFan = 0x4;
207 const uint8_t kHaierAcYrw02ButtonPower = 0x5;
208 const uint8_t kHaierAcYrw02ButtonMode = 0x6;
209 const uint8_t kHaierAcYrw02ButtonHealth = 0x7;
210 const uint8_t kHaierAcYrw02ButtonTurbo = 0x8;
211 const uint8_t kHaierAcYrw02ButtonSleep = 0xB;
212
213 // Legacy Haier YRW02 remote defines.
214 #define HAIER_AC_YRW02_SWING_OFF kHaierAcYrw02SwingOff
215 #define HAIER_AC_YRW02_SWING_TOP kHaierAcYrw02SwingTop
216 #define HAIER_AC_YRW02_SWING_MIDDLE kHaierAcYrw02SwingMiddle
217 #define HAIER_AC_YRW02_SWING_BOTTOM kHaierAcYrw02SwingBottom
218 #define HAIER_AC_YRW02_SWING_DOWN kHaierAcYrw02SwingDown
219 #define HAIER_AC_YRW02_SWING_AUTO kHaierAcYrw02SwingAuto
220 #define HAIER_AC_YRW02_FAN_HIGH kHaierAcYrw02FanHigh
221 #define HAIER_AC_YRW02_FAN_MED kHaierAcYrw02FanMed
222 #define HAIER_AC_YRW02_FAN_LOW kHaierAcYrw02FanLow
223 #define HAIER_AC_YRW02_FAN_AUTO kHaierAcYrw02FanAuto
224 #define HAIER_AC_YRW02_TURBO_OFF kHaierAcYrw02TurboOff
225 #define HAIER_AC_YRW02_TURBO_HIGH kHaierAcYrw02TurboHigh
226 #define HAIER_AC_YRW02_TURBO_LOW kHaierAcYrw02TurboLow
227 #define HAIER_AC_YRW02_AUTO kHaierAcYrw02Auto
228 #define HAIER_AC_YRW02_COOL kHaierAcYrw02Cool
229 #define HAIER_AC_YRW02_DRY kHaierAcYrw02Dry
230 #define HAIER_AC_YRW02_HEAT kHaierAcYrw02Heat
231 #define HAIER_AC_YRW02_FAN kHaierAcYrw02Fan
232 #define HAIER_AC_YRW02_BUTTON_TEMP_UP kHaierAcYrw02ButtonTempUp
233 #define HAIER_AC_YRW02_BUTTON_TEMP_DOWN kHaierAcYrw02ButtonTempDown
234 #define HAIER_AC_YRW02_BUTTON_SWING kHaierAcYrw02ButtonSwing
235 #define HAIER_AC_YRW02_BUTTON_FAN kHaierAcYrw02ButtonFan
236 #define HAIER_AC_YRW02_BUTTON_POWER kHaierAcYrw02ButtonPower
237 #define HAIER_AC_YRW02_BUTTON_MODE kHaierAcYrw02ButtonMode
238 #define HAIER_AC_YRW02_BUTTON_HEALTH kHaierAcYrw02ButtonHealth
239 #define HAIER_AC_YRW02_BUTTON_TURBO kHaierAcYrw02ButtonTurbo
240 #define HAIER_AC_YRW02_BUTTON_SLEEP kHaierAcYrw02ButtonSleep
241
242 // Classes
244 class IRHaierAC {
245 public:
246 explicit IRHaierAC(const uint16_t pin, const bool inverted = false,
247 const bool use_modulation = true);
248 #if SEND_HAIER_AC
249 void send(const uint16_t repeat = kHaierAcDefaultRepeat);
254 int8_t calibrate(void) { return _irsend.calibrate(); }
255 #endif // SEND_HAIER_AC
256 void begin(void);
257
258 void setCommand(const uint8_t command);
259 uint8_t getCommand(void) const;
260
261 void setTemp(const uint8_t temp);
262 uint8_t getTemp(void) const;
263
264 void setFan(const uint8_t speed);
265 uint8_t getFan(void) const;
266
267 uint8_t getMode(void) const;
268 void setMode(const uint8_t mode);
269
270 bool getSleep(void) const;
271 void setSleep(const bool on);
272 bool getHealth(void) const;
273 void setHealth(const bool on);
274
275 int16_t getOnTimer(void) const;
276 void setOnTimer(const uint16_t mins);
277 int16_t getOffTimer(void) const;
278 void setOffTimer(const uint16_t mins);
279 void cancelTimers(void);
280
281 uint16_t getCurrTime(void) const;
282 void setCurrTime(const uint16_t mins);
283
284 uint8_t getSwing(void) const;
285 void setSwing(const uint8_t state);
286
287 uint8_t* getRaw(void);
288 void setRaw(const uint8_t new_code[]);
289 static bool validChecksum(uint8_t state[],
290 const uint16_t length = kHaierACStateLength);
291 static uint8_t convertMode(const stdAc::opmode_t mode);
292 static uint8_t convertFan(const stdAc::fanspeed_t speed);
293 static uint8_t convertSwingV(const stdAc::swingv_t position);
294 static stdAc::opmode_t toCommonMode(const uint8_t mode);
295 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
296 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
297 stdAc::state_t toCommon(void) const;
298 String toString(void) const;
299 #ifndef UNIT_TEST
300
301 private:
302 IRsend _irsend;
303 #else // UNIT_TEST
304 IRsendTest _irsend;
306 #endif
308 HaierProtocol _;
309 void stateReset(void);
310 void checksum(void);
311 };
312
314 class IRHaierACYRW02 {
315 public:
316 explicit IRHaierACYRW02(const uint16_t pin, const bool inverted = false,
317 const bool use_modulation = true);
318 #if SEND_HAIER_AC_YRW02
319 void send(const uint16_t repeat = kHaierAcYrw02DefaultRepeat);
324 int8_t calibrate(void) { return _irsend.calibrate(); }
325 #endif // SEND_HAIER_AC_YRW02
326 void begin(void);
327
328 void setButton(const uint8_t button);
329 uint8_t getButton(void) const;
330
331 void setTemp(const uint8_t temp);
332 uint8_t getTemp(void) const;
333
334 void setFan(const uint8_t speed);
335 uint8_t getFan(void) const;
336
337 uint8_t getMode(void) const;
338 void setMode(const uint8_t mode);
339
340 bool getPower(void) const;
341 void setPower(const bool on);
342 void on(void);
343 void off(void);
344
345 bool getSleep(void) const;
346 void setSleep(const bool on);
347 bool getHealth(void) const;
348 void setHealth(const bool on);
349
350 uint8_t getTurbo(void) const;
351 void setTurbo(const uint8_t speed);
352
353 uint8_t getSwing(void) const;
354 void setSwing(const uint8_t pos);
355
356 uint8_t* getRaw(void);
357 void setRaw(const uint8_t new_code[]);
358 static bool validChecksum(uint8_t state[],
359 const uint16_t length = kHaierACYRW02StateLength);
360 static uint8_t convertMode(const stdAc::opmode_t mode);
361 static uint8_t convertFan(const stdAc::fanspeed_t speed);
362 static uint8_t convertSwingV(const stdAc::swingv_t position);
363 static stdAc::opmode_t toCommonMode(const uint8_t mode);
364 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
365 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
366 stdAc::state_t toCommon(void) const;
367 String toString(void) const;
368 #ifndef UNIT_TEST
369
370 private:
371 IRsend _irsend;
372 #else // UNIT_TEST
373 IRsendTest _irsend;
375 #endif // UNIT_TEST
377 HaierYRW02Protocol _;
378 void stateReset(void);
379 void checksum(void);
380 };
381 #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:978
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:975
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:973
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:187
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:1199
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:976
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