15 static const char *
const TAG =
"haier.climate";
24 HonClimate::HonClimate()
61 return "56°C Steri-Clean";
71 ESP_LOGI(TAG,
"Sending self cleaning start request");
79 ESP_LOGI(TAG,
"Sending steri cleaning start request");
94 haier_protocol::FrameType message_type,
97 if (message_type == haier_protocol::FrameType::INVALID) {
98 ESP_LOGW(TAG,
"It looks like your ESPHome Haier climate configuration is wrong. You should use the smartAir2 " 99 "protocol instead of hOn");
101 return haier_protocol::HandlerError::INVALID_ANSWER;
103 haier_protocol::HandlerError result =
104 this->
answer_preprocess_(request_type, haier_protocol::FrameType::GET_DEVICE_VERSION, message_type,
106 if (result == haier_protocol::HandlerError::HANDLER_OK) {
109 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
124 #ifdef USE_TEXT_SENSOR 145 haier_protocol::FrameType message_type,
147 haier_protocol::HandlerError result =
148 this->
answer_preprocess_(request_type, haier_protocol::FrameType::GET_DEVICE_ID, message_type,
150 if (result == haier_protocol::HandlerError::HANDLER_OK) {
160 haier_protocol::FrameType message_type,
const uint8_t *data,
162 haier_protocol::HandlerError result =
163 this->
answer_preprocess_(request_type, haier_protocol::FrameType::CONTROL, message_type,
165 if (result == haier_protocol::HandlerError::HANDLER_OK) {
167 if (result != haier_protocol::HandlerError::HANDLER_OK) {
168 ESP_LOGW(TAG,
"Error %d while parsing Status packet", (
int) result);
188 ESP_LOGI(TAG,
"First HVAC status received");
223 haier_protocol::FrameType request_type, haier_protocol::FrameType message_type,
const uint8_t *data,
226 request_type, haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION, message_type,
228 if (result == haier_protocol::HandlerError::HANDLER_OK) {
238 haier_protocol::FrameType message_type,
240 if (request_type == haier_protocol::FrameType::GET_ALARM_STATUS) {
241 if (message_type != haier_protocol::FrameType::GET_ALARM_STATUS_RESPONSE) {
244 return haier_protocol::HandlerError::UNSUPPORTED_MESSAGE;
250 return haier_protocol::HandlerError::UNEXPECTED_MESSAGE;
253 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
256 return haier_protocol::HandlerError::HANDLER_OK;
259 return haier_protocol::HandlerError::UNSUPPORTED_MESSAGE;
264 const uint8_t *buffer,
size_t size) {
265 haier_protocol::HandlerError result = haier_protocol::HandlerError::HANDLER_OK;
268 result = haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
271 this->
haier_protocol_.send_answer(haier_protocol::HaierMessage(haier_protocol::FrameType::CONFIRM));
279 haier_protocol::FrameType::GET_DEVICE_VERSION,
281 std::placeholders::_3, std::placeholders::_4));
283 haier_protocol::FrameType::GET_DEVICE_ID,
285 std::placeholders::_3, std::placeholders::_4));
287 haier_protocol::FrameType::CONTROL,
289 std::placeholders::_4));
291 haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION,
293 std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
295 haier_protocol::FrameType::GET_ALARM_STATUS,
297 std::placeholders::_3, std::placeholders::_4));
299 haier_protocol::FrameType::REPORT_NETWORK_STATUS,
301 std::placeholders::_3, std::placeholders::_4));
303 haier_protocol::FrameType::ALARM_STATUS,
305 std::placeholders::_3));
310 ESP_LOGCONFIG(TAG,
" Protocol version: hOn");
311 ESP_LOGCONFIG(TAG,
" Control method: %d", (uint8_t) this->
control_method_);
313 ESP_LOGCONFIG(TAG,
" Device protocol version: %s", this->
hvac_hardware_info_.value().protocol_version_.c_str());
314 ESP_LOGCONFIG(TAG,
" Device software version: %s", this->
hvac_hardware_info_.value().software_version_.c_str());
315 ESP_LOGCONFIG(TAG,
" Device hardware version: %s", this->
hvac_hardware_info_.value().hardware_version_.c_str());
316 ESP_LOGCONFIG(TAG,
" Device name: %s", this->
hvac_hardware_info_.value().device_name_.c_str());
317 ESP_LOGCONFIG(TAG,
" Device features:%s%s%s%s%s",
337 uint8_t module_capabilities[2] = {0b00000000, 0b00000111};
338 static const haier_protocol::HaierMessage DEVICE_VERSION_REQUEST(
339 haier_protocol::FrameType::GET_DEVICE_VERSION, module_capabilities,
sizeof(module_capabilities));
345 static const haier_protocol::HaierMessage DEVICEID_REQUEST(haier_protocol::FrameType::GET_DEVICE_ID);
352 static const haier_protocol::HaierMessage STATUS_REQUEST(
354 static const haier_protocol::HaierMessage BIG_DATA_REQUEST(
368 static const haier_protocol::HaierMessage UPDATE_SIGNAL_REQUEST(
369 haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION);
388 static const haier_protocol::HaierMessage ALARM_STATUS_REQUEST(haier_protocol::FrameType::GET_ALARM_STATUS);
404 ESP_LOGI(TAG,
"AC control is disabled, monitor only");
408 ESP_LOGW(TAG,
"Unsupported control method for hOn protocol!");
414 ESP_LOGW(TAG,
"Control message queue is empty!");
433 ESP_LOGW(TAG,
"SENDING_ACTION_COMMAND phase without action request!");
441 }
else if (std::chrono::duration_cast<std::chrono::milliseconds>(now - this->
last_alarm_request_).count() >
442 ALARM_STATUS_REQUEST_INTERVAL_MS) {
447 (std::chrono::duration_cast<std::chrono::milliseconds>(now - this->
last_signal_request_).count() >
448 SIGNAL_LEVEL_UPDATE_INTERVAL_MS)) {
455 ESP_LOGE(TAG,
"Wrong protocol handler state: %s (%d), resetting communication",
464 static haier_protocol::HaierMessage power_on_message(
466 std::initializer_list<uint8_t>({0x00, 0x01}).begin(), 2);
467 return power_on_message;
469 static haier_protocol::HaierMessage power_off_message(
471 std::initializer_list<uint8_t>({0x00, 0x00}).begin(), 2);
472 return power_off_message;
477 constexpr uint32_t restore_settings_version = 0xE834D8DCUL;
490 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
493 control_out_buffer[4] = 0;
494 bool has_hvac_settings =
false;
496 has_hvac_settings =
true;
501 out_data->ac_power = 0;
504 out_data->ac_power = 1;
509 out_data->ac_power = 1;
514 out_data->ac_power = 1;
519 out_data->ac_power = 1;
523 out_data->quiet_mode = 0;
524 out_data->fast_mode = 0;
527 out_data->ac_power = 1;
532 ESP_LOGE(
"Control",
"Unsupported climate mode");
553 ESP_LOGE(
"Control",
"Unsupported fan mode");
580 out_data->set_point = ((int) target_temp) - 16;
581 out_data->half_degree = (target_temp - ((int) target_temp) >= 0.49) ? 1 : 0;
583 if (out_data->ac_power == 0) {
585 out_data->quiet_mode = 0;
586 out_data->fast_mode = 0;
587 out_data->sleep_mode = 0;
591 out_data->quiet_mode = 0;
592 out_data->fast_mode = 0;
593 out_data->sleep_mode = 0;
594 out_data->ten_degree = 0;
599 out_data->fast_mode = 0;
600 out_data->sleep_mode = 0;
601 out_data->ten_degree = 0;
604 out_data->quiet_mode = 0;
607 out_data->sleep_mode = 0;
608 out_data->ten_degree = 0;
611 out_data->quiet_mode = 0;
612 out_data->fast_mode = 0;
613 out_data->sleep_mode = 0;
618 out_data->quiet_mode = 0;
619 out_data->fast_mode = 0;
620 out_data->sleep_mode = 1;
621 out_data->ten_degree = 0;
624 ESP_LOGE(
"Control",
"Unsupported preset");
625 out_data->quiet_mode = 0;
626 out_data->fast_mode = 0;
627 out_data->sleep_mode = 0;
628 out_data->ten_degree = 0;
641 out_data->beeper_status = ((!this->
beeper_status_) || (!has_hvac_settings)) ? 1 : 0;
642 control_out_buffer[4] = 0;
645 return haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
651 constexpr
size_t active_alarms_size =
sizeof(this->
active_alarms_);
652 if (size >= active_alarms_size + 2) {
654 size_t alarm_code = 0;
655 for (
int i = active_alarms_size - 1; i >= 0; i--) {
657 uint8_t alarm_bit = 1;
658 for (
int b = 0; b < 8; b++) {
659 if ((packet[2 + i] & alarm_bit) != (this->
active_alarms_[i] & alarm_bit)) {
660 bool alarm_status = (packet[2 + i] & alarm_bit) != 0;
661 int log_level = alarm_status ? ESPHOME_LOG_LEVEL_WARN : ESPHOME_LOG_LEVEL_INFO;
665 esp_log_printf_(log_level, TAG, __LINE__,
"Alarm %s (%d): %s", alarm_status ?
"activated" :
"deactivated",
666 alarm_code, alarm_message);
683 float alarm_count = 0.0f;
684 static uint8_t nibble_bits_count[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
686 alarm_count += (float) (nibble_bits_count[packet[2 + i] & 0x0F] + nibble_bits_count[packet[2 + i] >> 4]);
698 if ((this->
sub_sensors_[(
size_t) type] !=
nullptr) && (sens ==
nullptr)) {
700 }
else if ((this->
sub_sensors_[(
size_t) type] ==
nullptr) && (sens !=
nullptr)) {
710 size_t index = (size_t) type;
718 #ifdef USE_BINARY_SENSOR 732 bool converted_value = value == 1;
733 size_t index = (size_t) type;
739 #endif // USE_BINARY_SENSOR 741 #ifdef USE_TEXT_SENSOR 747 sens->
publish_state(this->hvac_hardware_info_.value().device_name_);
751 sens->
publish_state(this->hvac_hardware_info_.value().protocol_version_);
762 size_t index = (size_t) type;
766 #endif // USE_TEXT_SENSOR 769 size_t expected_size =
771 if (size < expected_size) {
772 ESP_LOGW(TAG,
"Unexpected message size %d (expexted >= %d)", size, expected_size);
773 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
775 uint16_t subtype = (((uint16_t) packet_buffer[0]) << 8) + packet_buffer[1];
794 #ifdef USE_BINARY_SENSOR 802 #endif // USE_BINARY_SENSOR 808 memcpy(&packet.control, packet_buffer + 2 + this->status_message_header_size_,
810 memcpy(&packet.sensors, packet_buffer + 2 + this->status_message_header_size_ + this->real_control_packet_size_,
812 if (packet.sensors.error_status != 0) {
813 ESP_LOGW(TAG,
"HVAC error, code=0x%02X", packet.sensors.error_status);
820 (
float) (packet.sensors.outdoor_temperature + PROTOCOL_OUTDOOR_TEMPERATURE_OFFSET));
826 bool should_publish =
false;
830 if (packet.control.quiet_mode != 0) {
832 }
else if (packet.control.fast_mode != 0) {
834 }
else if (packet.control.sleep_mode != 0) {
836 }
else if (packet.control.ten_degree != 0) {
846 this->
target_temperature = packet.control.set_point + 16.0f + ((packet.control.half_degree == 1) ? 0.5f : 0.0f);
847 should_publish = should_publish || (old_target_temperature != this->
target_temperature);
865 switch (packet.control.fan_mode) {
871 ESP_LOGI(TAG,
"Fan speed Auto is not supported in Fan only AC mode, ignoring");
889 if (packet.control.ac_power != 0) {
891 bool disp_status = packet.control.display_status != 0;
907 should_publish = should_publish || (old_health_mode != this->
health_mode_);
911 if (packet.control.steri_clean == 1) {
914 }
else if (packet.control.self_cleaning_status == 1) {
922 ESP_LOGD(TAG,
"Cleaning status change: %d => %d", (uint8_t) this->
cleaning_status_, (uint8_t) new_cleaning);
928 this->cleaning_status_ = new_cleaning;
929 #ifdef USE_TEXT_SENSOR 931 #endif // USE_TEXT_SENSOR 937 if (packet.control.ac_power == 0) {
941 switch (packet.control.ac_mode) {
959 should_publish = should_publish || (old_mode != this->
mode);
990 should_publish = should_publish || (old_swing_mode != this->
swing_mode);
993 if (should_publish) {
996 if (should_publish) {
997 ESP_LOGI(TAG,
"HVAC values changed");
999 int log_level = should_publish ? ESPHOME_LOG_LEVEL_INFO : ESPHOME_LOG_LEVEL_DEBUG;
1000 esp_log_printf_(log_level, TAG, __LINE__,
"HVAC Mode = 0x%X", packet.control.ac_mode);
1001 esp_log_printf_(log_level, TAG, __LINE__,
"Fan speed Status = 0x%X", packet.control.fan_mode);
1002 esp_log_printf_(log_level, TAG, __LINE__,
"Horizontal Swing Status = 0x%X", packet.control.horizontal_swing_mode);
1003 esp_log_printf_(log_level, TAG, __LINE__,
"Vertical Swing Status = 0x%X", packet.control.vertical_swing_mode);
1004 esp_log_printf_(log_level, TAG, __LINE__,
"Set Point Status = 0x%X", packet.control.set_point);
1005 return haier_protocol::HandlerError::HANDLER_OK;
1017 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1025 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1032 uint8_t fan_mode_buf[] = {0x00, 0xFF};
1033 uint8_t quiet_mode_buf[] = {0x00, 0xFF};
1035 uint8_t buffer[2] = {0x00, 0x00};
1044 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1054 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1056 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1064 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1066 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1074 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1076 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1080 quiet_mode_buf[1] = 0;
1086 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1088 (uint8_t) hon_protocol::DataParameters::AC_MODE,
1093 ESP_LOGE(
"Control",
"Unsupported climate mode");
1100 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1103 new_power ? ONE_BUF : ZERO_BUF, 2));
1107 uint8_t fast_mode_buf[] = {0x00, 0xFF};
1108 uint8_t away_mode_buf[] = {0x00, 0xFF};
1111 quiet_mode_buf[1] = 0x00;
1112 fast_mode_buf[1] = 0x00;
1113 away_mode_buf[1] = 0x00;
1117 quiet_mode_buf[1] = 0x00;
1118 fast_mode_buf[1] = 0x00;
1119 away_mode_buf[1] = 0x00;
1124 fast_mode_buf[1] = 0x00;
1125 away_mode_buf[1] = 0x00;
1128 quiet_mode_buf[1] = 0x00;
1131 away_mode_buf[1] = 0x00;
1134 quiet_mode_buf[1] = 0x00;
1135 fast_mode_buf[1] = 0x00;
1139 ESP_LOGE(
"Control",
"Unsupported preset");
1146 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1149 quiet_mode_buf, 2));
1153 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1160 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1168 uint8_t buffer[2] = {0x00, 0x00};
1171 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1195 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1198 horizontal_swing_buf, 2));
1200 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1203 vertical_swing_buf, 2));
1222 ESP_LOGE(
"Control",
"Unsupported fan mode");
1225 if (fan_mode_buf[1] != 0xFF) {
1227 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1244 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
1248 out_data->steri_clean = 0;
1249 out_data->set_point = 0x06;
1252 out_data->ac_power = 1;
1254 out_data->light_status = 0;
1261 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1272 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
1276 out_data->steri_clean = 1;
1277 out_data->set_point = 0x06;
1280 out_data->ac_power = 1;
1282 out_data->light_status = 0;
1301 if ((sub_sensor !=
nullptr) && sub_sensor->has_state())
1302 sub_sensor->publish_state(NAN);
1304 #endif // USE_SENSOR 1312 static uint8_t counter = 0;
1313 counter = (counter + 1) % 3;
1314 return counter == 1;
HvacSettings current_hvac_settings_
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)
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)
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 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 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_
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
void initialization() override
void start_self_cleaning()
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)
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_
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)
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.
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)
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
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
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