25 uint8_t remote_header[8] = {0x11, 0xDA, 0x27, 0x00, 0x84, 0x87, 0x20, 0x00};
28 for (
size_t i = 0; i <
sizeof(remote_header) - 1; i++) {
29 remote_header[
sizeof(remote_header) - 1] += remote_header[i];
33 auto *data = transmit.get_data();
42 data->item_bytes<DAIKIN_BIT_TIMINGS>(remote_header,
sizeof(remote_header));
52 uint8_t remote_header[20] = {0x11, 0xDA, 0x27, 0x00, 0x02, 0xd0, 0x02, 0x03, 0x80, 0x03, 0x82, 0x30, 0x41, 0x1f, 0x82,
56 0x00, 0x24, 0x00, 0x00};
70 uint8_t remote_state[19] = {
71 0x11, 0xDA, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x0a, 0xC4,
88 ESP_LOGD(TAG,
"Set Humditiy: %d, %d\n", (
int) this->
target_humidity, (
int) remote_state[7]);
89 remote_header[9] |= 0x10;
93 remote_state[8] = fan_speed >> 8;
94 remote_state[9] = fan_speed & 0xff;
97 for (
size_t i = 0; i <
sizeof(remote_header) - 1; i++) {
98 remote_header[
sizeof(remote_header) - 1] += remote_header[i];
107 auto *data = transmit.get_data();
116 data->item_bytes<DAIKIN_BIT_TIMINGS>(remote_header,
sizeof(remote_header));
123 data->item_bytes<DAIKIN_BIT_TIMINGS>(remote_state,
sizeof(remote_state));
132 switch (this->
mode) {
154 return operating_mode;
193 switch (this->
mode) {
201 uint8_t
temperature = (uint8_t) std::floor(new_temp);
233 ESP_LOGI(TAG,
"checksum error");
240 pos = buf_append_printf(buf,
sizeof(buf),
pos,
"%02x ", frame[i]);
242 ESP_LOGD(TAG,
"FRAME %s", buf);
244 uint8_t
mode = frame[5];
246 switch (
mode & 0xF0) {
326 bool valid_daikin_frame =
false;
328 valid_daikin_frame =
true;
329 size_t bytes_count = data.size() / 2 / 8;
331 char buf[40 * 3 + 1] = {};
332 constexpr size_t buf_size =
sizeof(buf);
334 for (
size_t i = 0; i < bytes_count; i++) {
336 for (int8_t bit = 0; bit < 8; bit++) {
340 valid_daikin_frame =
false;
344 buf_pos = buf_append_printf(buf, buf_size, buf_pos,
"%02x ",
byte);
346 ESP_LOGD(TAG,
"WHOLE FRAME %s size: %d", buf, data.size());
348 if (!valid_daikin_frame) {
349 char sbuf[16 * 10 + 1] = {0};
351 for (
size_t j = 0; j < static_cast<size_t>(data.size()); j++) {
352 if ((j - 2) % 16 == 0) {
354 ESP_LOGD(TAG,
"DATA %04x: %s", (j - 16 > 0xffff ? 0 : j - 16), sbuf);
373 if (
static_cast<int32_t
>(DAIKIN_DBG_LOWER(
DAIKIN_BIT_MARK)) <= data[j] &&
383 if (abs(data[j]) > 100000) {
384 sbuf_pos = buf_append_printf(sbuf,
sizeof(sbuf), sbuf_pos,
"%-5d[%c] ", data[j] > 0 ? 99999 : -99999, type_ch);
387 buf_append_printf(sbuf,
sizeof(sbuf), sbuf_pos,
"%-5d[%c] ", (
int) (round(data[j] / 10.) * 10), type_ch);
389 if (j + 1 ==
static_cast<size_t>(data.size())) {
390 ESP_LOGD(TAG,
"DATA %04x: %s", (j - 8 > 0xffff ? 0 : j - 8), sbuf);
398 ESP_LOGI(TAG,
"non daikin_arc expect item");
403 if (!data.expect_bytes<DAIKIN_BIT_TIMINGS>(&state_frame[
pos], 1)) {
404 ESP_LOGI(TAG,
"non daikin_arc expect item pos: %d",
pos);
407 const uint8_t
byte = state_frame[
pos];
411 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
414 }
else if (
pos == 1) {
417 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
420 }
else if (
pos == 2) {
423 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
426 }
else if (
pos == 3) {
429 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
432 }
else if (
pos == 4) {
435 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
438 }
else if (
pos == 5) {
439 if (data.size() == 385) {
451 }
else if ((
byte & 0x40) != 0x40) {
452 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
This class is used to encode all control actions on a climate device.
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.
float current_humidity
The current humidity of the climate device, as reported from the integration.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
float current_temperature
The current temperature of the climate device, as reported from the integration.
void publish_state()
Publish the state of the climate device, to be called from integrations.
float target_humidity
The target humidity of the climate device.
void add_feature_flags(uint32_t feature_flags)
void set_visual_min_humidity(float visual_min_humidity)
void set_visual_max_humidity(float visual_max_humidity)
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
climate::ClimateTraits traits() override
Return the traits of this controller.
void transmit_state() override
void control(const climate::ClimateCall &call) override
bool parse_state_frame_(const uint8_t frame[])
climate::ClimateTraits traits() override
uint8_t operation_mode_()
bool on_receive(remote_base::RemoteReceiveData data) override
RemoteTransmitterBase * transmitter_
@ CLIMATE_SUPPORTS_TARGET_HUMIDITY
@ CLIMATE_SUPPORTS_CURRENT_TEMPERATURE
@ 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_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 uint32_t DAIKIN_ZERO_SPACE
const uint32_t DAIKIN_HEADER_SPACE
const uint32_t DAIKIN_ARC_PRE_SPACE
const uint8_t DAIKIN_MODE_AUTO
const uint32_t DAIKIN_ARC_PRE_MARK
const uint32_t DAIKIN_MESSAGE_SPACE
const uint8_t DAIKIN_TEMP_MIN
const uint32_t DAIKIN_HEADER_MARK
const uint8_t DAIKIN_FAN_2
const uint8_t DAIKIN_FAN_5
const uint32_t DAIKIN_ONE_SPACE
const uint8_t DAIKIN_MODE_COOL
const uint32_t DAIKIN_BIT_MARK
const uint8_t DAIKIN_FAN_3
const uint8_t DAIKIN_FAN_4
ESPHOME_LOG_TAG(TAG, "daikin.climate")
const uint8_t DAIKIN_FAN_1
const uint32_t DAIKIN_IR_FREQUENCY
const uint8_t DAIKIN_MODE_FAN
const uint8_t DAIKIN_TEMP_MAX
const uint8_t DAIKIN_MODE_HEAT
const uint8_t DAIKIN_MODE_DRY
const uint8_t DAIKIN_STATE_FRAME_SIZE
const uint8_t DAIKIN_MODE_OFF
const uint8_t DAIKIN_FAN_SILENT
const uint8_t DAIKIN_FAN_AUTO
const uint8_t DAIKIN_MODE_ON
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...