43 remote_state[0] = 0xc3;
44 remote_state[1] = ((temp - 8) << 3) | (swing_ver ? 0 :
BALLU_SWING_VER);
47 remote_state[11] = 0x1e;
92 remote_state[12] += remote_state[i];
98 auto *data = transmit.get_data();
100 data->set_carrier_frequency(38000);
116 ESP_LOGV(TAG,
"Header fail");
122 ESP_LOGV(TAG,
"Data fail");
127 ESP_LOGV(TAG,
"Footer fail");
134 ESP_LOGVV(TAG,
"Checksum fail");
141 if (remote_state[0] != 0xc3)
145 ESP_LOGV(TAG,
"Power: %02X", (remote_state[9] &
BALLU_POWER));
150 auto mode = remote_state[6] & 0xe0;
151 ESP_LOGV(TAG,
"Mode: %02X",
mode);
174 int temp = remote_state[1] & 0xf8;
175 ESP_LOGVV(TAG,
"Temperature Raw: %02X", temp);
176 temp = ((uint8_t) temp >> 3) + 8;
177 ESP_LOGVV(TAG,
"Temperature Climate: %u", temp);
181 auto fan = remote_state[4] & 0xe0;
182 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
ESPHOME_LOG_TAG(TAG, "ballu.climate")
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 uint8_t BALLU_POWER
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.
constexpr uint8_t sum_bytes(const uint8_t *data, size_t len, uint8_t sum=0)
Add up the bytes of data with size len, truncated to 8 bits: the checksum many serial and IR protocol...
A bit is a mark (one_mark or zero_mark, both bit_mark unless set) and a space (one_space or zero_spac...