ESPHome 2025.5.0
Loading...
Searching...
No Matches
gree.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome {
6namespace gree {
7
8// Values for GREE IR Controllers
9// Temperature
10const uint8_t GREE_TEMP_MIN = 16; // Celsius
11const uint8_t GREE_TEMP_MAX = 30; // Celsius
12
13// Modes
14const uint8_t GREE_MODE_AUTO = 0x00;
15const uint8_t GREE_MODE_COOL = 0x01;
16const uint8_t GREE_MODE_HEAT = 0x04;
17const uint8_t GREE_MODE_DRY = 0x02;
18const uint8_t GREE_MODE_FAN = 0x03;
19
20const uint8_t GREE_MODE_OFF = 0x00;
21const uint8_t GREE_MODE_ON = 0x08;
22
23// Fan Speed
24const uint8_t GREE_FAN_AUTO = 0x00;
25const uint8_t GREE_FAN_1 = 0x10;
26const uint8_t GREE_FAN_2 = 0x20;
27const uint8_t GREE_FAN_3 = 0x30;
28
29// IR Transmission
30const uint32_t GREE_IR_FREQUENCY = 38000;
31const uint32_t GREE_HEADER_MARK = 9000;
32const uint32_t GREE_HEADER_SPACE = 4000;
33const uint32_t GREE_BIT_MARK = 620;
34const uint32_t GREE_ONE_SPACE = 1600;
35const uint32_t GREE_ZERO_SPACE = 540;
36const uint32_t GREE_MESSAGE_SPACE = 19000;
37
38// Timing specific for YAC features (I-Feel mode)
39const uint32_t GREE_YAC_HEADER_MARK = 6000;
40const uint32_t GREE_YAC_HEADER_SPACE = 3000;
41const uint32_t GREE_YAC_BIT_MARK = 650;
42
43// Timing specific to YAC1FB9
44const uint32_t GREE_YAC1FB9_HEADER_SPACE = 4500;
45const uint32_t GREE_YAC1FB9_MESSAGE_SPACE = 19980;
46
47// State Frame size
48const uint8_t GREE_STATE_FRAME_SIZE = 8;
49
50// Only available on YAN
51// Vertical air directions. Note that these cannot be set on all heat pumps
52const uint8_t GREE_VDIR_AUTO = 0x00;
53const uint8_t GREE_VDIR_MANUAL = 0x00;
54const uint8_t GREE_VDIR_SWING = 0x01;
55const uint8_t GREE_VDIR_UP = 0x02;
56const uint8_t GREE_VDIR_MUP = 0x03;
57const uint8_t GREE_VDIR_MIDDLE = 0x04;
58const uint8_t GREE_VDIR_MDOWN = 0x05;
59const uint8_t GREE_VDIR_DOWN = 0x06;
60
61// Only available on YAC/YAG
62// Horizontal air directions. Note that these cannot be set on all heat pumps
63const uint8_t GREE_HDIR_AUTO = 0x00;
64const uint8_t GREE_HDIR_MANUAL = 0x00;
65const uint8_t GREE_HDIR_SWING = 0x01;
66const uint8_t GREE_HDIR_LEFT = 0x02;
67const uint8_t GREE_HDIR_MLEFT = 0x03;
68const uint8_t GREE_HDIR_MIDDLE = 0x04;
69const uint8_t GREE_HDIR_MRIGHT = 0x05;
70const uint8_t GREE_HDIR_RIGHT = 0x06;
71
72// Only available on YX1FF
73// Turbo (high) fan mode + sleep preset mode
74const uint8_t GREE_FAN_TURBO = 0x80;
75const uint8_t GREE_FAN_TURBO_BIT = 0x10;
76const uint8_t GREE_PRESET_NONE = 0x00;
77const uint8_t GREE_PRESET_SLEEP = 0x01;
78const uint8_t GREE_PRESET_SLEEP_BIT = 0x80;
79
80// Model codes
82
84 public:
91
92 void set_model(Model model);
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};
107
108} // namespace gree
109} // 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
void set_model(Model model)
Definition gree.cpp:9
uint8_t horizontal_swing_()
Definition gree.cpp:189
void transmit_state() override
Definition gree.cpp:19
@ 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.
const uint32_t GREE_IR_FREQUENCY
Definition gree.h:30
const uint8_t GREE_FAN_3
Definition gree.h:27
const uint8_t GREE_PRESET_SLEEP_BIT
Definition gree.h:78
const uint32_t GREE_BIT_MARK
Definition gree.h:33
const uint8_t GREE_FAN_2
Definition gree.h:26
const uint8_t GREE_HDIR_MIDDLE
Definition gree.h:68
const uint8_t GREE_FAN_AUTO
Definition gree.h:24
const uint8_t GREE_VDIR_UP
Definition gree.h:55
const uint32_t GREE_YAC1FB9_MESSAGE_SPACE
Definition gree.h:45
const uint32_t GREE_HEADER_MARK
Definition gree.h:31
const uint8_t GREE_VDIR_AUTO
Definition gree.h:52
const uint32_t GREE_YAC1FB9_HEADER_SPACE
Definition gree.h:44
const uint8_t GREE_FAN_TURBO_BIT
Definition gree.h:75
const uint8_t GREE_MODE_FAN
Definition gree.h:18
const uint8_t GREE_MODE_OFF
Definition gree.h:20
const uint8_t GREE_STATE_FRAME_SIZE
Definition gree.h:48
const uint8_t GREE_TEMP_MIN
Definition gree.h:10
const uint8_t GREE_MODE_AUTO
Definition gree.h:14
const uint8_t GREE_VDIR_SWING
Definition gree.h:54
const uint32_t GREE_YAC_BIT_MARK
Definition gree.h:41
const uint8_t GREE_MODE_ON
Definition gree.h:21
const uint8_t GREE_HDIR_MANUAL
Definition gree.h:64
const uint32_t GREE_YAC_HEADER_MARK
Definition gree.h:39
const uint8_t GREE_MODE_DRY
Definition gree.h:17
const uint32_t GREE_ZERO_SPACE
Definition gree.h:35
const uint8_t GREE_HDIR_SWING
Definition gree.h:65
const uint8_t GREE_PRESET_SLEEP
Definition gree.h:77
const uint8_t GREE_VDIR_MANUAL
Definition gree.h:53
const uint8_t GREE_HDIR_MRIGHT
Definition gree.h:69
const uint8_t GREE_VDIR_MUP
Definition gree.h:56
const uint8_t GREE_HDIR_LEFT
Definition gree.h:66
const uint8_t GREE_HDIR_MLEFT
Definition gree.h:67
const uint8_t GREE_VDIR_MDOWN
Definition gree.h:58
const uint32_t GREE_MESSAGE_SPACE
Definition gree.h:36
@ GREE_YAC1FB9
Definition gree.h:81
@ GREE_GENERIC
Definition gree.h:81
@ GREE_YX1FF
Definition gree.h:81
const uint8_t GREE_MODE_COOL
Definition gree.h:15
const uint8_t GREE_VDIR_MIDDLE
Definition gree.h:57
const uint8_t GREE_TEMP_MAX
Definition gree.h:11
const uint32_t GREE_HEADER_SPACE
Definition gree.h:32
const uint32_t GREE_YAC_HEADER_SPACE
Definition gree.h:40
const uint8_t GREE_HDIR_AUTO
Definition gree.h:63
const uint8_t GREE_VDIR_DOWN
Definition gree.h:59
const uint8_t GREE_MODE_HEAT
Definition gree.h:16
const uint8_t GREE_FAN_TURBO
Definition gree.h:74
const uint8_t GREE_PRESET_NONE
Definition gree.h:76
const uint8_t GREE_FAN_1
Definition gree.h:25
const uint8_t GREE_HDIR_RIGHT
Definition gree.h:70
const uint32_t GREE_ONE_SPACE
Definition gree.h:34
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7