11static const char *
const TAG =
"daikin.climate";
26 uint8_t remote_header[8] = {0x11, 0xDA, 0x27, 0x00, 0x84, 0x87, 0x20, 0x00};
29 for (
size_t i = 0; i <
sizeof(remote_header) - 1; i++) {
30 remote_header[
sizeof(remote_header) - 1] += remote_header[i];
43 for (uint8_t i : remote_header) {
44 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
59 uint8_t remote_header[20] = {0x11, 0xDA, 0x27, 0x00, 0x02, 0xd0, 0x02, 0x03, 0x80, 0x03, 0x82, 0x30, 0x41, 0x1f, 0x82,
63 0x00, 0x24, 0x00, 0x00};
77 uint8_t remote_state[19] = {
78 0x11, 0xDA, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x0a, 0xC4,
94 static uint8_t last_humidity = 0x66;
96 ESP_LOGD(TAG,
"Set Humditiy: %d, %d\n", (
int) this->
target_humidity, (
int) remote_state[7]);
97 remote_header[9] |= 0x10;
98 last_humidity = remote_state[7];
101 remote_state[8] = fan_speed >> 8;
102 remote_state[9] = fan_speed & 0xff;
105 for (
size_t i = 0; i <
sizeof(remote_header) - 1; i++) {
106 remote_header[
sizeof(remote_header) - 1] += remote_header[i];
124 for (uint8_t i : remote_header) {
125 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
137 for (uint8_t i : remote_state) {
138 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
152 switch (this->
mode) {
174 return operating_mode;
213 switch (this->
mode) {
256 ESP_LOGI(TAG,
"checksum error");
262 sprintf(buf,
"%s%02x ", buf, frame[i]);
264 ESP_LOGD(TAG,
"FRAME %s", buf);
266 uint8_t
mode = frame[5];
268 switch (
mode & 0xF0) {
348 bool valid_daikin_frame =
false;
350 valid_daikin_frame =
true;
351 size_t bytes_count = data.
size() / 2 / 8;
352 std::unique_ptr<char[]> buf(
new char[bytes_count * 3 + 1]);
354 for (
size_t i = 0; i < bytes_count; i++) {
356 for (int8_t bit = 0; bit < 8; bit++) {
360 valid_daikin_frame =
false;
364 sprintf(buf.get(),
"%s%02x ", buf.get(),
byte);
366 ESP_LOGD(TAG,
"WHOLE FRAME %s size: %d", buf.get(), data.
size());
368 if (!valid_daikin_frame) {
369 char sbuf[16 * 10 + 1];
371 for (
size_t j = 0; j < static_cast<size_t>(data.
size()); j++) {
372 if ((j - 2) % 16 == 0) {
374 ESP_LOGD(TAG,
"DATA %04x: %s", (j - 16 > 0xffff ? 0 : j - 16), sbuf);
393 if (
static_cast<int32_t
>(DAIKIN_DBG_LOWER(
DAIKIN_BIT_MARK)) <= data[j] &&
403 if (abs(data[j]) > 100000) {
404 sprintf(sbuf,
"%s%-5d[%c] ", sbuf, data[j] > 0 ? 99999 : -99999, type_ch);
406 sprintf(sbuf,
"%s%-5d[%c] ", sbuf, (
int) (round(data[j] / 10.) * 10), type_ch);
408 if (j + 1 ==
static_cast<size_t>(data.
size())) {
409 ESP_LOGD(TAG,
"DATA %04x: %s", (j - 8 > 0xffff ? 0 : j - 8), sbuf);
417 ESP_LOGI(TAG,
"non daikin_arc expect item");
423 for (int8_t bit = 0; bit < 8; bit++) {
427 ESP_LOGI(TAG,
"non daikin_arc expect item pos: %d", pos);
431 state_frame[pos] = byte;
435 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x", pos,
byte);
438 }
else if (pos == 1) {
441 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x", pos,
byte);
444 }
else if (pos == 2) {
447 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x", pos,
byte);
450 }
else if (pos == 3) {
453 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x", pos,
byte);
456 }
else if (pos == 4) {
459 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x", pos,
byte);
462 }
else if (pos == 5) {
463 if (data.
size() == 385) {
475 }
else if ((
byte & 0x40) != 0x40) {
476 ESP_LOGI(TAG,
"non daikin_arc expect pos: %d header: %02x", pos,
byte);
485 if (
call.get_target_humidity().has_value()) {
This class is used to encode all control actions on a climate device.
const optional< float > & get_target_humidity() const
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
value_type const & value() const
bool expect_item(uint32_t mark, uint32_t space)
void set_carrier_frequency(uint32_t carrier_frequency)
RemoteTransmitterBase * transmitter_
RemoteTransmitData * get_data()
@ 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_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
Providing packet encoding functions for exchanging data with a remote host.