10static const char *
const TAG =
"daikin.climate";
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 for (uint8_t i : remote_header) {
43 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
58 uint8_t remote_header[20] = {0x11, 0xDA, 0x27, 0x00, 0x02, 0xd0, 0x02, 0x03, 0x80, 0x03, 0x82, 0x30, 0x41, 0x1f, 0x82,
62 0x00, 0x24, 0x00, 0x00};
76 uint8_t remote_state[19] = {
77 0x11, 0xDA, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x0a, 0xC4,
94 ESP_LOGD(TAG,
"Set Humditiy: %d, %d\n", (
int) this->
target_humidity, (
int) remote_state[7]);
95 remote_header[9] |= 0x10;
99 remote_state[8] = fan_speed >> 8;
100 remote_state[9] = fan_speed & 0xff;
103 for (
size_t i = 0; i <
sizeof(remote_header) - 1; i++) {
104 remote_header[
sizeof(remote_header) - 1] += remote_header[i];
113 auto *data = transmit.get_data();
122 for (uint8_t i : remote_header) {
123 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
135 for (uint8_t i : remote_state) {
136 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
150 switch (this->
mode) {
172 return operating_mode;
211 switch (this->
mode) {
254 ESP_LOGI(TAG,
"checksum error");
261 pos = buf_append_printf(buf,
sizeof(buf),
pos,
"%02x ", frame[i]);
263 ESP_LOGD(TAG,
"FRAME %s", buf);
265 uint8_t
mode = frame[5];
267 switch (
mode & 0xF0) {
347 bool valid_daikin_frame =
false;
349 valid_daikin_frame =
true;
350 size_t bytes_count = data.size() / 2 / 8;
352 char buf[40 * 3 + 1] = {};
353 constexpr size_t buf_size =
sizeof(buf);
355 for (
size_t i = 0; i < bytes_count; i++) {
357 for (int8_t bit = 0; bit < 8; bit++) {
361 valid_daikin_frame =
false;
365 buf_pos = buf_append_printf(buf, buf_size, buf_pos,
"%02x ",
byte);
367 ESP_LOGD(TAG,
"WHOLE FRAME %s size: %d", buf, data.size());
369 if (!valid_daikin_frame) {
370 char sbuf[16 * 10 + 1] = {0};
372 for (
size_t j = 0; j < static_cast<size_t>(data.size()); j++) {
373 if ((j - 2) % 16 == 0) {
375 ESP_LOGD(TAG,
"DATA %04x: %s", (j - 16 > 0xffff ? 0 : j - 16), sbuf);
394 if (
static_cast<int32_t
>(DAIKIN_DBG_LOWER(
DAIKIN_BIT_MARK)) <= data[j] &&
404 if (abs(data[j]) > 100000) {
405 sbuf_pos = buf_append_printf(sbuf,
sizeof(sbuf), sbuf_pos,
"%-5d[%c] ", data[j] > 0 ? 99999 : -99999, type_ch);
408 buf_append_printf(sbuf,
sizeof(sbuf), sbuf_pos,
"%-5d[%c] ", (
int) (round(data[j] / 10.) * 10), type_ch);
410 if (j + 1 ==
static_cast<size_t>(data.size())) {
411 ESP_LOGD(TAG,
"DATA %04x: %s", (j - 8 > 0xffff ? 0 : j - 8), sbuf);
419 ESP_LOGI(TAG,
"non daikin_arc expect item");
425 for (int8_t bit = 0; bit < 8; bit++) {
429 ESP_LOGI(TAG,
"non daikin_arc expect item pos: %d",
pos);
433 state_frame[
pos] = byte;
437 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
440 }
else if (
pos == 1) {
443 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
446 }
else if (
pos == 2) {
449 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
452 }
else if (
pos == 3) {
455 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
458 }
else if (
pos == 4) {
461 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x",
pos,
byte);
464 }
else if (
pos == 5) {
465 if (data.size() == 385) {
477 }
else if ((
byte & 0x40) != 0x40) {
478 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
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