ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
gree.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome::gree {
6
7// Values for GREE IR Controllers
8// Temperature
9static constexpr uint8_t GREE_TEMP_MIN = 16; // Celsius
10static constexpr uint8_t GREE_TEMP_MAX = 30; // Celsius
11
12// Modes
13static constexpr uint8_t GREE_MODE_AUTO = 0x00;
14static constexpr uint8_t GREE_MODE_COOL = 0x01;
15static constexpr uint8_t GREE_MODE_HEAT = 0x04;
16static constexpr uint8_t GREE_MODE_DRY = 0x02;
17static constexpr uint8_t GREE_MODE_FAN = 0x03;
18
19static constexpr uint8_t GREE_MODE_OFF = 0x00;
20static constexpr uint8_t GREE_MODE_ON = 0x08;
21
22// Fan Speed
23static constexpr uint8_t GREE_FAN_AUTO = 0x00;
24static constexpr uint8_t GREE_FAN_1 = 0x10;
25static constexpr uint8_t GREE_FAN_2 = 0x20;
26static constexpr uint8_t GREE_FAN_3 = 0x30;
27
28// IR Transmission
29static constexpr uint32_t GREE_IR_FREQUENCY = 38000;
30static constexpr uint32_t GREE_HEADER_MARK = 9000;
31static constexpr uint32_t GREE_HEADER_SPACE = 4000;
32static constexpr uint32_t GREE_BIT_MARK = 620;
33static constexpr uint32_t GREE_ONE_SPACE = 1600;
34static constexpr uint32_t GREE_ZERO_SPACE = 540;
35static constexpr uint32_t GREE_MESSAGE_SPACE = 19000;
36
37// Timing specific for YAC features (I-Feel mode)
38static constexpr uint32_t GREE_YAC_HEADER_MARK = 6000;
39static constexpr uint32_t GREE_YAC_HEADER_SPACE = 3000;
40static constexpr uint32_t GREE_YAC_BIT_MARK = 650;
41
42// Timing specific to YAC1FB9
43static constexpr uint32_t GREE_YAC1FB9_HEADER_SPACE = 4500;
44static constexpr uint32_t GREE_YAC1FB9_MESSAGE_SPACE = 19980;
45
46// State Frame size
47static constexpr uint8_t GREE_STATE_FRAME_SIZE = 8;
48
49// Only available on YAN
50// Vertical air directions. Note that these cannot be set on all heat pumps
51static constexpr uint8_t GREE_VDIR_AUTO = 0x00;
52static constexpr uint8_t GREE_VDIR_MANUAL = 0x00;
53static constexpr uint8_t GREE_VDIR_SWING = 0x01;
54static constexpr uint8_t GREE_VDIR_UP = 0x02;
55static constexpr uint8_t GREE_VDIR_MUP = 0x03;
56static constexpr uint8_t GREE_VDIR_MIDDLE = 0x04;
57static constexpr uint8_t GREE_VDIR_MDOWN = 0x05;
58static constexpr uint8_t GREE_VDIR_DOWN = 0x06;
59
60// Only available on YAC/YAG
61// Horizontal air directions. Note that these cannot be set on all heat pumps
62static constexpr uint8_t GREE_HDIR_AUTO = 0x00;
63static constexpr uint8_t GREE_HDIR_MANUAL = 0x00;
64static constexpr uint8_t GREE_HDIR_SWING = 0x01;
65static constexpr uint8_t GREE_HDIR_LEFT = 0x02;
66static constexpr uint8_t GREE_HDIR_MLEFT = 0x03;
67static constexpr uint8_t GREE_HDIR_MIDDLE = 0x04;
68static constexpr uint8_t GREE_HDIR_MRIGHT = 0x05;
69static constexpr uint8_t GREE_HDIR_RIGHT = 0x06;
70
71// Only available on YX1FF
72// Turbo (high) fan mode + sleep preset mode
73static constexpr uint8_t GREE_FAN_TURBO = 0x80;
74static constexpr uint8_t GREE_FAN_TURBO_BIT = 0x10;
75static constexpr uint8_t GREE_PRESET_NONE = 0x00;
76static constexpr uint8_t GREE_PRESET_SLEEP = 0x01;
77static constexpr uint8_t GREE_PRESET_SLEEP_BIT = 0x80;
78
79// Model codes
81
83 public:
90
91 void set_model(Model model);
92 void set_mode_bit(uint8_t bit_mask, bool enabled);
93
94 protected:
95 // Transmit via IR the state of this climate controller.
96 void transmit_state() override;
97
98 uint8_t operation_mode_();
99 uint8_t fan_speed_();
100 uint8_t horizontal_swing_();
101 uint8_t vertical_swing_();
102 uint8_t temperature_();
103 uint8_t preset_();
104
106 uint8_t mode_bits_{0}; // Combined mode bits for remote_state[2]
107};
108
109} // namespace esphome::gree
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, climate::ClimateFanModeMask fan_modes=climate::ClimateFanModeMask(), climate::ClimateSwingModeMask swing_modes=climate::ClimateSwingModeMask(), climate::ClimatePresetMask presets=climate::ClimatePresetMask())
Definition climate_ir.h:26
void set_mode_bit(uint8_t bit_mask, bool enabled)
Definition gree.cpp:19
void set_model(Model model)
Definition gree.cpp:9
uint8_t horizontal_swing_()
Definition gree.cpp:211
void transmit_state() override
Definition gree.cpp:28
@ 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.
@ GREE_YAC1FB9
Definition gree.h:80
@ GREE_GENERIC
Definition gree.h:80
@ GREE_YX1FF
Definition gree.h:80