-
Notifications
You must be signed in to change notification settings - Fork 144
/
KY26HeatpumpIR.h
77 lines (67 loc) · 2.29 KB
/
KY26HeatpumpIR.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// KY-26 Remote protocol
//
// The KY-26 remote control is used in locally branded air conditioners.
// I used a ZAICON air conditioner, which also seems to be rebranded as
// SACOM, SENCYS, and possibly others.
//
// The remote sends a 4-byte message which contains all possible settings every
// time.
//
// Byte 0 contains the a power signal, operating mode, and fan speed.
// Byte 1 contains the temperature setting.
// Byte 2 contains the timer setting.
// Byte 3 contains the checksum.
//
// MSB LSB
// ??FF PPOO ??TT TTTT ???t tttt CCCC CCCC
// 0000 0000 0000 0000 0000 0000 0000 0000
// | | | || | | |
// | | | || | | +--- Checksum
// | | | || | |
// | | | || | +--- Temperature (15 = 0, 16 = 16, ..., 31 = 31)
// | | | || |
// | | | || +--- Timer hours (0 = off, 1 = 1 hour, ..., 12 = 12 hours)
// | | | |+----- Timer half hour
// | | | +------ Timer on
// | | |
// | | +--- Operating mode (0 auto, 1 cool, 2 dry, 3 fan)
// | +----- Power (2 Toggle, 3 Turn off)
// +-------- Fan speed (1 min, 2 mid, 3 max)
//
#ifndef KY26HeatpumpIR_h
#define KY26HeatpumpIR_h
#include <HeatpumpIR.h>
// Timing constants
#define KY26_HDR_MARK 9600
#define KY26_HDR_SPACE 6100
#define KY26_BIT_MARK 500
#define KY26_ONE_SPACE 1700
#define KY26_ZERO_SPACE 500
// Power modes
#define KY26_POWER_ONOFF 0x08
#define KY26_POWER_OFF 0x0C
// Operating modes
#define KY26_MODE_AUTO 0x00
#define KY26_MODE_COOL 0x01
#define KY26_MODE_DRY 0x02
#define KY26_MODE_FAN 0x03
// Fan speeds
#define KY26_FAN1 0x10 // * low
#define KY26_FAN2 0x20 // * med
#define KY26_FAN3 0x30 // * high
// Timer
#define KY26_TIMER_ON 0x20
#define KY26_TIMER_OFF 0x00
#define KY26_TIMER_HALF_HOUR 0x10
class KY26HeatpumpIR : public HeatpumpIR {
public:
KY26HeatpumpIR();
void send(IRSender &IR, uint8_t powerModeCmd, uint8_t operatingModeCmd,
uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd,
uint8_t swingHCmd, uint8_t timerHourCmd = 0x00,
bool timerHalfHourCmd = false);
protected:
void sendKY26(IRSender &IR, uint8_t powerModeCmd, uint8_t operatingModeCmd,
uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t timerCmd);
};
#endif // KY26HeatpumpIR_h