6static const char *
const TAG =
"ballu.climate";
42 remote_state[0] = 0xc3;
43 remote_state[1] = ((temp - 8) << 3) | (swing_ver ? 0 :
BALLU_SWING_VER);
46 remote_state[11] = 0x1e;
91 remote_state[12] += remote_state[i];
93 ESP_LOGV(TAG,
"Sending: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", remote_state[0],
94 remote_state[1], remote_state[2], remote_state[3], remote_state[4], remote_state[5], remote_state[6],
95 remote_state[7], remote_state[8], remote_state[9], remote_state[10], remote_state[11], remote_state[12]);
99 auto *data = transmit.get_data();
101 data->set_carrier_frequency(38000);
107 for (uint8_t i : remote_state) {
108 for (uint8_t j = 0; j < 8; j++) {
110 bool bit = i & (1 << j);
123 ESP_LOGV(TAG,
"Header fail");
131 for (
int j = 0; j < 8; j++) {
133 remote_state[i] |= 1 << j;
136 ESP_LOGV(TAG,
"Byte %d bit %d fail", i, j);
141 ESP_LOGVV(TAG,
"Byte %d %02X", i, remote_state[i]);
145 ESP_LOGV(TAG,
"Footer fail");
155 ESP_LOGVV(TAG,
"Checksum fail");
159 ESP_LOGV(TAG,
"Received: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", remote_state[0],
160 remote_state[1], remote_state[2], remote_state[3], remote_state[4], remote_state[5], remote_state[6],
161 remote_state[7], remote_state[8], remote_state[9], remote_state[10], remote_state[11], remote_state[12]);
164 if (remote_state[0] != 0xc3)
168 ESP_LOGV(TAG,
"Power: %02X", (remote_state[9] &
BALLU_POWER));
173 auto mode = remote_state[6] & 0xe0;
174 ESP_LOGV(TAG,
"Mode: %02X",
mode);
195 int temp = remote_state[1] & 0xf8;
196 ESP_LOGVV(TAG,
"Temperature Raw: %02X", temp);
197 temp = ((uint8_t) temp >> 3) + 8;
198 ESP_LOGVV(TAG,
"Temperature Climate: %u", temp);
202 auto fan = remote_state[4] & 0xe0;
203 ESP_LOGVV(TAG,
"Fan: %02X", fan);
void transmit_state() override
Transmit via IR the state of this climate controller.
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
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.
RemoteTransmitterBase * transmitter_
const uint16_t BALLU_HEADER_SPACE
const uint16_t BALLU_BIT_MARK
const float YKR_K_002E_TEMP_MIN
const uint8_t BALLU_STATE_LENGTH
const uint32_t BALLU_CARRIER_FREQUENCY
const float YKR_K_002E_TEMP_MAX
const uint8_t BALLU_SWING_VER
const uint8_t BALLU_FAN_LOW
const uint8_t BALLU_FAN_AUTO
const uint16_t BALLU_HEADER_MARK
const uint8_t BALLU_FAN_HIGH
const uint16_t BALLU_ZERO_SPACE
const uint8_t BALLU_POWER
const uint16_t BALLU_ONE_SPACE
const uint8_t BALLU_SWING_HOR
const uint8_t BALLU_FAN_MED
@ 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_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_OFF
The climate device is off.
@ CLIMATE_MODE_AUTO
The climate device is adjusting the temperature dynamically.
@ 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.