ESPHome 2025.5.0
Loading...
Searching...
No Matches
zhlt01.h
Go to the documentation of this file.
1#pragma once
2
4
5/***********************************************************************************
6 * SOURCE
7 ***********************************************************************************
8 * The IR codes and the functional description below were taken from
9 * 'arduino-heatpumpir/ZHLT01HeatpumpIR.h' as can be found on GitHub
10 * https://github.com/ToniA/arduino-heatpumpir/blob/master/ZHLT01HeatpumpIR.h
11 *
12 ************************************************************************************
13 * Airconditional remote control encoder for:
14 *
15 * ZH/LT-01 Remote control https://www.google.com/search?q=zh/lt-01
16 *
17 * The ZH/LT-01 remote control is used for many locally branded Split
18 * airconditioners, so it is better to name this protocol by the name of the
19 * REMOTE rather then the name of the Airconditioner. For this project I used
20 * a 2014 model Eurom-airconditioner, which is Dutch-branded and sold in
21 * the Netherlands at Hornbach.
22 *
23 * For airco-brands:
24 * Eurom
25 * Chigo
26 * Tristar
27 * Tecnomaster
28 * Elgin
29 * Geant
30 * Tekno
31 * Topair
32 * Proma
33 * Sumikura
34 * JBS
35 * Turbo Air
36 * Nakatomy
37 * Celestial Air
38 * Ager
39 * Blueway
40 * Airlux
41 * Etc.
42 *
43 ***********************************************************************************
44 * SUMMARY FUNCTIONAL DESCRIPTION
45 ***********************************************************************************
46 * The remote sends a 12 Byte message which contains all possible settings every
47 * time.
48 *
49 * Byte 11 (and 10) contain the remote control identifier and are always 0xD5 and
50 * 0x2A respectively for the ZH/LT-01 remote control.
51 * Every UNeven Byte (01,03,05,07 and 09) holds command data
52 * Every EVEN Byte (00,02,04,06,08 and 10) holds a checksum of the corresponding
53 * command-, or identifier-byte by _inverting_ the bits, for example:
54 *
55 * The identifier byte[11] = 0xD5 = B1101 0101
56 * The checksum byte[10] = 0x2A = B0010 1010
57 *
58 * So, you can check the message by:
59 * - inverting the bits of the checksum byte with the corresponding command-, or
60 * identifier byte, they should be the same, or
61 * - Summing up the checksum byte and the corresponding command-, or identifier byte,
62 * they should always add up to 0xFF = B11111111 = 255
63 *
64 * Control bytes:
65 * [01] - Timer (1-24 hours, Off)
66 * Time is hardcoded to OFF
67 *
68 * [03] - LAMP ON/OFF, TURBO ON/OFF, HOLD ON/OFF
69 * Lamp and Hold are hardcoded to OFF
70 * Turbo is used for the BOOST preset
71 *
72 * [05] - Indicates which button the user _pressed_ on the remote control
73 * Hardcoded to POWER-button
74 *
75 * [07] - POWER ON/OFF, FAN AUTO/3/2/1, SLEEP ON/OFF, AIRFLOW ON/OFF,
76 * VERTICAL SWING/WIND/FIXED
77 * SLEEP is used for preset SLEEP
78 * Vertical Swing supports Fixed, Swing and "Wind". The Wind option
79 * is ignored in this implementation
80 *
81 * [09] - MODE AUTO/COOL/VENT/DRY/HEAT, TEMPERATURE (16 - 32°C)
82 *
83 ***********************************************************************************/
84
85namespace esphome {
86namespace zhlt01 {
87
88/********************************************************************************
89 * TIMINGS
90 * Space: Not used
91 * Header Mark: 6100 us
92 * Header Space: 7400 us
93 * Bit Mark: 500 us
94 * Zero Space: 600 us
95 * One Space: 1800 us
96 *
97 * Note : These timings are slightly different than those of ZHLT01HeatpumpIR
98 * The values below were measured by taking the average of 2 different
99 * remote controls each sending 10 commands
100 *******************************************************************************/
101static const uint32_t AC1_HDR_MARK = 6100;
102static const uint32_t AC1_HDR_SPACE = 7400;
103static const uint32_t AC1_BIT_MARK = 500;
104static const uint32_t AC1_ZERO_SPACE = 600;
105static const uint32_t AC1_ONE_SPACE = 1800;
106
107/********************************************************************************
108 *
109 * ZHLT01 codes
110 *
111 *******************************************************************************/
112
113// Power
114static const uint8_t AC1_POWER_OFF = 0x00;
115static const uint8_t AC1_POWER_ON = 0x02;
116
117// Operating Modes
118static const uint8_t AC1_MODE_AUTO = 0x00;
119static const uint8_t AC1_MODE_COOL = 0x20;
120static const uint8_t AC1_MODE_DRY = 0x40;
121static const uint8_t AC1_MODE_FAN = 0x60;
122static const uint8_t AC1_MODE_HEAT = 0x80;
123
124// Fan control
125static const uint8_t AC1_FAN_AUTO = 0x00;
126static const uint8_t AC1_FAN_SILENT = 0x01;
127static const uint8_t AC1_FAN1 = 0x60;
128static const uint8_t AC1_FAN2 = 0x40;
129static const uint8_t AC1_FAN3 = 0x20;
130static const uint8_t AC1_FAN_TURBO = 0x08;
131
132// Vertical Swing
133static const uint8_t AC1_VDIR_WIND = 0x00; // "Natural Wind", ignore
134static const uint8_t AC1_VDIR_SWING = 0x04; // Swing
135static const uint8_t AC1_VDIR_FIXED = 0x08; // Fixed
136
137// Horizontal Swing
138static const uint8_t AC1_HDIR_SWING = 0x00; // Swing
139static const uint8_t AC1_HDIR_FIXED = 0x10; // Fixed
140
141// Temperature range
142static const float AC1_TEMP_MIN = 16.0f;
143static const float AC1_TEMP_MAX = 32.0f;
144static const float AC1_TEMP_INC = 1.0f;
145
165
166} // namespace zhlt01
167} // namespace esphome
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, std::set< climate::ClimateFanMode > fan_modes={}, std::set< climate::ClimateSwingMode > swing_modes={}, std::set< climate::ClimatePreset > presets={})
Definition climate_ir.h:26
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
Definition zhlt01.cpp:136
void transmit_state() override
Transmit via IR the state of this climate controller.
Definition zhlt01.cpp:9
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_PRESET_BOOST
Device is in boost preset.
@ CLIMATE_PRESET_SLEEP
Device is prepared for sleep.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_HORIZONTAL
The fan mode is set to Horizontal.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_SWING_BOTH
The fan mode is set to Both.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7