IRremoteESP8266

ir_Haier.h
Go to the documentation of this file.
1 // Copyright 2018-2021 crankyoldgit
12
13 // Supports:
14 // Brand: Haier, Model: HSU07-HEA03 remote (HAIER_AC)
15 // Brand: Haier, Model: YR-W02 remote (HAIER_AC_YRW02)
16 // Brand: Haier, Model: HSU-09HMC203 A/C (HAIER_AC_YRW02)
17 // Brand: Haier, Model: V9014557 M47 8D remote (HAIER_AC176)
18 // Brand: Mabe, Model: MMI18HDBWCA6MI8 A/C (HAIER_AC176)
19 // Brand: Mabe, Model: V12843 HJ200223 remote (HAIER_AC176)
20 // Brand: Daichi, Model: D-H A/C (HAIER_AC176)
21 // Brand: Haier, Model: KFR-26GW/83@UI-Ge A/C (HAIER_AC160)
22
23 #ifndef IR_HAIER_H_
24 #define IR_HAIER_H_
25
26 #ifndef UNIT_TEST
27 #include <Arduino.h>
28 #endif
29 #include "IRremoteESP8266.h"
30 #include "IRsend.h"
31 #ifdef UNIT_TEST
32 #include "IRsend_test.h"
33 #endif
34
36 union HaierProtocol{
38 uint8_t remote_state[kHaierACStateLength];
39 struct {
40 // Byte 0
41 uint8_t Prefix;
42 // Byte 1
43 uint8_t Command:4;
44 uint8_t Temp :4;
45 // Byte 2
46 uint8_t CurrHours:5;
47 uint8_t unknown :1; // value=1
48 uint8_t SwingV :2;
49 // Byte 3
50 uint8_t CurrMins:6;
51 uint8_t OffTimer:1;
52 uint8_t OnTimer :1;
53 // Byte 4
54 uint8_t OffHours:5;
55 uint8_t Health :1;
56 uint8_t :0;
57 // Byte 5
58 uint8_t OffMins:6;
59 uint8_t Fan :2;
60 // Byte 6
61 uint8_t OnHours:5;
62 uint8_t Mode :3;
63 // Byte 7
64 uint8_t OnMins:6;
65 uint8_t Sleep :1;
66 uint8_t :0;
67 // Byte 8
68 uint8_t Sum;
69 };
70 };
71
72 // Constants
73
74 const uint8_t kHaierAcPrefix = 0b10100101;
75
76 const uint8_t kHaierAcMinTemp = 16;
77 const uint8_t kHaierAcDefTemp = 25;
78 const uint8_t kHaierAcMaxTemp = 30;
79 const uint8_t kHaierAcCmdOff = 0b0000;
80 const uint8_t kHaierAcCmdOn = 0b0001;
81 const uint8_t kHaierAcCmdMode = 0b0010;
82 const uint8_t kHaierAcCmdFan = 0b0011;
83 const uint8_t kHaierAcCmdTempUp = 0b0110;
84 const uint8_t kHaierAcCmdTempDown = 0b0111;
85 const uint8_t kHaierAcCmdSleep = 0b1000;
86 const uint8_t kHaierAcCmdTimerSet = 0b1001;
87 const uint8_t kHaierAcCmdTimerCancel = 0b1010;
88 const uint8_t kHaierAcCmdHealth = 0b1100;
89 const uint8_t kHaierAcCmdSwing = 0b1101;
90
91 const uint8_t kHaierAcSwingVOff = 0b00;
92 const uint8_t kHaierAcSwingVUp = 0b01;
93 const uint8_t kHaierAcSwingVDown = 0b10;
94 const uint8_t kHaierAcSwingVChg = 0b11;
95
96 const uint8_t kHaierAcAuto = 0;
97 const uint8_t kHaierAcCool = 1;
98 const uint8_t kHaierAcDry = 2;
99 const uint8_t kHaierAcHeat = 3;
100 const uint8_t kHaierAcFan = 4;
101
102 const uint8_t kHaierAcFanAuto = 0;
103 const uint8_t kHaierAcFanLow = 1;
104 const uint8_t kHaierAcFanMed = 2;
105 const uint8_t kHaierAcFanHigh = 3;
106
107 const uint16_t kHaierAcMaxTime = (23 * 60) + 59;
108
109 const uint8_t kHaierAcSleepBit = 0b01000000;
110
111 // Legacy Haier AC defines.
112 #define HAIER_AC_MIN_TEMP kHaierAcMinTemp
113 #define HAIER_AC_DEF_TEMP kHaierAcDefTemp
114 #define HAIER_AC_MAX_TEMP kHaierAcMaxTemp
115 #define HAIER_AC_CMD_OFF kHaierAcCmdOff
116 #define HAIER_AC_CMD_ON kHaierAcCmdOn
117 #define HAIER_AC_CMD_MODE kHaierAcCmdMode
118 #define HAIER_AC_CMD_FAN kHaierAcCmdFan
119 #define HAIER_AC_CMD_TEMP_UP kHaierAcCmdTempUp
120 #define HAIER_AC_CMD_TEMP_DOWN kHaierAcCmdTempDown
121 #define HAIER_AC_CMD_SLEEP kHaierAcCmdSleep
122 #define HAIER_AC_CMD_TIMER_SET kHaierAcCmdTimerSet
123 #define HAIER_AC_CMD_TIMER_CANCEL kHaierAcCmdTimerCancel
124 #define HAIER_AC_CMD_HEALTH kHaierAcCmdHealth
125 #define HAIER_AC_CMD_SWINGV kHaierAcCmdSwing
126 #define HAIER_AC_SWINGV_OFF kHaierAcSwingVOff
127 #define HAIER_AC_SWINGV_UP kHaierAcSwingVUp
128 #define HAIER_AC_SWINGV_DOWN kHaierAcSwingVDown
129 #define HAIER_AC_SWINGV_CHG kHaierAcSwingVChg
130 #define HAIER_AC_AUTO kHaierAcAuto
131 #define HAIER_AC_COOL kHaierAcCool
132 #define HAIER_AC_DRY kHaierAcDry
133 #define HAIER_AC_HEAT kHaierAcHeat
134 #define HAIER_AC_FAN kHaierAcFan
135 #define HAIER_AC_FAN_AUTO kHaierAcFanAuto
136 #define HAIER_AC_FAN_LOW kHaierAcFanLow
137 #define HAIER_AC_FAN_MED kHaierAcFanMed
138 #define HAIER_AC_FAN_HIGH kHaierAcFanHigh
139
140 const uint8_t kHaierAcYrw02MinTempC = 16;
141 const uint8_t kHaierAcYrw02MaxTempC = 30;
142 const uint8_t kHaierAcYrw02MinTempF = 60;
143 const uint8_t kHaierAcYrw02MaxTempF = 86;
144 const uint8_t kHaierAcYrw02DefTempC = 25;
145
146 const uint8_t kHaierAcYrw02ModelA = 0xA6;
147 const uint8_t kHaierAcYrw02ModelB = 0x59;
148 const uint8_t kHaierAc176Prefix = 0xB7;
149 const uint8_t kHaierAc160Prefix = 0xB5;
150
151 const uint8_t kHaierAcYrw02SwingVOff = 0x0;
152 const uint8_t kHaierAcYrw02SwingVTop = 0x1;
153 const uint8_t kHaierAcYrw02SwingVMiddle = 0x2; // Not available in heat mode.
154 const uint8_t kHaierAcYrw02SwingVBottom = 0x3; // Only available in heat mode.
155 const uint8_t kHaierAcYrw02SwingVDown = 0xA;
156 const uint8_t kHaierAcYrw02SwingVAuto = 0xC; // Airflow
157
158 const uint8_t kHaierAc160SwingVOff = 0b0000;
159 const uint8_t kHaierAc160SwingVTop = 0b0001;
160 const uint8_t kHaierAc160SwingVHighest = 0b0010;
161 const uint8_t kHaierAc160SwingVHigh = 0b0100;
162 const uint8_t kHaierAc160SwingVMiddle = 0b0110;
163 const uint8_t kHaierAc160SwingVLow = 0b1000;
164 const uint8_t kHaierAc160SwingVLowest = 0b0011;
165 const uint8_t kHaierAc160SwingVAuto = 0b1100; // Airflow
166
167 const uint8_t kHaierAcYrw02SwingHMiddle = 0x0;
168 const uint8_t kHaierAcYrw02SwingHLeftMax = 0x3;
169 const uint8_t kHaierAcYrw02SwingHLeft = 0x4;
170 const uint8_t kHaierAcYrw02SwingHRight = 0x5;
171 const uint8_t kHaierAcYrw02SwingHRightMax = 0x6;
172 const uint8_t kHaierAcYrw02SwingHAuto = 0x7;
173
174 const uint8_t kHaierAcYrw02FanHigh = 0b001;
175 const uint8_t kHaierAcYrw02FanMed = 0b010;
176 const uint8_t kHaierAcYrw02FanLow = 0b011;
177 const uint8_t kHaierAcYrw02FanAuto = 0b101; // HAIER_AC176 uses `0` in Fan2
178
179 const uint8_t kHaierAcYrw02Auto = 0b000; // 0
180 const uint8_t kHaierAcYrw02Cool = 0b001; // 1
181 const uint8_t kHaierAcYrw02Dry = 0b010; // 2
182 const uint8_t kHaierAcYrw02Heat = 0b100; // 4
183 const uint8_t kHaierAcYrw02Fan = 0b110; // 5
184
185 const uint8_t kHaierAcYrw02ButtonTempUp = 0b00000;
186 const uint8_t kHaierAcYrw02ButtonTempDown = 0b00001;
187 const uint8_t kHaierAcYrw02ButtonSwingV = 0b00010;
188 const uint8_t kHaierAcYrw02ButtonSwingH = 0b00011;
189 const uint8_t kHaierAcYrw02ButtonFan = 0b00100;
190 const uint8_t kHaierAcYrw02ButtonPower = 0b00101;
191 const uint8_t kHaierAcYrw02ButtonMode = 0b00110;
192 const uint8_t kHaierAcYrw02ButtonHealth = 0b00111;
193 const uint8_t kHaierAcYrw02ButtonTurbo = 0b01000;
194 const uint8_t kHaierAcYrw02ButtonSleep = 0b01011;
195 const uint8_t kHaierAcYrw02ButtonTimer = 0b10000;
196 const uint8_t kHaierAcYrw02ButtonLock = 0b10100;
197 const uint8_t kHaierAc160ButtonLight = 0b10101;
198 const uint8_t kHaierAc160ButtonAuxHeating = 0b10110;
199 const uint8_t kHaierAc160ButtonClean = 0b11001;
200 const uint8_t kHaierAcYrw02ButtonCFAB = 0b11010;
201
202 const uint8_t kHaierAcYrw02NoTimers = 0b000;
203 const uint8_t kHaierAcYrw02OffTimer = 0b001;
204 const uint8_t kHaierAcYrw02OnTimer = 0b010;
205 const uint8_t kHaierAcYrw02OnThenOffTimer = 0b100;
206 const uint8_t kHaierAcYrw02OffThenOnTimer = 0b101;
207
209 union HaierAc176Protocol{
210 uint8_t raw[kHaierAC176StateLength];
211 struct {
212 // Byte 0
213 uint8_t Model :8;
214 // Byte 1
215 uint8_t SwingV :4;
216 uint8_t Temp :4; // 16C~30C
217 // Byte 2
218 uint8_t :5;
219 uint8_t SwingH :3;
220 // Byte 3
221 uint8_t :1;
222 uint8_t Health :1;
223 uint8_t :3;
224 uint8_t TimerMode :3;
225 // Byte 4
226 uint8_t :6;
227 uint8_t Power :1;
228 uint8_t :1;
229 // Byte 5
230 uint8_t OffTimerHrs :5;
231 uint8_t Fan :3;
232 // Byte 6
233 uint8_t OffTimerMins:6;
234 uint8_t Turbo :1;
235 uint8_t Quiet :1;
236 // Byte 7
237 uint8_t OnTimerHrs :5;
238 uint8_t Mode :3;
239 // Byte 8
240 uint8_t OnTimerMins :6;
241 uint8_t :1;
242 uint8_t Sleep :1;
243 // Byte 9
244 uint8_t :8;
245 // Byte 10
246 uint8_t ExtraDegreeF :1;
247 uint8_t :4;
248 uint8_t UseFahrenheit:1;
249 uint8_t :2;
250 // Byte 11
251 uint8_t :8;
252 // Byte 12
253 uint8_t Button :5;
254 uint8_t Lock :1;
255 uint8_t :2;
256 // Byte 13
257 uint8_t Sum :8;
258 // Byte 14
259 uint8_t Prefix2 :8;
260 // Byte 15
261 uint8_t :8;
262 // Byte 16
263 uint8_t :6;
264 uint8_t Fan2 :2;
265 // Byte 17
266 uint8_t :8;
267 // Byte 18
268 uint8_t :8;
269 // Byte 19
270 uint8_t :8;
271 // Byte 20
272 uint8_t :8;
273 // Byte 21
274 uint8_t Sum2 :8;
275 };
276 };
277
279 union HaierAc160Protocol{
280 uint8_t raw[kHaierAC160StateLength];
281 struct {
282 // Byte 0
283 uint8_t Model :8;
284 // Byte 1
285 uint8_t SwingV :4;
286 uint8_t Temp :4; // 16C~30C
287 // Byte 2
288 uint8_t :5;
289 uint8_t SwingH :3;
290 // Byte 3
291 uint8_t :1;
292 uint8_t Health :1;
293 uint8_t :3;
294 uint8_t TimerMode :3;
295 // Byte 4
296 uint8_t :6;
297 uint8_t Power :1;
298 uint8_t AuxHeating :1;
299 // Byte 5
300 uint8_t OffTimerHrs :5;
301 uint8_t Fan :3;
302 // Byte 6
303 uint8_t OffTimerMins:6;
304 uint8_t Turbo :1;
305 uint8_t Quiet :1;
306 // Byte 7
307 uint8_t OnTimerHrs :5;
308 uint8_t Mode :3;
309 // Byte 8
310 uint8_t OnTimerMins :6;
311 uint8_t :1;
312 uint8_t Sleep :1;
313 // Byte 9
314 uint8_t :8;
315 // Byte 10
316 uint8_t ExtraDegreeF :1;
317 uint8_t :3;
318 uint8_t Clean :1;
319 uint8_t UseFahrenheit:1;
320 uint8_t :2;
321 // Byte 11
322 uint8_t :8;
323 // Byte 12
324 uint8_t Button :5;
325 uint8_t Lock :1;
326 uint8_t :2;
327 // Byte 13
328 uint8_t Sum :8;
329 // Byte 14
330 uint8_t Prefix :8;
331 // Byte 15
332 uint8_t :6;
333 uint8_t Clean2 :1;
334 uint8_t :1;
335 // Byte 16
336 uint8_t :5;
337 uint8_t Fan2 :3;
338 // Byte 17
339 uint8_t :8;
340 // Byte 18
341 uint8_t :8;
342 // Byte 19
343 uint8_t Sum2 :8;
344 };
345 };
346
347 // Legacy Haier YRW02 remote defines.
348 #define HAIER_AC_YRW02_SWING_OFF kHaierAcYrw02SwingOff
349 #define HAIER_AC_YRW02_SWING_TOP kHaierAcYrw02SwingTop
350 #define HAIER_AC_YRW02_SWING_MIDDLE kHaierAcYrw02SwingMiddle
351 #define HAIER_AC_YRW02_SWING_BOTTOM kHaierAcYrw02SwingBottom
352 #define HAIER_AC_YRW02_SWING_DOWN kHaierAcYrw02SwingDown
353 #define HAIER_AC_YRW02_SWING_AUTO kHaierAcYrw02SwingAuto
354 #define HAIER_AC_YRW02_FAN_HIGH kHaierAcYrw02FanHigh
355 #define HAIER_AC_YRW02_FAN_MED kHaierAcYrw02FanMed
356 #define HAIER_AC_YRW02_FAN_LOW kHaierAcYrw02FanLow
357 #define HAIER_AC_YRW02_FAN_AUTO kHaierAcYrw02FanAuto
358 #define HAIER_AC_YRW02_TURBO_OFF kHaierAcYrw02TurboOff
359 #define HAIER_AC_YRW02_AUTO kHaierAcYrw02Auto
360 #define HAIER_AC_YRW02_COOL kHaierAcYrw02Cool
361 #define HAIER_AC_YRW02_DRY kHaierAcYrw02Dry
362 #define HAIER_AC_YRW02_HEAT kHaierAcYrw02Heat
363 #define HAIER_AC_YRW02_FAN kHaierAcYrw02Fan
364 #define HAIER_AC_YRW02_BUTTON_TEMP_UP kHaierAcYrw02ButtonTempUp
365 #define HAIER_AC_YRW02_BUTTON_TEMP_DOWN kHaierAcYrw02ButtonTempDown
366 #define HAIER_AC_YRW02_BUTTON_SWING kHaierAcYrw02ButtonSwing
367 #define HAIER_AC_YRW02_BUTTON_FAN kHaierAcYrw02ButtonFan
368 #define HAIER_AC_YRW02_BUTTON_POWER kHaierAcYrw02ButtonPower
369 #define HAIER_AC_YRW02_BUTTON_MODE kHaierAcYrw02ButtonMode
370 #define HAIER_AC_YRW02_BUTTON_HEALTH kHaierAcYrw02ButtonHealth
371 #define HAIER_AC_YRW02_BUTTON_TURBO kHaierAcYrw02ButtonTurbo
372 #define HAIER_AC_YRW02_BUTTON_SLEEP kHaierAcYrw02ButtonSleep
373
374 // Classes
376 class IRHaierAC {
377 public:
378 explicit IRHaierAC(const uint16_t pin, const bool inverted = false,
379 const bool use_modulation = true);
380 #if SEND_HAIER_AC
381 void send(const uint16_t repeat = kHaierAcDefaultRepeat);
386 int8_t calibrate(void) { return _irsend.calibrate(); }
387 #endif // SEND_HAIER_AC
388 void begin(void);
389 void stateReset(void);
390
391 void setCommand(const uint8_t command);
392 uint8_t getCommand(void) const;
393
394 void setTemp(const uint8_t temp);
395 uint8_t getTemp(void) const;
396
397 void setFan(const uint8_t speed);
398 uint8_t getFan(void) const;
399
400 uint8_t getMode(void) const;
401 void setMode(const uint8_t mode);
402
403 bool getSleep(void) const;
404 void setSleep(const bool on);
405 bool getHealth(void) const;
406 void setHealth(const bool on);
407
408 int16_t getOnTimer(void) const;
409 void setOnTimer(const uint16_t mins);
410 int16_t getOffTimer(void) const;
411 void setOffTimer(const uint16_t mins);
412 void cancelTimers(void);
413
414 uint16_t getCurrTime(void) const;
415 void setCurrTime(const uint16_t mins);
416
417 uint8_t getSwingV(void) const;
418 void setSwingV(const uint8_t state);
419
420 uint8_t* getRaw(void);
421 void setRaw(const uint8_t new_code[]);
422 static bool validChecksum(uint8_t state[],
423 const uint16_t length = kHaierACStateLength);
424 static uint8_t convertMode(const stdAc::opmode_t mode);
425 static uint8_t convertFan(const stdAc::fanspeed_t speed);
426 static uint8_t convertSwingV(const stdAc::swingv_t position);
427 static stdAc::opmode_t toCommonMode(const uint8_t mode);
428 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
429 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
430 stdAc::state_t toCommon(void) const;
431 String toString(void) const;
432 #ifndef UNIT_TEST
433
434 private:
435 IRsend _irsend;
436 #else // UNIT_TEST
437 IRsendTest _irsend;
439 #endif
441 HaierProtocol _;
442 void checksum(void);
443 };
444
446 class IRHaierAC176 {
447 friend class IRHaierACYRW02;
448 public:
449 explicit IRHaierAC176(const uint16_t pin, const bool inverted = false,
450 const bool use_modulation = true);
451 #if SEND_HAIER_AC176
452 virtual void send(const uint16_t repeat = kHaierAc176DefaultRepeat);
457 int8_t calibrate(void) { return _irsend.calibrate(); }
458 #endif // SEND_HAIER_AC176
459 void begin(void);
460 void stateReset(void);
461
462 void setModel(const haier_ac176_remote_model_t model);
463 haier_ac176_remote_model_t getModel(void) const;
464
465 void setButton(const uint8_t button);
466 uint8_t getButton(void) const;
467
468 void setUseFahrenheit(const bool on);
469 bool getUseFahrenheit(void) const;
470 void setTemp(const uint8_t temp, const bool fahrenheit = false);
471 uint8_t getTemp(void) const;
472
473 void setFan(const uint8_t speed);
474 uint8_t getFan(void) const;
475
476 uint8_t getMode(void) const;
477 void setMode(const uint8_t mode);
478
479 bool getPower(void) const;
480 void setPower(const bool on);
481 void on(void);
482 void off(void);
483
484 bool getSleep(void) const;
485 void setSleep(const bool on);
486 bool getHealth(void) const;
487 void setHealth(const bool on);
488
489 bool getTurbo(void) const;
490 void setTurbo(const bool on);
491 bool getQuiet(void) const;
492 void setQuiet(const bool on);
493
494 uint8_t getSwingV(void) const;
495 void setSwingV(const uint8_t pos);
496 uint8_t getSwingH(void) const;
497 void setSwingH(const uint8_t pos);
498
501 uint8_t getSwing(void) const;
502 void setSwing(const uint8_t pos);
503
504 void setTimerMode(const uint8_t setting);
505 uint8_t getTimerMode(void) const;
506 void setOnTimer(const uint16_t mins);
507 uint16_t getOnTimer(void) const;
508 void setOffTimer(const uint16_t mins);
509 uint16_t getOffTimer(void) const;
510
511 bool getLock(void) const;
512 void setLock(const bool on);
513
514 uint8_t* getRaw(void);
515 virtual void setRaw(const uint8_t new_code[]);
516 static bool validChecksum(const uint8_t state[],
517 const uint16_t length = kHaierAC176StateLength);
518 static uint8_t convertMode(const stdAc::opmode_t mode);
519 static uint8_t convertFan(const stdAc::fanspeed_t speed);
520 static uint8_t convertSwingV(const stdAc::swingv_t position);
521 static uint8_t convertSwingH(const stdAc::swingh_t position);
522 static stdAc::opmode_t toCommonMode(const uint8_t mode);
523 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
524 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
525 static stdAc::swingh_t toCommonSwingH(const uint8_t pos);
526 static bool toCommonTurbo(const uint8_t speed);
527 static bool toCommonQuiet(const uint8_t speed);
528 stdAc::state_t toCommon(void) const;
529 String toString(void) const;
530 #ifndef UNIT_TEST
531
532 private:
533 IRsend _irsend;
534 #else // UNIT_TEST
535 IRsendTest _irsend;
537 #endif // UNIT_TEST
539 HaierAc176Protocol _;
540 void checksum(void);
541 };
542
544 class IRHaierACYRW02 : public IRHaierAC176 {
545 public:
546 explicit IRHaierACYRW02(const uint16_t pin, const bool inverted = false,
547 const bool use_modulation = true);
548 #if SEND_HAIER_AC_YRW02
549 void send(const uint16_t repeat = kHaierAcYrw02DefaultRepeat) override;
554 int8_t calibrate(void) { return _irsend.calibrate(); }
555 #endif // SEND_HAIER_AC_YRW02
556 void setRaw(const uint8_t new_code[]) override;
557 static bool validChecksum(
558 const uint8_t state[],
559 const uint16_t length = kHaierACYRW02StateLength);
560 };
561
563 class IRHaierAC160 {
564 public:
565 explicit IRHaierAC160(const uint16_t pin, const bool inverted = false,
566 const bool use_modulation = true);
567 #if SEND_HAIER_AC160
568 virtual void send(const uint16_t repeat = kHaierAc160DefaultRepeat);
573 int8_t calibrate(void) { return _irsend.calibrate(); }
574 #endif // SEND_HAIER_AC160
575 void begin(void);
576 void stateReset(void);
577
578 void setButton(const uint8_t button);
579 uint8_t getButton(void) const;
580
581 void setUseFahrenheit(const bool on);
582 bool getUseFahrenheit(void) const;
583 void setTemp(const uint8_t temp, const bool fahrenheit = false);
584 uint8_t getTemp(void) const;
585
586 void setFan(const uint8_t speed);
587 uint8_t getFan(void) const;
588
589 uint8_t getMode(void) const;
590 void setMode(const uint8_t mode);
591
592 bool getPower(void) const;
593 void setPower(const bool on);
594 void on(void);
595 void off(void);
596
597 bool getSleep(void) const;
598 void setSleep(const bool on);
599 bool getClean(void) const;
600 void setClean(const bool on);
601 bool getLightToggle(void) const;
602 void setLightToggle(const bool on);
603
604 bool getTurbo(void) const;
605 void setTurbo(const bool on);
606 bool getQuiet(void) const;
607 void setQuiet(const bool on);
608 bool getAuxHeating(void) const;
609 void setAuxHeating(const bool on);
610
611 uint8_t getSwingV(void) const;
612 void setSwingV(const uint8_t pos);
613
614 void setTimerMode(const uint8_t setting);
615 uint8_t getTimerMode(void) const;
616 void setOnTimer(const uint16_t mins);
617 uint16_t getOnTimer(void) const;
618 void setOffTimer(const uint16_t mins);
619 uint16_t getOffTimer(void) const;
620
621 bool getLock(void) const;
622 void setLock(const bool on);
623
624 bool getHealth(void) const;
625 void setHealth(const bool on);
626
627 uint8_t* getRaw(void);
628 virtual void setRaw(const uint8_t new_code[]);
629 static bool validChecksum(const uint8_t state[],
630 const uint16_t length = kHaierAC160StateLength);
631 static uint8_t convertMode(const stdAc::opmode_t mode);
632 static uint8_t convertFan(const stdAc::fanspeed_t speed);
633 static uint8_t convertSwingV(const stdAc::swingv_t position);
634 static stdAc::opmode_t toCommonMode(const uint8_t mode);
635 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
636 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
637 static bool toCommonTurbo(const uint8_t speed);
638 static bool toCommonQuiet(const uint8_t speed);
639 stdAc::state_t toCommon(const stdAc::state_t *prev = NULL) const;
640 String toString(void) const;
641 #ifndef UNIT_TEST
642
643 private:
644 IRsend _irsend;
645 #else // UNIT_TEST
646 IRsendTest _irsend;
648 #endif // UNIT_TEST
650 HaierAc160Protocol _;
651 void checksum(void);
652 };
653 #endif // IR_HAIER_H_
IRHaierAC160::getPower
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Haier.cpp:1694
IRHaierAC160::setOnTimer
void setOnTimer(const uint16_t mins)
Set the number of minutes of the On Timer setting.
Definition: ir_Haier.cpp:1856
IRHaierAC160::getUseFahrenheit
bool getUseFahrenheit(void) const
Get the default temperature units in use.
Definition: ir_Haier.cpp:1595
kHaierAc160ButtonClean
const uint8_t kHaierAc160ButtonClean
Definition: ir_Haier.h:199
kHaierAcCmdFan
const uint8_t kHaierAcCmdFan
Definition: ir_Haier.h:82
IRHaierAC176::setButton
void setButton(const uint8_t button)
Set the Button/Command setting of the A/C.
Definition: ir_Haier.cpp:623
kHaierAcFanHigh
const uint8_t kHaierAcFanHigh
Definition: ir_Haier.h:105
IRHaierAC176::getLock
bool getLock(void) const
Get the Lock setting of the A/C.
Definition: ir_Haier.cpp:1020
IRHaierAC160::getSwingV
uint8_t getSwingV(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Haier.cpp:1810
kHaierAcYrw02DefaultRepeat
const uint16_t kHaierAcYrw02DefaultRepeat
Definition: IRremoteESP8266.h:1257
IRHaierAC176::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Haier.cpp:561
kHaierAC160StateLength
const uint16_t kHaierAC160StateLength
Definition: IRremoteESP8266.h:1258
HaierAc160Protocol::AuxHeating
uint8_t AuxHeating
Definition: ir_Haier.h:298
IRHaierAC::getOffTimer
int16_t getOffTimer(void) const
Get the Off Timer value/setting of the A/C.
Definition: ir_Haier.cpp:296
IRHaierAC160::on
void on(void)
Change the power setting to On.
Definition: ir_Haier.cpp:1704
kHaierAcSwingVUp
const uint8_t kHaierAcSwingVUp
Definition: ir_Haier.h:92
IRHaierAC::getMode
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Haier.cpp:230
IRHaierAC160::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:1955
IRHaierAC176::getOffTimer
uint16_t getOffTimer(void) const
Get the number of minutes of the Off Timer setting.
Definition: ir_Haier.cpp:1014
kHaierAcYrw02Fan
const uint8_t kHaierAcYrw02Fan
Definition: ir_Haier.h:183
HaierAc176Protocol::Sleep
uint8_t Sleep
Definition: ir_Haier.h:242
kHaierAcDefaultRepeat
const uint16_t kHaierAcDefaultRepeat
Definition: IRremoteESP8266.h:1254
HaierAc176Protocol::raw
uint8_t raw[kHaierAC176StateLength]
The state in native form.
Definition: ir_Haier.h:210
kHaierAcYrw02FanMed
const uint8_t kHaierAcYrw02FanMed
Definition: ir_Haier.h:175
kHaierAcYrw02SwingVTop
const uint8_t kHaierAcYrw02SwingVTop
Definition: ir_Haier.h:152
kHaierAcAuto
const uint8_t kHaierAcAuto
Definition: ir_Haier.h:96
IRHaierAC160::setSwingV
void setSwingV(const uint8_t pos)
Set the Vertical Swing mode of the A/C.
Definition: ir_Haier.cpp:1814
kHaierAcYrw02ButtonTurbo
const uint8_t kHaierAcYrw02ButtonTurbo
Definition: ir_Haier.h:193
HaierAc176Protocol::Quiet
uint8_t Quiet
Definition: ir_Haier.h:235
IRHaierACYRW02::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Haier.h:554
IRHaierAC160::toCommon
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Haier.cpp:2011
stdAc::swingv_t
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:74
IRHaierAC176::validChecksum
static bool validChecksum(const uint8_t state[], const uint16_t length=kHaierAC176StateLength)
Verify the checksum is valid for a given state.
Definition: ir_Haier.cpp:582
kHaierAcYrw02OnTimer
const uint8_t kHaierAcYrw02OnTimer
Definition: ir_Haier.h:204
kHaierAcYrw02OffThenOnTimer
const uint8_t kHaierAcYrw02OffThenOnTimer
Definition: ir_Haier.h:206
kHaierACStateLength
const uint16_t kHaierACStateLength
Definition: IRremoteESP8266.h:1252
IRHaierACYRW02::validChecksum
static bool validChecksum(const uint8_t state[], const uint16_t length=kHaierACYRW02StateLength)
Verify the checksum is valid for a given state.
Definition: ir_Haier.cpp:1333
IRHaierAC176::getSwingV
uint8_t getSwingV(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Haier.cpp:891
IRHaierAC160::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Haier.h:573
kHaierAcCmdTempDown
const uint8_t kHaierAcCmdTempDown
Definition: ir_Haier.h:84
IRHaierAC::setRaw
void setRaw(const uint8_t new_code[])
Set the internal state from a valid code for this protocol.
Definition: ir_Haier.cpp:162
HaierAc160Protocol::Mode
uint8_t Mode
Definition: ir_Haier.h:308
IRHaierAC::stateReset
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Haier.cpp:143
kHaierAcCmdMode
const uint8_t kHaierAcCmdMode
Definition: ir_Haier.h:81
stdAc::fanspeed_t
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
kHaierAcYrw02ButtonHealth
const uint8_t kHaierAcYrw02ButtonHealth
Definition: ir_Haier.h:192
IRHaierAC160::off
void off(void)
Change the power setting to Off.
Definition: ir_Haier.cpp:1707
kHaierAcYrw02SwingHMiddle
const uint8_t kHaierAcYrw02SwingHMiddle
Definition: ir_Haier.h:167
IRHaierAC::getCurrTime
uint16_t getCurrTime(void) const
Get the clock value of the A/C.
Definition: ir_Haier.cpp:306
IRHaierAC160::setQuiet
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Haier.cpp:1744
IRHaierAC::setFan
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Haier.cpp:193
HaierAc176Protocol::Fan
uint8_t Fan
Definition: ir_Haier.h:231
IRHaierAC176::on
void on(void)
Change the power setting to On.
Definition: ir_Haier.cpp:809
IRHaierAC176::getTurbo
bool getTurbo(void) const
Get the Turbo setting of the A/C.
Definition: ir_Haier.cpp:827
HaierAc176Protocol::Mode
uint8_t Mode
Definition: ir_Haier.h:238
kHaierAcCmdSleep
const uint8_t kHaierAcCmdSleep
Definition: ir_Haier.h:85
IRHaierAC160::stateReset
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Haier.cpp:1513
IRHaierAC176::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Haier.cpp:671
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:376
IRHaierAC160::getTimerMode
uint8_t getTimerMode(void) const
Get the Timer operating mode.
Definition: ir_Haier.cpp:1852
HaierAc176Protocol::OffTimerHrs
uint8_t OffTimerHrs
Definition: ir_Haier.h:230
kHaierAC176StateLength
const uint16_t kHaierAC176StateLength
Definition: IRremoteESP8266.h:1261
HaierProtocol::Prefix
uint8_t Prefix
Definition: ir_Haier.h:41
IRHaierAC160::getOnTimer
uint16_t getOnTimer(void) const
Get the number of minutes of the On Timer setting.
Definition: ir_Haier.cpp:1880
IRHaierAC176::getOnTimer
uint16_t getOnTimer(void) const
Get the number of minutes of the On Timer setting.
Definition: ir_Haier.cpp:984
IRHaierAC::getTemp
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Haier.cpp:254
HaierProtocol::Temp
uint8_t Temp
Definition: ir_Haier.h:44
IRHaierAC::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Haier.cpp:209
HaierAc160Protocol::Prefix
uint8_t Prefix
Definition: ir_Haier.h:330
HaierProtocol::OnTimer
uint8_t OnTimer
Definition: ir_Haier.h:52
kHaierAcYrw02Auto
const uint8_t kHaierAcYrw02Auto
Definition: ir_Haier.h:179
HaierAc176Protocol::ExtraDegreeF
uint8_t ExtraDegreeF
Definition: ir_Haier.h:246
IRHaierAC176::_
HaierAc176Protocol _
Definition: ir_Haier.h:539
HaierAc160Protocol::Health
uint8_t Health
Definition: ir_Haier.h:292
IRHaierAC::getRaw
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Haier.cpp:155
kHaierAcCmdSwing
const uint8_t kHaierAcCmdSwing
Definition: ir_Haier.h:89
IRHaierAC160::getQuiet
bool getQuiet(void) const
Get the Quiet setting of the A/C.
Definition: ir_Haier.cpp:1739
IRHaierAC176::off
void off(void)
Change the power setting to Off.
Definition: ir_Haier.cpp:812
IRHaierAC176::getRaw
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Haier.cpp:610
IRHaierAC176::getUseFahrenheit
bool getUseFahrenheit(void) const
Get the default temperature units in use.
Definition: ir_Haier.cpp:701
kHaierAcSwingVChg
const uint8_t kHaierAcSwingVChg
Definition: ir_Haier.h:94
IRHaierAC176::setTimerMode
void setTimerMode(const uint8_t setting)
Set the Timer operating mode.
Definition: ir_Haier.cpp:937
IRHaierAC176::setSleep
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Haier.cpp:820
IRHaierAC176::toCommonTurbo
static bool toCommonTurbo(const uint8_t speed)
IRHaierAC::setSleep
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Haier.cpp:273
IRHaierAC176::getSwingH
uint8_t getSwingH(void) const
Get the Horizontal Swing position setting of the A/C.
Definition: ir_Haier.cpp:917
HaierAc176Protocol::Power
uint8_t Power
Definition: ir_Haier.h:227
HaierProtocol::CurrMins
uint8_t CurrMins
Definition: ir_Haier.h:50
kHaierAcYrw02DefTempC
const uint8_t kHaierAcYrw02DefTempC
Definition: ir_Haier.h:144
HaierAc176Protocol::Prefix2
uint8_t Prefix2
Definition: ir_Haier.h:259
IRsend.h
IRHaierAC176::setUseFahrenheit
void setUseFahrenheit(const bool on)
Set the default temperature units to use.
Definition: ir_Haier.cpp:697
IRHaierAC176::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Haier.h:457
IRHaierAC176::setTemp
void setTemp(const uint8_t temp, const bool fahrenheit=false)
Set the temperature.
Definition: ir_Haier.cpp:706
HaierProtocol::Mode
uint8_t Mode
Definition: ir_Haier.h:62
IRHaierAC176::setLock
void setLock(const bool on)
Set the Lock setting of the A/C.
Definition: ir_Haier.cpp:1024
IRHaierAC176::toString
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Haier.cpp:1168
IRHaierAC160::getLock
bool getLock(void) const
Get the Lock setting of the A/C.
Definition: ir_Haier.cpp:1916
IRHaierAC160::toCommonTurbo
static bool toCommonTurbo(const uint8_t speed)
kHaierAcYrw02SwingVMiddle
const uint8_t kHaierAcYrw02SwingVMiddle
Definition: ir_Haier.h:153
kHaierAcYrw02SwingVBottom
const uint8_t kHaierAcYrw02SwingVBottom
Definition: ir_Haier.h:154
IRHaierAC160::getRaw
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Haier.cpp:1526
IRHaierAC::setSwingV
void setSwingV(const uint8_t state)
Set the Vertical Swing mode of the A/C.
Definition: ir_Haier.cpp:347
IRHaierAC176::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:1114
IRHaierAC160::setTurbo
void setTurbo(const bool on)
Set the Turbo setting of the A/C.
Definition: ir_Haier.cpp:1727
IRHaierAC::toString
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Haier.cpp:468
kHaierAcCmdTimerSet
const uint8_t kHaierAcCmdTimerSet
Definition: ir_Haier.h:86
IRHaierAC::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Haier.cpp:220
kHaierAcCmdTempUp
const uint8_t kHaierAcCmdTempUp
Definition: ir_Haier.h:83
IRHaierAC::cancelTimers
void cancelTimers(void)
Cancel/disable the On & Off timers.
Definition: ir_Haier.cpp:327
kHaierAc160Prefix
const uint8_t kHaierAc160Prefix
Definition: ir_Haier.h:149
HaierAc160Protocol::Sum
uint8_t Sum
Definition: ir_Haier.h:328
kHaierAc160ButtonLight
const uint8_t kHaierAc160ButtonLight
Definition: ir_Haier.h:197
HaierAc160Protocol::OffTimerHrs
uint8_t OffTimerHrs
Definition: ir_Haier.h:300
HaierAc160Protocol
Native representation of a Haier 160 bit A/C message.
Definition: ir_Haier.h:279
IRHaierAC160::setRaw
virtual void setRaw(const uint8_t new_code[])
Set the internal state from a valid code for this protocol.
Definition: ir_Haier.cpp:1533
IRsend
Class for sending all basic IR protocols.
Definition: IRsend.h:237
IRHaierAC176::getSleep
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Haier.cpp:816
IRHaierAC::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Haier.h:435
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:363
IRHaierAC176::checksum
void checksum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Haier.cpp:572
IRsend::calibrate
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
IRHaierAC176::getPower
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Haier.cpp:799
kHaierAcFanLow
const uint8_t kHaierAcFanLow
Definition: ir_Haier.h:103
kHaierAcYrw02OffTimer
const uint8_t kHaierAcYrw02OffTimer
Definition: ir_Haier.h:203
IRHaierAC176::setTurbo
void setTurbo(const bool on)
Set the Turbo setting of the A/C.
Definition: ir_Haier.cpp:832
kHaierAcYrw02SwingHRightMax
const uint8_t kHaierAcYrw02SwingHRightMax
Definition: ir_Haier.h:171
HaierProtocol::SwingV
uint8_t SwingV
Definition: ir_Haier.h:48
kHaierAc160SwingVHighest
const uint8_t kHaierAc160SwingVHighest
Definition: ir_Haier.h:160
kHaierAcYrw02ModelA
const uint8_t kHaierAcYrw02ModelA
Definition: ir_Haier.h:146
kHaierAc160SwingVHigh
const uint8_t kHaierAc160SwingVHigh
Definition: ir_Haier.h:161
String
std::string String
Definition: IRremoteESP8266.h:1521
IRHaierAC::getHealth
bool getHealth(void) const
Get the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:267
HaierAc160Protocol::OffTimerMins
uint8_t OffTimerMins
Definition: ir_Haier.h:303
IRHaierAC160::validChecksum
static bool validChecksum(const uint8_t state[], const uint16_t length=kHaierAC160StateLength)
IRHaierAC160::getLightToggle
bool getLightToggle(void) const
Get the value of the current Light toggle setting.
Definition: ir_Haier.cpp:1768
kHaierAcYrw02ButtonSleep
const uint8_t kHaierAcYrw02ButtonSleep
Definition: ir_Haier.h:194
IRHaierAC176::setFan
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Haier.cpp:865
kHaierAcPrefix
const uint8_t kHaierAcPrefix
Definition: ir_Haier.h:74
HaierAc160Protocol::OnTimerMins
uint8_t OnTimerMins
Definition: ir_Haier.h:310
IRHaierAC160::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:1941
IRHaierAC176::setRaw
virtual void setRaw(const uint8_t new_code[])
Set the internal state from a valid code for this protocol.
Definition: ir_Haier.cpp:617
IRHaierAC160::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Haier.cpp:1495
kHaierAcYrw02SwingVDown
const uint8_t kHaierAcYrw02SwingVDown
Definition: ir_Haier.h:155
IRHaierAC160::getButton
uint8_t getButton(void) const
Get the Button/Command setting of the A/C.
Definition: ir_Haier.cpp:1560
kHaierACYRW02StateLength
const uint16_t kHaierACYRW02StateLength
Definition: IRremoteESP8266.h:1255
HaierAc176Protocol
Native representation of a Haier 176 bit A/C message.
Definition: ir_Haier.h:209
IRHaierAC::setOnTimer
void setOnTimer(const uint16_t mins)
Set & enable the On Timer.
Definition: ir_Haier.cpp:310
IRHaierAC176::setPower
void setPower(const bool on)
Change the power setting.
Definition: ir_Haier.cpp:803
IRHaierACYRW02::send
void send(const uint16_t repeat=kHaierAcYrw02DefaultRepeat) override
Send the current internal state as an IR message.
Definition: ir_Haier.cpp:1318
kHaierAcYrw02MinTempF
const uint8_t kHaierAcYrw02MinTempF
Definition: ir_Haier.h:142
HaierAc160Protocol::Fan2
uint8_t Fan2
Definition: ir_Haier.h:337
IRHaierAC160::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Haier.cpp:1983
IRremoteESP8266.h
stdAc::swingh_t
swingh_t
Common A/C settings for Horizontal Swing.
Definition: IRsend.h:100
HaierAc176Protocol::Fan2
uint8_t Fan2
Definition: ir_Haier.h:264
IRHaierAC176::getHealth
bool getHealth(void) const
Get the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:795
kHaierAcSwingVDown
const uint8_t kHaierAcSwingVDown
Definition: ir_Haier.h:93
kHaierAcYrw02FanHigh
const uint8_t kHaierAcYrw02FanHigh
Definition: ir_Haier.h:174
kHaierAcFan
const uint8_t kHaierAcFan
Definition: ir_Haier.h:100
kHaierAcYrw02FanLow
const uint8_t kHaierAcYrw02FanLow
Definition: ir_Haier.h:176
kHaierAcYrw02MinTempC
const uint8_t kHaierAcYrw02MinTempC
Definition: ir_Haier.h:140
HaierProtocol::Fan
uint8_t Fan
Definition: ir_Haier.h:59
IRHaierAC::getSwingV
uint8_t getSwingV(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Haier.cpp:341
IRHaierAC176::setHealth
void setHealth(const bool on)
Set the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:788
kHaierAcCool
const uint8_t kHaierAcCool
Definition: ir_Haier.h:97
HaierAc176Protocol::Model
uint8_t Model
Definition: ir_Haier.h:213
IRHaierAC160::setFan
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Haier.cpp:1785
kHaierAcDefTemp
const uint8_t kHaierAcDefTemp
Definition: ir_Haier.h:77
IRHaierAC160::setHealth
void setHealth(const bool on)
Set the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:1799
HaierAc176Protocol::Button
uint8_t Button
Definition: ir_Haier.h:253
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:390
IRHaierAC::getSleep
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Haier.cpp:280
IRHaierAC160::IRHaierAC160
IRHaierAC160(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Haier.cpp:1490
IRHaierAC::setHealth
void setHealth(const bool on)
Set the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:260
HaierAc176Protocol::UseFahrenheit
uint8_t UseFahrenheit
Definition: ir_Haier.h:248
kHaierAcYrw02ButtonTempUp
const uint8_t kHaierAcYrw02ButtonTempUp
Definition: ir_Haier.h:185
IRHaierAC160::toCommonQuiet
static bool toCommonQuiet(const uint8_t speed)
IRHaierAC160::setTimerMode
void setTimerMode(const uint8_t setting)
Set the Timer operating mode.
Definition: ir_Haier.cpp:1833
IRHaierAC176::setSwingH
void setSwingH(const uint8_t pos)
Set the Horizontal Swing mode of the A/C.
Definition: ir_Haier.cpp:921
HaierAc176Protocol::Temp
uint8_t Temp
Definition: ir_Haier.h:216
HaierAc160Protocol::TimerMode
uint8_t TimerMode
Definition: ir_Haier.h:294
HaierAc160Protocol::SwingV
uint8_t SwingV
Definition: ir_Haier.h:285
IRHaierAC160::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Haier.cpp:1970
kHaierAcMinTemp
const uint8_t kHaierAcMinTemp
Definition: ir_Haier.h:76
kHaierAcYrw02ButtonSwingH
const uint8_t kHaierAcYrw02ButtonSwingH
Definition: ir_Haier.h:188
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:137
kHaierAcYrw02SwingVAuto
const uint8_t kHaierAcYrw02SwingVAuto
Definition: ir_Haier.h:156
HaierAc160Protocol::Quiet
uint8_t Quiet
Definition: ir_Haier.h:305
HaierAc160Protocol::Turbo
uint8_t Turbo
Definition: ir_Haier.h:304
HaierAc176Protocol::SwingV
uint8_t SwingV
Definition: ir_Haier.h:215
IRHaierAC::_
HaierProtocol _
Definition: ir_Haier.h:441
IRHaierAC176::getTemp
uint8_t getTemp(void) const
Get the current temperature setting. The unit of temperature is specified by UseFahrenheit value.
Definition: ir_Haier.cpp:743
HaierProtocol::Health
uint8_t Health
Definition: ir_Haier.h:55
kHaierAc176DefaultRepeat
const uint16_t kHaierAc176DefaultRepeat
Definition: IRremoteESP8266.h:1263
HaierAc160Protocol::Lock
uint8_t Lock
Definition: ir_Haier.h:325
IRHaierAC160::getOffTimer
uint16_t getOffTimer(void) const
Get the number of minutes of the Off Timer setting.
Definition: ir_Haier.cpp:1910
IRHaierAC160::setClean
void setClean(const bool on)
Set the Clean setting of the A/C.
Definition: ir_Haier.cpp:1682
IRHaierAC160::getSleep
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Haier.cpp:1711
IRHaierAC176::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Haier.cpp:1102
HaierAc160Protocol::Button
uint8_t Button
Definition: ir_Haier.h:324
IRHaierAC160::getClean
bool getClean(void) const
Get the Clean setting of the A/C.
Definition: ir_Haier.cpp:1690
IRHaierAC176::stateReset
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Haier.cpp:597
IRHaierAC176::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:1045
IRHaierAC176::toCommonQuiet
static bool toCommonQuiet(const uint8_t speed)
HaierAc176Protocol::SwingH
uint8_t SwingH
Definition: ir_Haier.h:219
IRHaierAC160::getTurbo
bool getTurbo(void) const
Get the Turbo setting of the A/C.
Definition: ir_Haier.cpp:1722
kHaierAcCmdHealth
const uint8_t kHaierAcCmdHealth
Definition: ir_Haier.h:88
HaierProtocol::unknown
uint8_t unknown
Definition: ir_Haier.h:47
IRHaierAC160::getAuxHeating
bool getAuxHeating(void) const
Get the value of the Aux Heating setting.
Definition: ir_Haier.cpp:1756
HaierProtocol::CurrHours
uint8_t CurrHours
Definition: ir_Haier.h:46
HaierProtocol::remote_state
uint8_t remote_state[kHaierACStateLength]
< The state in native IR code form
Definition: ir_Haier.h:38
kHaierAc160SwingVMiddle
const uint8_t kHaierAc160SwingVMiddle
Definition: ir_Haier.h:162
HaierAc176Protocol::Health
uint8_t Health
Definition: ir_Haier.h:222
kHaierAcCmdOn
const uint8_t kHaierAcCmdOn
Definition: ir_Haier.h:80
HaierAc176Protocol::Sum
uint8_t Sum
Definition: ir_Haier.h:257
IRHaierAC176::setSwingV
void setSwingV(const uint8_t pos)
Set the Vertical Swing mode of the A/C.
Definition: ir_Haier.cpp:895
kHaierAcYrw02SwingHLeftMax
const uint8_t kHaierAcYrw02SwingHLeftMax
Definition: ir_Haier.h:168
HaierAc160Protocol::Sum2
uint8_t Sum2
Definition: ir_Haier.h:343
IRHaierAC176::getTimerMode
uint8_t getTimerMode(void) const
Get the Timer operating mode.
Definition: ir_Haier.cpp:956
HaierAc160Protocol::ExtraDegreeF
uint8_t ExtraDegreeF
Definition: ir_Haier.h:316
kHaierAcYrw02SwingHRight
const uint8_t kHaierAcYrw02SwingHRight
Definition: ir_Haier.h:170
IRHaierAC176::getButton
uint8_t getButton(void) const
Get the Button/Command setting of the A/C.
Definition: ir_Haier.cpp:665
HaierAc176Protocol::OnTimerHrs
uint8_t OnTimerHrs
Definition: ir_Haier.h:237
kHaierAcYrw02ButtonSwingV
const uint8_t kHaierAcYrw02ButtonSwingV
Definition: ir_Haier.h:187
kHaierAcYrw02ButtonLock
const uint8_t kHaierAcYrw02ButtonLock
Definition: ir_Haier.h:196
HaierAc160Protocol::OnTimerHrs
uint8_t OnTimerHrs
Definition: ir_Haier.h:307
HaierAc160Protocol::Power
uint8_t Power
Definition: ir_Haier.h:297
kHaierAcSwingVOff
const uint8_t kHaierAcSwingVOff
Definition: ir_Haier.h:91
IRHaierAC160::setAuxHeating
void setAuxHeating(const bool on)
Change the Aux Heating setting.
Definition: ir_Haier.cpp:1760
IRHaierAC176::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Haier.cpp:1089
kHaierAcFanMed
const uint8_t kHaierAcFanMed
Definition: ir_Haier.h:104
IRHaierAC160
Class for handling detailed Haier 160 bit A/C messages.
Definition: ir_Haier.h:563
IRHaierAC160::setButton
void setButton(const uint8_t button)
Set the Button/Command setting of the A/C.
Definition: ir_Haier.cpp:1539
kHaierAcYrw02ButtonCFAB
const uint8_t kHaierAcYrw02ButtonCFAB
Definition: ir_Haier.h:200
IRHaierAC176::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Haier.cpp:861
HaierAc176Protocol::Turbo
uint8_t Turbo
Definition: ir_Haier.h:234
IRHaierAC160::_
HaierAc160Protocol _
Definition: ir_Haier.h:650
kHaierAcYrw02ButtonTempDown
const uint8_t kHaierAcYrw02ButtonTempDown
Definition: ir_Haier.h:186
IRHaierAC176::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Haier.h:533
IRHaierAC
Class for handling detailed Haier A/C messages.
Definition: ir_Haier.h:376
kHaierAc160SwingVLowest
const uint8_t kHaierAc160SwingVLowest
Definition: ir_Haier.h:164
HaierProtocol::OnMins
uint8_t OnMins
Definition: ir_Haier.h:64
IRHaierAC176::IRHaierAC176
IRHaierAC176(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Haier.cpp:556
IRHaierAC176::setOffTimer
void setOffTimer(const uint16_t mins)
Set the number of minutes of the Off Timer setting.
Definition: ir_Haier.cpp:990
IRHaierAC::setOffTimer
void setOffTimer(const uint16_t mins)
Set & enable the Off Timer.
Definition: ir_Haier.cpp:319
HaierAc176Protocol::OnTimerMins
uint8_t OnTimerMins
Definition: ir_Haier.h:240
kHaierAcYrw02FanAuto
const uint8_t kHaierAcYrw02FanAuto
Definition: ir_Haier.h:177
kHaierAc176Prefix
const uint8_t kHaierAc176Prefix
Definition: ir_Haier.h:148
kHaierAcMaxTemp
const uint8_t kHaierAcMaxTemp
Definition: ir_Haier.h:78
kHaierAcYrw02ButtonFan
const uint8_t kHaierAcYrw02ButtonFan
Definition: ir_Haier.h:189
kHaierAcYrw02Cool
const uint8_t kHaierAcYrw02Cool
Definition: ir_Haier.h:180
IRHaierAC176
Class for handling detailed Haier 176 bit A/C messages.
Definition: ir_Haier.h:446
IRHaierAC160::convertMode
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Haier.cpp:1928
kHaierAcYrw02ButtonTimer
const uint8_t kHaierAcYrw02ButtonTimer
Definition: ir_Haier.h:195
IRHaierAC::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Haier.cpp:405
IRHaierAC176::setQuiet
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Haier.cpp:849
HaierAc160Protocol::UseFahrenheit
uint8_t UseFahrenheit
Definition: ir_Haier.h:319
HaierProtocol::OffHours
uint8_t OffHours
Definition: ir_Haier.h:54
IRHaierAC176::setSwing
void setSwing(const uint8_t pos)
For backward compatibility. Use setSwingV() instead. Set the Vertical Swing mode of the A/C.
Definition: ir_Haier.cpp:887
kHaierAcFanAuto
const uint8_t kHaierAcFanAuto
Definition: ir_Haier.h:102
kHaierAc160SwingVAuto
const uint8_t kHaierAc160SwingVAuto
Definition: ir_Haier.h:165
HaierAc160Protocol::Model
uint8_t Model
Definition: ir_Haier.h:283
kHaierAcYrw02SwingHLeft
const uint8_t kHaierAcYrw02SwingHLeft
Definition: ir_Haier.h:169
IRHaierAC160::checksum
void checksum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Haier.cpp:1506
kHaierAcYrw02OnThenOffTimer
const uint8_t kHaierAcYrw02OnThenOffTimer
Definition: ir_Haier.h:205
kHaierAcCmdOff
const uint8_t kHaierAcCmdOff
Definition: ir_Haier.h:79
HaierProtocol::Sleep
uint8_t Sleep
Definition: ir_Haier.h:65
HaierAc160Protocol::Temp
uint8_t Temp
Definition: ir_Haier.h:286
IRHaierAC160::setOffTimer
void setOffTimer(const uint16_t mins)
Set the number of minutes of the Off Timer setting.
Definition: ir_Haier.cpp:1886
IRHaierAC160::send
virtual void send(const uint16_t repeat=kHaierAc160DefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Haier.cpp:1500
kHaierAcYrw02SwingHAuto
const uint8_t kHaierAcYrw02SwingHAuto
Definition: ir_Haier.h:172
IRHaierAC::toCommon
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Haier.cpp:441
IRHaierAC160::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Haier.cpp:1781
IRHaierACYRW02::setRaw
void setRaw(const uint8_t new_code[]) override
Set the internal state from a valid code for this protocol.
Definition: ir_Haier.cpp:1325
IRHaierAC176::toCommonSwingH
static stdAc::swingh_t toCommonSwingH(const uint8_t pos)
Convert a stdAc::swingh_t enum into it's native setting.
Definition: ir_Haier.cpp:1128
IRHaierAC176::IRHaierACYRW02
friend class IRHaierACYRW02
Definition: ir_Haier.h:447
IRHaierAC::getOnTimer
int16_t getOnTimer(void) const
Get the On Timer value/setting of the A/C.
Definition: ir_Haier.cpp:286
IRHaierAC176::send
virtual void send(const uint16_t repeat=kHaierAc176DefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Haier.cpp:566
kHaierAcYrw02Heat
const uint8_t kHaierAcYrw02Heat
Definition: ir_Haier.h:182
kHaierAc160SwingVOff
const uint8_t kHaierAc160SwingVOff
Definition: ir_Haier.h:158
IRHaierAC::checksum
void checksum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Haier.cpp:129
IRHaierAC::setCommand
void setCommand(const uint8_t command)
Set the Command/Button setting of the A/C.
Definition: ir_Haier.cpp:168
IRHaierAC160::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Haier.h:644
IRHaierAC::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Haier.h:386
kHaierAc160SwingVTop
const uint8_t kHaierAc160SwingVTop
Definition: ir_Haier.h:159
kHaierAcYrw02MaxTempF
const uint8_t kHaierAcYrw02MaxTempF
Definition: ir_Haier.h:143
kHaierAcSleepBit
const uint8_t kHaierAcSleepBit
Definition: ir_Haier.h:109
kHaierAcDry
const uint8_t kHaierAcDry
Definition: ir_Haier.h:98
IRHaierAC176::setModel
void setModel(const haier_ac176_remote_model_t model)
Set the model of the A/C to emulate.
Definition: ir_Haier.cpp:652
IRHaierAC160::toString
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Haier.cpp:2046
IRHaierAC176::convertMode
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Haier.cpp:1032
HaierAc160Protocol::SwingH
uint8_t SwingH
Definition: ir_Haier.h:289
IRHaierAC160::setUseFahrenheit
void setUseFahrenheit(const bool on)
Set the default temperature units to use.
Definition: ir_Haier.cpp:1591
IRHaierAC160::setLock
void setLock(const bool on)
Set the Lock setting of the A/C.
Definition: ir_Haier.cpp:1920
IRHaierAC160::setLightToggle
void setLightToggle(const bool on)
Set the Light Toggle setting of the A/C.
Definition: ir_Haier.cpp:1775
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:430
kHaierAcYrw02NoTimers
const uint8_t kHaierAcYrw02NoTimers
Definition: ir_Haier.h:202
kHaierAcYrw02ButtonMode
const uint8_t kHaierAcYrw02ButtonMode
Definition: ir_Haier.h:191
kHaierAcHeat
const uint8_t kHaierAcHeat
Definition: ir_Haier.h:99
IRHaierAC176::getSwing
uint8_t getSwing(void) const
These functions are for backward compatibility. Use getSwingV() and setSwingV() instead.
Definition: ir_Haier.cpp:880
HaierAc160Protocol::Sleep
uint8_t Sleep
Definition: ir_Haier.h:312
IRHaierAC160::setPower
void setPower(const bool on)
Change the power setting.
Definition: ir_Haier.cpp:1698
HaierAc176Protocol::Sum2
uint8_t Sum2
Definition: ir_Haier.h:274
HaierProtocol
Native representation of a Haier HSU07-HEA03 A/C message.
Definition: ir_Haier.h:36
IRHaierAC::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Haier.cpp:118
IRHaierAC160::getTemp
uint8_t getTemp(void) const
Get the current temperature setting. The unit of temperature is specified by UseFahrenheit value.
Definition: ir_Haier.cpp:1637
kHaierAcMaxTime
const uint16_t kHaierAcMaxTime
Definition: ir_Haier.h:107
IRHaierAC160::setTemp
void setTemp(const uint8_t temp, const bool fahrenheit=false)
Set the temperature.
Definition: ir_Haier.cpp:1600
IRHaierAC::setCurrTime
void setCurrTime(const uint16_t mins)
Set the clock value for the A/C.
Definition: ir_Haier.cpp:335
HaierAc176Protocol::Lock
uint8_t Lock
Definition: ir_Haier.h:254
IRHaierACYRW02
Class for handling detailed Haier ACYRW02 A/C messages.
Definition: ir_Haier.h:544
IRHaierAC::IRHaierAC
IRHaierAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Haier.cpp:113
IRHaierAC::setTemp
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Haier.cpp:236
IRHaierAC::getCommand
uint8_t getCommand(void) const
Get the Command/Button setting of the A/C.
Definition: ir_Haier.cpp:187
IRHaierAC160::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Haier.cpp:1564
kHaierAc160ButtonAuxHeating
const uint8_t kHaierAc160ButtonAuxHeating
Definition: ir_Haier.h:198
IRHaierAC160::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:1995
IRHaierAC176::setOnTimer
void setOnTimer(const uint16_t mins)
Set the number of minutes of the On Timer setting.
Definition: ir_Haier.cpp:960
IRHaierAC160::getHealth
bool getHealth(void) const
Get the Health (filter) setting of the A/C.
Definition: ir_Haier.cpp:1806
HaierAc160Protocol::Fan
uint8_t Fan
Definition: ir_Haier.h:301
IRHaierAC176::getMode
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Haier.cpp:692
HaierAc176Protocol::TimerMode
uint8_t TimerMode
Definition: ir_Haier.h:224
IRHaierAC176::getQuiet
bool getQuiet(void) const
Get the Quiet setting of the A/C.
Definition: ir_Haier.cpp:844
kHaierAcYrw02Dry
const uint8_t kHaierAcYrw02Dry
Definition: ir_Haier.h:181
HaierProtocol::OnHours
uint8_t OnHours
Definition: ir_Haier.h:61
HaierProtocol::OffTimer
uint8_t OffTimer
Definition: ir_Haier.h:51
stdAc::state_t
Structure to hold a common A/C state.
Definition: IRsend.h:114
IRHaierAC176::getModel
haier_ac176_remote_model_t getModel(void) const
Get/Detect the model of the A/C.
Definition: ir_Haier.cpp:643
HaierAc160Protocol::Clean2
uint8_t Clean2
Definition: ir_Haier.h:333
kHaierAc160SwingVLow
const uint8_t kHaierAc160SwingVLow
Definition: ir_Haier.h:163
kHaierAc160DefaultRepeat
const uint16_t kHaierAc160DefaultRepeat
Definition: IRremoteESP8266.h:1260
HaierProtocol::Command
uint8_t Command
Definition: ir_Haier.h:43
kHaierAcYrw02SwingVOff
const uint8_t kHaierAcYrw02SwingVOff
Definition: ir_Haier.h:151
IRHaierAC176::convertSwingH
static uint8_t convertSwingH(const stdAc::swingh_t position)
Convert a stdAc::swingh_t enum into it's native setting.
Definition: ir_Haier.cpp:1074
HaierProtocol::OffMins
uint8_t OffMins
Definition: ir_Haier.h:58
IRHaierAC160::getMode
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Haier.cpp:1586
HaierProtocol::Sum
uint8_t Sum
Definition: ir_Haier.h:68
IRHaierAC::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Haier.cpp:418
HaierAc160Protocol::raw
uint8_t raw[kHaierAC160StateLength]
The state in native form.
Definition: ir_Haier.h:280
kHaierAcYrw02ButtonPower
const uint8_t kHaierAcYrw02ButtonPower
Definition: ir_Haier.h:190
kHaierAcYrw02ModelB
const uint8_t kHaierAcYrw02ModelB
Definition: ir_Haier.h:147
IRHaierAC160::setSleep
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Haier.cpp:1715
HaierAc160Protocol::Clean
uint8_t Clean
Definition: ir_Haier.h:318
kHaierAcYrw02MaxTempC
const uint8_t kHaierAcYrw02MaxTempC
Definition: ir_Haier.h:141
IRHaierAC176::toCommon
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Haier.cpp:1142
kHaierAcCmdTimerCancel
const uint8_t kHaierAcCmdTimerCancel
Definition: ir_Haier.h:87
HaierAc176Protocol::OffTimerMins
uint8_t OffTimerMins
Definition: ir_Haier.h:233
IRHaierAC176::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:1059
haier_ac176_remote_model_t
haier_ac176_remote_model_t
HAIER_AC176 A/C model numbers.
Definition: IRsend.h:163
stdAc::opmode_t
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49
IRHaierAC::send
void send(const uint16_t repeat=kHaierAcDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Haier.cpp:123