8 static const char *
const TAG =
"coolix.climate";
10 static const uint32_t COOLIX_OFF = 0xB27BE0;
11 static const uint32_t COOLIX_SWING = 0xB26BE0;
12 static const uint32_t COOLIX_LED = 0xB5F5A5;
13 static const uint32_t COOLIX_SILENCE_FP = 0xB5F5B6;
16 static const uint8_t COOLIX_COOL = 0b0000;
17 static const uint8_t COOLIX_DRY_FAN = 0b0100;
18 static const uint8_t COOLIX_AUTO = 0b1000;
19 static const uint8_t COOLIX_HEAT = 0b1100;
20 static const uint32_t COOLIX_MODE_MASK = 0b1100;
21 static const uint32_t COOLIX_FAN_MASK = 0xF000;
22 static const uint32_t COOLIX_FAN_MODE_AUTO_DRY = 0x1000;
23 static const uint32_t COOLIX_FAN_AUTO = 0xB000;
24 static const uint32_t COOLIX_FAN_MIN = 0x9000;
25 static const uint32_t COOLIX_FAN_MED = 0x5000;
26 static const uint32_t COOLIX_FAN_MAX = 0x3000;
30 static const uint8_t COOLIX_FAN_TEMP_CODE = 0b11100000;
31 static const uint32_t COOLIX_TEMP_MASK = 0b11110000;
32 static const uint8_t COOLIX_TEMP_MAP[COOLIX_TEMP_RANGE] = {
50 uint32_t remote_state = 0xB20F00;
54 remote_state = COOLIX_SWING;
58 remote_state |= COOLIX_COOL;
61 remote_state |= COOLIX_HEAT;
64 remote_state |= COOLIX_AUTO;
68 remote_state |= COOLIX_DRY_FAN;
72 remote_state = COOLIX_OFF;
80 remote_state |= COOLIX_FAN_TEMP_CODE;
84 remote_state |= COOLIX_FAN_MODE_AUTO_DRY;
88 remote_state |= COOLIX_FAN_MAX;
91 remote_state |= COOLIX_FAN_MED;
94 remote_state |= COOLIX_FAN_MIN;
98 remote_state |= COOLIX_FAN_AUTO;
104 ESP_LOGV(TAG,
"Sending coolix code: 0x%06" PRIX32, remote_state);
105 this->transmit_<remote_base::CoolixProtocol>(remote_state);
110 if (!decoded.has_value())
113 uint32_t remote_state = (*decoded).second;
114 ESP_LOGV(TAG,
"Decoded 0x%06" PRIX32, remote_state);
115 if ((remote_state & 0xFF0000) != 0xB20000)
118 if (remote_state == COOLIX_OFF) {
120 }
else if (remote_state == COOLIX_SWING) {
124 if ((remote_state & COOLIX_MODE_MASK) == COOLIX_HEAT) {
126 }
else if ((remote_state & COOLIX_MODE_MASK) == COOLIX_AUTO) {
128 }
else if ((remote_state & COOLIX_MODE_MASK) == COOLIX_DRY_FAN) {
129 if ((remote_state & COOLIX_FAN_MASK) == COOLIX_FAN_MODE_AUTO_DRY) {
141 }
else if ((remote_state & COOLIX_FAN_MIN) == COOLIX_FAN_MIN) {
143 }
else if ((remote_state & COOLIX_FAN_MED) == COOLIX_FAN_MED) {
145 }
else if ((remote_state & COOLIX_FAN_MAX) == COOLIX_FAN_MAX) {
150 uint8_t temperature_code = remote_state & COOLIX_TEMP_MASK;
151 for (uint8_t i = 0; i < COOLIX_TEMP_RANGE; i++) {
152 if (COOLIX_TEMP_MAP[i] == temperature_code)
The fan mode is set to Low.
value_type const & value() const
ClimateSwingMode swing_mode
The active swing mode of the climate device.
optional< CoolixData > decode(RemoteReceiveData data) override
float target_temperature
The target temperature of the climate device.
The climate device is set to heat to reach the target temperature.
ClimateMode mode
The active mode of the climate device.
const uint8_t COOLIX_TEMP_MAX
The climate device is set to dry/humidity mode.
const uint8_t COOLIX_TEMP_MIN
The climate device is set to cool to reach the target temperature.
The fan mode is set to Auto.
static bool on_coolix(climate::Climate *parent, remote_base::RemoteReceiveData data)
This static method can be used in other climate components that accept the Coolix protocol...
void transmit_state() override
Transmit via IR the state of this climate controller.
The climate device is set to heat/cool to reach the target temperature.
The fan mode is set to Vertical.
void publish_state()
Publish the state of the climate device, to be called from integrations.
The fan mode is set to High.
The swing mode is set to Off.
The climate device is off.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
Implementation of SPI Controller mode.
The fan mode is set to Medium.
The climate device only has the fan enabled, no heating or cooling is taking place.
ClimateDevice - This is the base class for all climate integrations.