ESPHome  2024.12.2
smartair2_packet.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace esphome {
4 namespace haier {
5 namespace smartair2_protocol {
6 
7 enum class ConditioningMode : uint8_t { AUTO = 0x00, COOL = 0x01, HEAT = 0x02, FAN = 0x03, DRY = 0x04 };
8 
9 enum class FanMode : uint8_t { FAN_HIGH = 0x00, FAN_MID = 0x01, FAN_LOW = 0x02, FAN_AUTO = 0x03 };
10 
12  // Control bytes starts here
13  // 10
14  uint8_t : 8; // Temperature high byte
15  // 11
16  uint8_t room_temperature; // current room temperature 1°C step
17  // 12
18  uint8_t : 8; // Humidity high byte
19  // 13
20  uint8_t room_humidity; // Humidity 0%-100% with 1% step
21  // 14
22  uint8_t : 8;
23  // 15
24  uint8_t cntrl; // In AC => ESP packets - 0x7F, in ESP => AC packets - 0x00
25  // 16
26  uint8_t : 8;
27  // 17
28  uint8_t : 8;
29  // 18
30  uint8_t : 8;
31  // 19
32  uint8_t : 8;
33  // 20
34  uint8_t : 8;
35  // 21
36  uint8_t ac_mode; // See enum ConditioningMode
37  // 22
38  uint8_t : 8;
39  // 23
40  uint8_t fan_mode; // See enum FanMode
41  // 24
42  uint8_t : 8;
43  // 25
44  uint8_t swing_mode; // In normal mode: If 1 - swing both direction, if 0 - horizontal_swing and
45  // vertical_swing define vertical/horizontal/off
46  // In alternative mode: 0 - off, 01 - vertical, 02 - horizontal, 03 - both
47  // 26
48  uint8_t : 3;
49  uint8_t use_fahrenheit : 1;
50  uint8_t : 3;
51  uint8_t lock_remote : 1; // Disable remote
52  // 27
53  uint8_t ac_power : 1; // Is ac on or off
54  uint8_t : 2;
55  uint8_t health_mode : 1; // Health mode on or off
56  uint8_t compressor : 1; // Compressor on or off ???
57  uint8_t half_degree : 1; // Use half degree
58  uint8_t ten_degree : 1; // 10 degree status (only work in heat mode)
59  uint8_t : 0;
60  // 28
61  uint8_t : 8;
62  // 29
63  uint8_t use_swing_bits : 1; // Indicate if horizontal_swing and vertical_swing should be used
64  uint8_t turbo_mode : 1; // Turbo mode
65  uint8_t quiet_mode : 1; // Sleep mode
66  uint8_t horizontal_swing : 1; // Horizontal swing (if swing_both == 0)
67  uint8_t vertical_swing : 1; // Vertical swing (if swing_both == 0) if vertical_swing and horizontal_swing both 0 =>
68  // swing off
69  uint8_t display_status : 1; // Led on or off
70  uint8_t : 0;
71  // 30
72  uint8_t : 8;
73  // 31
74  uint8_t : 8;
75  // 32
76  uint8_t : 8; // Target temperature high byte
77  // 33
78  uint8_t set_point; // Target temperature with 16°C offset, 1°C step
79 };
80 
81 struct HaierStatus {
82  uint16_t subcommand;
84 };
85 
86 } // namespace smartair2_protocol
87 } // namespace haier
88 } // namespace esphome
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7