ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
hon_packet.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
6
7enum class VerticalSwingMode : uint8_t {
8 HEALTH_UP = 0x01,
9 MAX_UP = 0x02,
10 HEALTH_DOWN = 0x03,
11 UP = 0x04,
12 CENTER = 0x06,
13 DOWN = 0x08,
14 MAX_DOWN = 0x0A,
15 AUTO = 0x0C,
16 // Auto for special modes
17 AUTO_SPECIAL = 0x0E
18};
19
20enum class HorizontalSwingMode : uint8_t {
21 CENTER = 0x00,
22 MAX_LEFT = 0x03,
23 LEFT = 0x04,
24 RIGHT = 0x05,
25 MAX_RIGHT = 0x06,
26 AUTO = 0x07
27};
28
29enum class ConditioningMode : uint8_t {
30 AUTO = 0x00,
31 COOL = 0x01,
32 DRY = 0x02,
33 HEALTHY_DRY = 0x03,
34 HEAT = 0x04,
35 ENERGY_SAVING = 0x05,
36 FAN = 0x06
37};
38
39enum class DataParameters : uint8_t {
40 AC_POWER = 0x01,
41 SET_POINT = 0x02,
43 AC_MODE = 0x04,
44 FAN_MODE = 0x05,
45 USE_FAHRENHEIT = 0x07,
46 DISPLAY_STATUS = 0x09,
47 TEN_DEGREE = 0x0A,
48 HEALTH_MODE = 0x0B,
50 SELF_CLEANING = 0x0D,
51 BEEPER_STATUS = 0x16,
52 LOCK_REMOTE = 0x17,
53 QUIET_MODE = 0x19,
54 FAST_MODE = 0x1A,
55 SLEEP_MODE = 0x1B,
56};
57
58enum class SpecialMode : uint8_t { NONE = 0x00, ELDERLY = 0x01, CHILDREN = 0x02, PREGNANT = 0x03 };
59
60enum class FanMode : uint8_t { FAN_HIGH = 0x01, FAN_MID = 0x02, FAN_LOW = 0x03, FAN_AUTO = 0x05 };
61
63 // Control bytes starts here
64 // 1
65 uint8_t set_point; // Target temperature with 16°C offset (0x00 = 16°C)
66 // 2
67 uint8_t vertical_swing_mode : 4; // See enum VerticalSwingMode
68 uint8_t : 0;
69 // 3
70 uint8_t fan_mode : 3; // See enum FanMode
71 uint8_t special_mode : 2; // See enum SpecialMode
72 uint8_t ac_mode : 3; // See enum ConditioningMode
73 // 4
74 uint8_t : 8;
75 // 5
76 uint8_t ten_degree : 1; // 10 degree status
77 uint8_t display_status : 1; // If 0 disables AC's display
78 uint8_t half_degree : 1; // Use half degree
79 uint8_t intelligence_status : 1; // Intelligence status
80 uint8_t pmv_status : 1; // Comfort/PMV status
81 uint8_t use_fahrenheit : 1; // Use Fahrenheit instead of Celsius
82 uint8_t : 1;
83 uint8_t steri_clean : 1;
84 // 6
85 uint8_t ac_power : 1; // Is ac on or off
86 uint8_t health_mode : 1; // Health mode (negative ions) on or off
87 uint8_t electric_heating_status : 1; // Electric heating status
88 uint8_t fast_mode : 1; // Fast mode
89 uint8_t quiet_mode : 1; // Quiet mode
90 uint8_t sleep_mode : 1; // Sleep mode
91 uint8_t lock_remote : 1; // Disable remote
92 uint8_t beeper_status : 1; // If 1 disables AC's command feedback beeper (need to be set on every control command)
93 // 7
94 uint8_t target_humidity; // Target humidity (0=30% .. 3C=90%, step = 1%)
95 // 8
96 uint8_t horizontal_swing_mode : 3; // See enum HorizontalSwingMode
97 uint8_t : 3;
98 uint8_t human_sensing_status : 2; // Human sensing status
99 // 9
100 uint8_t change_filter : 1; // Filter need replacement
101 uint8_t : 0;
102 // 10
103 uint8_t fresh_air_status : 1; // Fresh air status
104 uint8_t humidification_status : 1; // Humidification status
105 uint8_t pm2p5_cleaning_status : 1; // PM2.5 cleaning status
106 uint8_t ch2o_cleaning_status : 1; // CH2O cleaning status
107 uint8_t self_cleaning_status : 1; // Self cleaning status
108 uint8_t light_status : 1; // Light status
109 uint8_t energy_saving_status : 1; // Energy saving status
110 uint8_t cleaning_time_status : 1; // Cleaning time (0 - accumulation, 1 - clear)
111};
112
114 // 11
115 uint8_t room_temperature; // 0.5°C step
116 // 12
117 uint8_t room_humidity; // 0%-100% with 1% step
118 // 13
119 uint8_t outdoor_temperature; // 1°C step, -64°C offset (0=-64°C)
120 // 14
121 uint8_t pm2p5_level : 2; // Indoor PM2.5 grade (00: Excellent, 01: good, 02: Medium, 03: Bad)
122 uint8_t air_quality : 2; // Air quality grade (00: Excellent, 01: good, 02: Medium, 03: Bad)
123 uint8_t human_sensing : 2; // Human presence result (00: N/A, 01: not detected, 02: One, 03: Multiple)
124 uint8_t : 1;
125 uint8_t ac_type : 1; // 00 - Heat and cool, 01 - Cool only)
126 // 15
127 uint8_t error_status; // See enum ErrorStatus
128 // 16
129 uint8_t operation_source : 2; // who is controlling AC (00: Other, 01: Remote control, 02: Button, 03: ESP)
130 uint8_t operation_mode_hk : 2; // Homekit only, operation mode (00: Cool, 01: Dry, 02: Heat, 03: Fan)
131 uint8_t : 3;
132 uint8_t err_confirmation : 1; // If 1 clear error status
133 // 17
134 uint16_t total_cleaning_time; // Cleaning cumulative time (1h step)
135 // 19
136 uint16_t indoor_pm2p5_value; // Indoor PM2.5 value (0 ug/m3 - 4095 ug/m3, 1 ug/m3 step)
137 // 21
138 uint16_t outdoor_pm2p5_value; // Outdoor PM2.5 value (0 ug/m3 - 4095 ug/m3, 1 ug/m3 step)
139 // 23
140 uint16_t ch2o_value; // Formaldehyde value (0 ug/m3 - 10000 ug/m3, 1 ug/m3 step)
141 // 25
142 uint16_t voc_value; // VOC value (Volatile Organic Compounds) (0 ug/m3 - 1023 ug/m3, 1 ug/m3 step)
143 // 27
144 uint16_t co2_value; // CO2 value (0 PPM - 10000 PPM, 1 PPM step)
145};
146
148 // 29
149 uint8_t power[2]; // AC power consumption (0W - 65535W, 1W step)
150 // 31
151 uint8_t indoor_coil_temperature; // 0.5°C step, -20°C offset (0=-20°C)
152 // 32
153 uint8_t outdoor_out_air_temperature; // 1°C step, -64°C offset (0=-64°C)
154 // 33
155 uint8_t outdoor_coil_temperature; // 1°C step, -64°C offset (0=-64°C)
156 // 34
157 uint8_t outdoor_in_air_temperature; // 1°C step, -64°C offset (0=-64°C)
158 // 35
159 uint8_t outdoor_defrost_temperature; // 1°C step, -64°C offset (0=-64°C)
160 // 36
161 uint8_t compressor_frequency; // 1Hz step, 0Hz - 127Hz
162 // 37
163 uint8_t compressor_current[2]; // 0.1A step, 0.0A - 51.1A (0x0000 - 0x01FF)
164 // 39
165 uint8_t outdoor_fan_status : 2; // 0 - off, 1 - on, 2 - information not available
166 uint8_t defrost_status : 2; // 0 - off, 1 - on, 2 - information not available
167 uint8_t : 0;
168 // 40
169 uint8_t compressor_status : 2; // 0 - off, 1 - on, 2 - information not available
170 uint8_t indoor_fan_status : 2; // 0 - off, 1 - on, 2 - information not available
171 uint8_t four_way_valve_status : 2; // 0 - off, 1 - on, 2 - information not available
172 uint8_t indoor_electric_heating_status : 2; // 0 - off, 1 - on, 2 - information not available
173 // 41
174 uint8_t expansion_valve_open_degree[2]; // 0 - 4095
175};
176
180 uint8_t encryption[3];
182 uint8_t : 8;
183 char device_name[8];
184 uint8_t functions[2];
185};
186
187enum class SubcommandsControl : uint16_t {
188 GET_PARAMETERS = 0x4C01, // Request specific parameters (packet content: parameter ID1 + parameter ID2 + ...)
189 GET_USER_DATA = 0x4D01, // Request all user data from device (packet content: None)
190 GET_BIG_DATA = 0x4DFE, // Request big data information from device (packet content: None)
191 SET_PARAMETERS = 0x5C01, // Set parameters of the device and device return parameters (packet content: parameter ID1
192 // + parameter data1 + parameter ID2 + parameter data 2 + ...)
193 SET_SINGLE_PARAMETER = 0x5D00, // Set single parameter (0x5DXX second byte define parameter ID) and return all user
194 // data (packet content: ???)
195 SET_GROUP_PARAMETERS = 0x6001, // Set group parameters to device (0x60XX second byte define parameter is group ID,
196 // the only group mentioned in document is 1) and return all user data (packet
197 // content: all values like in status packet)
198};
199
200} // namespace esphome::haier::hon_protocol