7static const char *
const TAG =
"coolix.climate";
9static const uint32_t COOLIX_OFF = 0xB27BE0;
10static const uint32_t COOLIX_SWING = 0xB26BE0;
11static const uint32_t COOLIX_LED = 0xB5F5A5;
12static const uint32_t COOLIX_SILENCE_FP = 0xB5F5B6;
15static const uint8_t COOLIX_COOL = 0b0000;
16static const uint8_t COOLIX_DRY_FAN = 0b0100;
17static const uint8_t COOLIX_AUTO = 0b1000;
18static const uint8_t COOLIX_HEAT = 0b1100;
19static const uint32_t COOLIX_MODE_MASK = 0b1100;
20static const uint32_t COOLIX_FAN_MASK = 0xF000;
21static const uint32_t COOLIX_FAN_MODE_AUTO_DRY = 0x1000;
22static const uint32_t COOLIX_FAN_AUTO = 0xB000;
23static const uint32_t COOLIX_FAN_MIN = 0x9000;
24static const uint32_t COOLIX_FAN_MED = 0x5000;
25static const uint32_t COOLIX_FAN_MAX = 0x3000;
29static const uint8_t COOLIX_FAN_TEMP_CODE = 0b11100000;
30static const uint32_t COOLIX_TEMP_MASK = 0b11110000;
31static const uint8_t COOLIX_TEMP_MAP[COOLIX_TEMP_RANGE] = {
53 remote_state = COOLIX_SWING;
57 remote_state |= COOLIX_COOL;
60 remote_state |= COOLIX_HEAT;
63 remote_state |= COOLIX_AUTO;
67 remote_state |= COOLIX_DRY_FAN;
71 remote_state = COOLIX_OFF;
79 remote_state |= COOLIX_FAN_TEMP_CODE;
83 remote_state |= COOLIX_FAN_MODE_AUTO_DRY;
87 remote_state |= COOLIX_FAN_MAX;
90 remote_state |= COOLIX_FAN_MED;
93 remote_state |= COOLIX_FAN_MIN;
97 remote_state |= COOLIX_FAN_AUTO;
103 ESP_LOGV(TAG,
"Sending coolix code: 0x%06" PRIX32, remote_state);
109 if (!decoded.has_value())
112 uint32_t remote_state = (*decoded).second;
113 ESP_LOGV(TAG,
"Decoded 0x%06" PRIX32, remote_state);
114 if ((remote_state & 0xFF0000) != 0xB20000)
117 if (remote_state == COOLIX_OFF) {
119 }
else if (remote_state == COOLIX_SWING) {
123 if ((remote_state & COOLIX_MODE_MASK) == COOLIX_HEAT) {
125 }
else if ((remote_state & COOLIX_MODE_MASK) == COOLIX_AUTO) {
127 }
else if ((remote_state & COOLIX_MODE_MASK) == COOLIX_DRY_FAN) {
128 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)
ClimateDevice - This is the base class for all climate integrations.
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
float target_temperature
The target temperature of the climate device.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
void publish_state()
Publish the state of the climate device, to be called from integrations.
void transmit_state() override
Transmit via IR the state of this climate controller.
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.
optional< CoolixData > decode(RemoteReceiveData data) override
void transmit_(const Protocol::ProtocolData &data, uint32_t send_times=1, uint32_t send_wait=0)
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_ON
The fan mode is set to On.
@ 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 uint8_t COOLIX_TEMP_MAX
const uint8_t COOLIX_TEMP_MIN