15 static const char *
const TAG =
"haier.climate";
24 HonClimate::HonClimate()
84 return "56°C Steri-Clean";
94 ESP_LOGI(TAG,
"Sending self cleaning start request");
102 ESP_LOGI(TAG,
"Sending steri cleaning start request");
117 haier_protocol::FrameType message_type,
120 if (message_type == haier_protocol::FrameType::INVALID) {
121 ESP_LOGW(TAG,
"It looks like your ESPHome Haier climate configuration is wrong. You should use the smartAir2 " 122 "protocol instead of hOn");
124 return haier_protocol::HandlerError::INVALID_ANSWER;
126 haier_protocol::HandlerError result =
127 this->
answer_preprocess_(request_type, haier_protocol::FrameType::GET_DEVICE_VERSION, message_type,
129 if (result == haier_protocol::HandlerError::HANDLER_OK) {
132 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
147 #ifdef USE_TEXT_SENSOR 168 haier_protocol::FrameType message_type,
170 haier_protocol::HandlerError result =
171 this->
answer_preprocess_(request_type, haier_protocol::FrameType::GET_DEVICE_ID, message_type,
173 if (result == haier_protocol::HandlerError::HANDLER_OK) {
183 haier_protocol::FrameType message_type,
const uint8_t *data,
185 haier_protocol::HandlerError result =
186 this->
answer_preprocess_(request_type, haier_protocol::FrameType::CONTROL, message_type,
188 if (result == haier_protocol::HandlerError::HANDLER_OK) {
190 if (result != haier_protocol::HandlerError::HANDLER_OK) {
191 ESP_LOGW(TAG,
"Error %d while parsing Status packet", (
int) result);
211 ESP_LOGI(TAG,
"First HVAC status received");
246 haier_protocol::FrameType request_type, haier_protocol::FrameType message_type,
const uint8_t *data,
249 request_type, haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION, message_type,
251 if (result == haier_protocol::HandlerError::HANDLER_OK) {
261 haier_protocol::FrameType message_type,
263 if (request_type == haier_protocol::FrameType::GET_ALARM_STATUS) {
264 if (message_type != haier_protocol::FrameType::GET_ALARM_STATUS_RESPONSE) {
267 return haier_protocol::HandlerError::UNSUPPORTED_MESSAGE;
273 return haier_protocol::HandlerError::UNEXPECTED_MESSAGE;
276 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
279 return haier_protocol::HandlerError::HANDLER_OK;
282 return haier_protocol::HandlerError::UNSUPPORTED_MESSAGE;
287 const uint8_t *buffer,
size_t size) {
288 haier_protocol::HandlerError result = haier_protocol::HandlerError::HANDLER_OK;
291 result = haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
294 this->
haier_protocol_.send_answer(haier_protocol::HaierMessage(haier_protocol::FrameType::CONFIRM));
302 haier_protocol::FrameType::GET_DEVICE_VERSION,
304 std::placeholders::_3, std::placeholders::_4));
306 haier_protocol::FrameType::GET_DEVICE_ID,
308 std::placeholders::_3, std::placeholders::_4));
310 haier_protocol::FrameType::CONTROL,
312 std::placeholders::_4));
314 haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION,
316 std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
318 haier_protocol::FrameType::GET_ALARM_STATUS,
320 std::placeholders::_3, std::placeholders::_4));
322 haier_protocol::FrameType::REPORT_NETWORK_STATUS,
324 std::placeholders::_3, std::placeholders::_4));
326 haier_protocol::FrameType::ALARM_STATUS,
328 std::placeholders::_3));
333 ESP_LOGCONFIG(TAG,
" Protocol version: hOn");
334 ESP_LOGCONFIG(TAG,
" Control method: %d", (uint8_t) this->
control_method_);
336 ESP_LOGCONFIG(TAG,
" Device protocol version: %s", this->
hvac_hardware_info_.value().protocol_version_.c_str());
337 ESP_LOGCONFIG(TAG,
" Device software version: %s", this->
hvac_hardware_info_.value().software_version_.c_str());
338 ESP_LOGCONFIG(TAG,
" Device hardware version: %s", this->
hvac_hardware_info_.value().hardware_version_.c_str());
339 ESP_LOGCONFIG(TAG,
" Device name: %s", this->
hvac_hardware_info_.value().device_name_.c_str());
340 ESP_LOGCONFIG(TAG,
" Device features:%s%s%s%s%s",
360 uint8_t module_capabilities[2] = {0b00000000, 0b00000111};
361 static const haier_protocol::HaierMessage DEVICE_VERSION_REQUEST(
362 haier_protocol::FrameType::GET_DEVICE_VERSION, module_capabilities,
sizeof(module_capabilities));
368 static const haier_protocol::HaierMessage DEVICEID_REQUEST(haier_protocol::FrameType::GET_DEVICE_ID);
375 static const haier_protocol::HaierMessage STATUS_REQUEST(
377 static const haier_protocol::HaierMessage BIG_DATA_REQUEST(
391 static const haier_protocol::HaierMessage UPDATE_SIGNAL_REQUEST(
392 haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION);
411 static const haier_protocol::HaierMessage ALARM_STATUS_REQUEST(haier_protocol::FrameType::GET_ALARM_STATUS);
427 ESP_LOGI(TAG,
"AC control is disabled, monitor only");
431 ESP_LOGW(TAG,
"Unsupported control method for hOn protocol!");
437 ESP_LOGW(TAG,
"Control message queue is empty!");
456 ESP_LOGW(TAG,
"SENDING_ACTION_COMMAND phase without action request!");
464 }
else if (std::chrono::duration_cast<std::chrono::milliseconds>(now - this->
last_alarm_request_).count() >
465 ALARM_STATUS_REQUEST_INTERVAL_MS) {
470 (std::chrono::duration_cast<std::chrono::milliseconds>(now - this->
last_signal_request_).count() >
471 SIGNAL_LEVEL_UPDATE_INTERVAL_MS)) {
478 ESP_LOGE(TAG,
"Wrong protocol handler state: %s (%d), resetting communication",
487 static haier_protocol::HaierMessage power_on_message(
489 std::initializer_list<uint8_t>({0x00, 0x01}).begin(), 2);
490 return power_on_message;
492 static haier_protocol::HaierMessage power_off_message(
494 std::initializer_list<uint8_t>({0x00, 0x00}).begin(), 2);
495 return power_off_message;
501 constexpr uint32_t restore_settings_version = 0x57EB59DDUL;
516 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
519 control_out_buffer[4] = 0;
520 bool has_hvac_settings =
false;
522 has_hvac_settings =
true;
527 out_data->ac_power = 0;
530 out_data->ac_power = 1;
535 out_data->ac_power = 1;
540 out_data->ac_power = 1;
545 out_data->ac_power = 1;
549 out_data->fast_mode = 0;
552 out_data->ac_power = 1;
557 ESP_LOGE(
"Control",
"Unsupported climate mode");
578 ESP_LOGE(
"Control",
"Unsupported fan mode");
605 out_data->set_point = ((int) target_temp) - 16;
606 out_data->half_degree = (target_temp - ((int) target_temp) >= 0.49) ? 1 : 0;
608 if (out_data->ac_power == 0) {
610 out_data->fast_mode = 0;
611 out_data->sleep_mode = 0;
615 out_data->fast_mode = 0;
616 out_data->sleep_mode = 0;
617 out_data->ten_degree = 0;
622 out_data->sleep_mode = 0;
623 out_data->ten_degree = 0;
626 out_data->fast_mode = 0;
627 out_data->sleep_mode = 0;
632 out_data->fast_mode = 0;
633 out_data->sleep_mode = 1;
634 out_data->ten_degree = 0;
637 ESP_LOGE(
"Control",
"Unsupported preset");
638 out_data->fast_mode = 0;
639 out_data->sleep_mode = 0;
640 out_data->ten_degree = 0;
657 out_data->quiet_mode = 0;
664 out_data->beeper_status = ((!this->
get_beeper_state()) || (!has_hvac_settings)) ? 1 : 0;
665 control_out_buffer[4] = 0;
670 return haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
676 constexpr
size_t active_alarms_size =
sizeof(this->
active_alarms_);
677 if (size >= active_alarms_size + 2) {
679 size_t alarm_code = 0;
680 for (
int i = active_alarms_size - 1; i >= 0; i--) {
682 uint8_t alarm_bit = 1;
683 for (
int b = 0; b < 8; b++) {
684 if ((packet[2 + i] & alarm_bit) != (this->
active_alarms_[i] & alarm_bit)) {
685 bool alarm_status = (packet[2 + i] & alarm_bit) != 0;
686 int log_level = alarm_status ? ESPHOME_LOG_LEVEL_WARN : ESPHOME_LOG_LEVEL_INFO;
690 esp_log_printf_(log_level, TAG, __LINE__,
"Alarm %s (%d): %s", alarm_status ?
"activated" :
"deactivated",
691 alarm_code, alarm_message);
708 float alarm_count = 0.0f;
709 static uint8_t nibble_bits_count[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
711 alarm_count += (float) (nibble_bits_count[packet[2 + i] & 0x0F] + nibble_bits_count[packet[2 + i] >> 4]);
723 if ((this->
sub_sensors_[(
size_t) type] !=
nullptr) && (sens ==
nullptr)) {
725 }
else if ((this->
sub_sensors_[(
size_t) type] ==
nullptr) && (sens !=
nullptr)) {
735 size_t index = (size_t) type;
743 #ifdef USE_BINARY_SENSOR 757 bool converted_value = value == 1;
758 size_t index = (size_t) type;
764 #endif // USE_BINARY_SENSOR 766 #ifdef USE_TEXT_SENSOR 772 sens->
publish_state(this->hvac_hardware_info_.value().device_name_);
776 sens->
publish_state(this->hvac_hardware_info_.value().protocol_version_);
787 size_t index = (size_t) type;
791 #endif // USE_TEXT_SENSOR 810 size_t expected_size =
812 if (size < expected_size) {
813 ESP_LOGW(TAG,
"Unexpected message size %d (expexted >= %d)", size, expected_size);
814 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
816 uint16_t subtype = (((uint16_t) packet_buffer[0]) << 8) + packet_buffer[1];
835 #ifdef USE_BINARY_SENSOR 843 #endif // USE_BINARY_SENSOR 849 memcpy(&packet.control, packet_buffer + 2 + this->status_message_header_size_,
851 memcpy(&packet.sensors, packet_buffer + 2 + this->status_message_header_size_ + this->real_control_packet_size_,
853 if (packet.sensors.error_status != 0) {
854 ESP_LOGW(TAG,
"HVAC error, code=0x%02X", packet.sensors.error_status);
861 (
float) (packet.sensors.outdoor_temperature + PROTOCOL_OUTDOOR_TEMPERATURE_OFFSET));
867 bool should_publish =
false;
871 if (packet.control.fast_mode != 0) {
873 }
else if (packet.control.sleep_mode != 0) {
875 }
else if (packet.control.ten_degree != 0) {
885 this->
target_temperature = packet.control.set_point + 16.0f + ((packet.control.half_degree == 1) ? 0.5f : 0.0f);
886 should_publish = should_publish || (old_target_temperature != this->
target_temperature);
904 switch (packet.control.fan_mode) {
910 ESP_LOGI(TAG,
"Fan speed Auto is not supported in Fan only AC mode, ignoring");
927 if (packet.control.ac_power != 0) {
929 bool disp_status = packet.control.display_status != 0;
935 }
else if ((((uint8_t) this->
health_mode_) & 0b10) == 0) {
944 should_publish = should_publish || (old_health_mode != this->
get_health_mode());
948 if (packet.control.steri_clean == 1) {
951 }
else if (packet.control.self_cleaning_status == 1) {
959 ESP_LOGD(TAG,
"Cleaning status change: %d => %d", (uint8_t) this->
cleaning_status_, (uint8_t) new_cleaning);
965 this->cleaning_status_ = new_cleaning;
966 #ifdef USE_TEXT_SENSOR 968 #endif // USE_TEXT_SENSOR 974 if (packet.control.ac_power == 0) {
978 switch (packet.control.ac_mode) {
996 should_publish = should_publish || (old_mode != this->
mode);
1003 bool new_quiet_mode = packet.control.quiet_mode != 0;
1017 if (horizontal_swing_supported &&
1019 if (vertical_swing_supported &&
1026 if (vertical_swing_supported &&
1041 if (save_settings) {
1046 should_publish = should_publish || (old_swing_mode != this->
swing_mode);
1049 if (should_publish) {
1052 if (should_publish) {
1053 ESP_LOGI(TAG,
"HVAC values changed");
1055 int log_level = should_publish ? ESPHOME_LOG_LEVEL_INFO : ESPHOME_LOG_LEVEL_DEBUG;
1056 esp_log_printf_(log_level, TAG, __LINE__,
"HVAC Mode = 0x%X", packet.control.ac_mode);
1057 esp_log_printf_(log_level, TAG, __LINE__,
"Fan speed Status = 0x%X", packet.control.fan_mode);
1058 esp_log_printf_(log_level, TAG, __LINE__,
"Horizontal Swing Status = 0x%X", packet.control.horizontal_swing_mode);
1059 esp_log_printf_(log_level, TAG, __LINE__,
"Vertical Swing Status = 0x%X", packet.control.vertical_swing_mode);
1060 esp_log_printf_(log_level, TAG, __LINE__,
"Set Point Status = 0x%X", packet.control.set_point);
1061 return haier_protocol::HandlerError::HANDLER_OK;
1073 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1081 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1090 uint8_t fan_mode_buf[] = {0x00, 0xFF};
1091 uint8_t quiet_mode_buf[] = {0x00, 0xFF};
1093 climate_mode = climate_control.
mode.
value();
1094 uint8_t buffer[2] = {0x00, 0x00};
1103 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1113 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1115 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1123 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1125 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1133 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1135 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1143 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1145 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1150 ESP_LOGE(
"Control",
"Unsupported climate mode");
1157 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1160 new_power ? ONE_BUF : ZERO_BUF, 2));
1164 uint8_t fast_mode_buf[] = {0x00, 0xFF};
1165 uint8_t away_mode_buf[] = {0x00, 0xFF};
1168 fast_mode_buf[1] = 0x00;
1169 away_mode_buf[1] = 0x00;
1173 fast_mode_buf[1] = 0x00;
1174 away_mode_buf[1] = 0x00;
1179 away_mode_buf[1] = 0x00;
1182 fast_mode_buf[1] = 0x00;
1186 ESP_LOGE(
"Control",
"Unsupported preset");
1193 quiet_mode_buf[1] = 0x01;
1195 quiet_mode_buf[1] = 0x00;
1201 if (quiet_mode_buf[1] != 0xFF) {
1203 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1206 quiet_mode_buf, 2));
1210 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1217 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1225 uint8_t buffer[2] = {0x00, 0x00};
1228 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1252 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1255 horizontal_swing_buf, 2));
1257 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1260 vertical_swing_buf, 2));
1279 ESP_LOGE(
"Control",
"Unsupported fan mode");
1282 if (fan_mode_buf[1] != 0xFF) {
1284 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1301 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
1305 out_data->steri_clean = 0;
1306 out_data->set_point = 0x06;
1309 out_data->ac_power = 1;
1311 out_data->light_status = 0;
1318 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1329 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
1333 out_data->steri_clean = 1;
1334 out_data->set_point = 0x06;
1337 out_data->ac_power = 1;
1339 out_data->light_status = 0;
1358 if ((sub_sensor !=
nullptr) && sub_sensor->has_state())
1359 sub_sensor->publish_state(NAN);
1361 #endif // USE_SENSOR 1369 static uint8_t counter = 0;
1370 counter = (counter + 1) % 3;
1371 return counter == 1;
HvacSettings current_hvac_settings_
Base class for all switches.
value_type const & value() const
ClimateSwingMode swing_mode
The active swing mode of the climate device.
esphome::optional< hon_protocol::VerticalSwingMode > current_vertical_swing_
bool can_send_message() const
haier_protocol::HaierMessage get_control_message() override
haier_protocol::HandlerError get_alarm_status_answer_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
void update_sub_sensor_(SubSensorType type, float value)
SwitchState display_status_
esphome::optional< hon_protocol::VerticalSwingMode > pending_vertical_direction_
esphome::optional< float > target_temperature
hon_protocol::HorizontalSwingMode last_horizontal_swing
CallbackManager< void(uint8_t, const char *)> alarm_start_callback_
int real_sensors_packet_size_
esphome::optional< esphome::climate::ClimatePreset > preset
CallbackManager< void(uint8_t, const char *)> alarm_end_callback_
uint8_t compressor_current[2]
haier_protocol::HandlerError process_status_message_(const uint8_t *packet, uint8_t size)
const std::set< ClimateSwingMode > & get_supported_swing_modes() const
std::unique_ptr< uint8_t[]> last_status_message_
constexpr int PROTOCOL_OUTDOOR_TEMPERATURE_OFFSET
float target_temperature
The target temperature of the climate device.
void add_alarm_end_callback(std::function< void(uint8_t, const char *)> &&callback)
haier_protocol::HandlerError report_network_status_answer_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
virtual void set_phase(ProtocolPhases phase)
void set_quiet_mode_switch(switch_::Switch *sw)
void control(const esphome::climate::ClimateCall &call) override
void update_sub_text_sensor_(SubTextSensorType type, const std::string &value)
constexpr std::chrono::milliseconds CONTROL_MESSAGE_RETRIES_INTERVAL
uint8_t active_alarms_[8]
std::chrono::steady_clock::time_point last_status_request_
std::chrono::steady_clock::time_point last_signal_request_
ClimateMode mode
The active mode of the climate device.
void set_handlers() override
void set_vertical_airflow(hon_protocol::VerticalSwingMode direction)
bool get_health_mode() const
bool got_valid_outdoor_temp_
float active_alarm_count_
float current_temperature
The current temperature of the climate device, as reported from the integration.
void set_sub_binary_sensor(SubBinarySensorType type, binary_sensor::BinarySensor *sens)
CleaningState cleaning_status_
void publish_state(const std::string &state)
haier_protocol::HandlerError answer_preprocess_(haier_protocol::FrameType request_message_type, haier_protocol::FrameType expected_request_message_type, haier_protocol::FrameType answer_message_type, haier_protocol::FrameType expected_answer_message_type, ProtocolPhases expected_phase)
virtual bool prepare_pending_action()
HonControlMethod control_method_
esphome::optional< hon_protocol::HorizontalSwingMode > get_horizontal_airflow() const
esphome::optional< HardwareInfo > hvac_hardware_info_
bool get_quiet_mode_state() const
void set_sub_text_sensor(SubTextSensorType type, text_sensor::TextSensor *sens)
haier_protocol::HandlerError get_device_id_answer_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
ClimateSwingMode
Enum for all modes a climate swing can be in.
void process_phase(std::chrono::steady_clock::time_point now) override
bool get_display_state() const
void initialization() override
void set_quiet_mode_state(bool state)
void start_self_cleaning()
virtual void save_settings()
esphome::optional< hon_protocol::HorizontalSwingMode > current_horizontal_swing_
haier_protocol::ProtocolHandler haier_protocol_
uint8_t outdoor_fan_status
bool is_protocol_initialisation_interval_exceeded_(std::chrono::steady_clock::time_point now)
void add_alarm_start_callback(std::function< void(uint8_t, const char *)> &&callback)
virtual void initialization()
constexpr size_t HON_ALARM_COUNT
uint8_t self_cleaning_status
void set_beeper_state(bool state)
void send_message_(const haier_protocol::HaierMessage &command, bool use_crc, uint8_t num_repeats=0, std::chrono::milliseconds interval=std::chrono::milliseconds::zero())
ProtocolPhases protocol_phase_
constexpr size_t SIGNAL_LEVEL_UPDATE_INTERVAL_MS
haier_protocol::HaierMessage get_wifi_signal_message_()
int extra_control_packet_bytes_
optional< ClimatePreset > preset
The active preset of the climate device.
void fill_control_messages_queue_()
const char * phase_to_string_(ProtocolPhases phase)
virtual bool has_state() const
Return whether this binary sensor has outputted a state.
const std::set< climate::ClimatePreset > & get_supported_presets() const
ESPPreferences * global_preferences
int real_control_packet_size_
void set_beeper_switch(switch_::Switch *sw)
esphome::optional< hon_protocol::VerticalSwingMode > get_vertical_airflow() const
bool should_get_big_data_()
esphome::optional< hon_protocol::HorizontalSwingMode > pending_horizontal_direction_
CleaningState get_cleaning_status() const
void set_sub_sensor(SubSensorType type, sensor::Sensor *sens)
ESPPreferenceObject hon_rtc_
void clear_control_messages_queue_()
esphome::optional< PendingAction > action_request_
void publish_state(float state)
Publish a new state to the front-end.
sensor::Sensor * sub_sensors_[(size_t) SubSensorType::SUB_SENSOR_TYPE_COUNT]
haier_protocol::HandlerError status_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
uint8_t outdoor_in_air_temperature
esphome::optional< esphome::climate::ClimateFanMode > fan_mode
uint8_t outdoor_coil_temperature
int status_message_header_size_
constexpr uint16_t encode_uint16(uint8_t msb, uint8_t lsb)
Encode a 16-bit value given the most and least significant byte.
void dump_config() override
void publish_state(bool state)
Publish a new state to the front-end.
switch_::Switch * beeper_switch_
constexpr size_t ALARM_STATUS_REQUEST_INTERVAL_MS
void publish_state()
Publish the state of the climate device, to be called from integrations.
int extra_sensors_packet_bytes_
uint8_t expansion_valve_open_degree[2]
void HOT esp_log_printf_(int level, const char *tag, int line, const char *format,...)
text_sensor::TextSensor * sub_text_sensors_[(size_t) SubTextSensorType::SUB_TEXT_SENSOR_TYPE_COUNT]
ClimateMode
Enum for all modes a climate device can be in.
bool get_beeper_state() const
uint8_t four_way_valve_status
uint8_t outdoor_out_air_temperature
haier_protocol::HandlerError get_device_version_answer_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
switch_::Switch * quiet_mode_switch_
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
uint8_t compressor_status
std::string get_cleaning_status_text() const
void update_sub_binary_sensor_(SubBinarySensorType type, uint8_t value)
virtual void process_protocol_reset()
virtual ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)=0
SwitchState quiet_mode_state_
uint8_t compressor_frequency
bool is_message_interval_exceeded_(std::chrono::steady_clock::time_point now)
std::chrono::steady_clock::time_point last_alarm_request_
bool is_status_request_interval_exceeded_(std::chrono::steady_clock::time_point now)
haier_protocol::HandlerError alarm_status_message_handler_(haier_protocol::FrameType type, const uint8_t *buffer, size_t size)
Implementation of SPI Controller mode.
bool has_state() const
Return whether this sensor has gotten a full state (that passed through all filters) yet...
Base class for all binary_sensor-type classes.
void process_alarm_message_(const uint8_t *packet, uint8_t size, bool check_new)
void process_protocol_reset() override
uint8_t other_modes_fan_speed_
haier_protocol::HaierMessage get_power_message(bool state) override
Base-class for all sensors.
const std::string HON_ALARM_MESSAGES[]
void set_horizontal_airflow(hon_protocol::HorizontalSwingMode direction)
bool prepare_pending_action() override
void start_steri_cleaning()
constexpr uint8_t CONTROL_MESSAGE_RETRIES
uint8_t indoor_electric_heating_status
void publish_state(bool state)
Publish a state to the front-end from the back-end.
uint8_t indoor_coil_temperature
bool is_control_message_interval_exceeded_(std::chrono::steady_clock::time_point now)
CallbackManager< void(const char *, size_t)> status_message_callback_
haier_protocol::HandlerError get_management_information_answer_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
std::queue< haier_protocol::HaierMessage > control_messages_queue_
binary_sensor::BinarySensor * sub_binary_sensors_[(size_t) SubBinarySensorType::SUB_BINARY_SENSOR_TYPE_COUNT]
hon_protocol::VerticalSwingMode last_vertiacal_swing
uint32_t get_object_id_hash()
esphome::climate::ClimateTraits traits_
uint8_t indoor_fan_status
bool forced_request_status_
esphome::optional< esphome::climate::ClimateSwingMode > swing_mode
std::chrono::steady_clock::time_point last_valid_status_timestamp_
esphome::optional< esphome::climate::ClimateMode > mode
void dump_config() override