15static const char *
const TAG =
"haier.climate";
50 if ((this->
mode != ClimateMode::CLIMATE_MODE_OFF) && (this->
mode != ClimateMode::CLIMATE_MODE_FAN_ONLY)) {
93 return "56°C Steri-Clean";
103 ESP_LOGI(TAG,
"Sending self cleaning start request");
111 ESP_LOGI(TAG,
"Sending steri cleaning start request");
118 haier_protocol::FrameType message_type,
119 const uint8_t *data,
size_t data_size) {
121 if (message_type == haier_protocol::FrameType::INVALID) {
122 ESP_LOGW(TAG,
"It looks like your ESPHome Haier climate configuration is wrong. You should use the smartAir2 "
123 "protocol instead of hOn");
125 return haier_protocol::HandlerError::INVALID_ANSWER;
127 haier_protocol::HandlerError result =
128 this->
answer_preprocess_(request_type, haier_protocol::FrameType::GET_DEVICE_VERSION, message_type,
130 if (result == haier_protocol::HandlerError::HANDLER_OK) {
133 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
148#ifdef USE_TEXT_SENSOR
169 haier_protocol::FrameType message_type,
170 const uint8_t *data,
size_t data_size) {
171 haier_protocol::HandlerError result =
172 this->
answer_preprocess_(request_type, haier_protocol::FrameType::GET_DEVICE_ID, message_type,
174 if (result == haier_protocol::HandlerError::HANDLER_OK) {
184 haier_protocol::FrameType message_type,
const uint8_t *data,
186 haier_protocol::HandlerError result =
187 this->
answer_preprocess_(request_type, haier_protocol::FrameType::CONTROL, message_type,
189 if (result == haier_protocol::HandlerError::HANDLER_OK) {
191 if (result != haier_protocol::HandlerError::HANDLER_OK) {
192 ESP_LOGW(TAG,
"Error %d while parsing Status packet", (
int) result);
205 this->real_control_packet_size_);
212 ESP_LOGI(TAG,
"First HVAC status received");
247 haier_protocol::FrameType request_type, haier_protocol::FrameType message_type,
const uint8_t *data,
250 request_type, haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION, message_type,
252 if (result == haier_protocol::HandlerError::HANDLER_OK) {
262 haier_protocol::FrameType message_type,
263 const uint8_t *data,
size_t data_size) {
264 if (request_type == haier_protocol::FrameType::GET_ALARM_STATUS) {
265 if (message_type != haier_protocol::FrameType::GET_ALARM_STATUS_RESPONSE) {
268 return haier_protocol::HandlerError::UNSUPPORTED_MESSAGE;
274 return haier_protocol::HandlerError::UNEXPECTED_MESSAGE;
277 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
280 return haier_protocol::HandlerError::HANDLER_OK;
283 return haier_protocol::HandlerError::UNSUPPORTED_MESSAGE;
288 const uint8_t *buffer,
size_t size) {
289 haier_protocol::HandlerError result = haier_protocol::HandlerError::HANDLER_OK;
292 result = haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
295 this->
haier_protocol_.send_answer(haier_protocol::HaierMessage(haier_protocol::FrameType::CONFIRM));
303 haier_protocol::FrameType::GET_DEVICE_VERSION,
304 [
this](haier_protocol::FrameType req, haier_protocol::FrameType msg,
const uint8_t *data,
size_t size) {
308 haier_protocol::FrameType::GET_DEVICE_ID,
309 [
this](haier_protocol::FrameType req, haier_protocol::FrameType msg,
const uint8_t *data,
size_t size) {
313 haier_protocol::FrameType::CONTROL,
314 [
this](haier_protocol::FrameType req, haier_protocol::FrameType msg,
const uint8_t *data,
size_t size) {
318 haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION,
319 [
this](haier_protocol::FrameType req, haier_protocol::FrameType msg,
const uint8_t *data,
size_t size) {
323 haier_protocol::FrameType::GET_ALARM_STATUS,
324 [
this](haier_protocol::FrameType req, haier_protocol::FrameType msg,
const uint8_t *data,
size_t size) {
328 haier_protocol::FrameType::REPORT_NETWORK_STATUS,
329 [
this](haier_protocol::FrameType req, haier_protocol::FrameType msg,
const uint8_t *data,
size_t size) {
332 this->
haier_protocol_.set_message_handler(haier_protocol::FrameType::ALARM_STATUS,
333 [
this](haier_protocol::FrameType
type,
const uint8_t *data,
size_t size) {
341 " Protocol version: hOn\n"
342 " Control method: %d",
346 " Device protocol version: %s\n"
347 " Device software version: %s\n"
348 " Device hardware version: %s\n"
351 this->hvac_hardware_info_.value().software_version_.c_str(),
352 this->hvac_hardware_info_.value().hardware_version_.c_str(),
353 this->hvac_hardware_info_.value().device_name_.c_str());
354 ESP_LOGCONFIG(TAG,
" Device features:%s%s%s%s%s",
356 (this->hvac_hardware_info_.value().functions_[1] ?
" controller-device" :
""),
357 (this->hvac_hardware_info_.value().functions_[2] ?
" crc" :
""),
358 (this->hvac_hardware_info_.value().functions_[3] ?
" multinode" :
""),
359 (this->hvac_hardware_info_.value().functions_[4] ?
" role" :
""));
374 uint8_t module_capabilities[2] = {0b00000000, 0b00000111};
375 static const haier_protocol::HaierMessage DEVICE_VERSION_REQUEST(
376 haier_protocol::FrameType::GET_DEVICE_VERSION, module_capabilities,
sizeof(module_capabilities));
382 static const haier_protocol::HaierMessage DEVICEID_REQUEST(haier_protocol::FrameType::GET_DEVICE_ID);
389 static const haier_protocol::HaierMessage STATUS_REQUEST(
391 static const haier_protocol::HaierMessage BIG_DATA_REQUEST(
405 static const haier_protocol::HaierMessage UPDATE_SIGNAL_REQUEST(
406 haier_protocol::FrameType::GET_MANAGEMENT_INFORMATION);
425 static const haier_protocol::HaierMessage ALARM_STATUS_REQUEST(haier_protocol::FrameType::GET_ALARM_STATUS);
441 ESP_LOGI(TAG,
"AC control is disabled, monitor only");
445 ESP_LOGW(TAG,
"Unsupported control method for hOn protocol!");
451 ESP_LOGW(TAG,
"Control message queue is empty!");
470 ESP_LOGW(TAG,
"SENDING_ACTION_COMMAND phase without action request!");
478 }
else if (std::chrono::duration_cast<std::chrono::milliseconds>(now - this->
last_alarm_request_).count() >
484 (std::chrono::duration_cast<std::chrono::milliseconds>(now - this->
last_signal_request_).count() >
492 ESP_LOGE(TAG,
"Wrong protocol handler state: %s (%d), resetting communication",
501 static haier_protocol::HaierMessage power_on_message(
503 std::initializer_list<uint8_t>({0x00, 0x01}).begin(), 2);
504 return power_on_message;
506 static haier_protocol::HaierMessage power_off_message(
508 std::initializer_list<uint8_t>({0x00, 0x00}).begin(), 2);
509 return power_off_message;
515 constexpr uint32_t restore_settings_version = 0x57EB59DDUL;
529 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
532 control_out_buffer[4] = 0;
533 bool has_hvac_settings =
false;
535 has_hvac_settings =
true;
537 if (climate_control.
mode.has_value()) {
538 switch (climate_control.
mode.value()) {
570 ESP_LOGE(
"Control",
"Unsupported climate mode");
575 if (climate_control.
fan_mode.has_value()) {
576 switch (climate_control.
fan_mode.value()) {
591 ESP_LOGE(
"Control",
"Unsupported fan mode");
618 out_data->
set_point = ((int) target_temp) - 16;
619 out_data->
half_degree = (target_temp - ((int) target_temp) >= 0.49) ? 1 : 0;
625 }
else if (climate_control.
preset.has_value()) {
626 switch (climate_control.
preset.value()) {
650 ESP_LOGE(
"Control",
"Unsupported preset");
682 return haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
688 constexpr size_t active_alarms_size =
sizeof(this->
active_alarms_);
689 if (size >= active_alarms_size + 2) {
691 size_t alarm_code = 0;
692 for (
int i = active_alarms_size - 1; i >= 0; i--) {
694 uint8_t alarm_bit = 1;
695 for (
int b = 0; b < 8; b++) {
696 if ((packet[2 + i] & alarm_bit) != (this->
active_alarms_[i] & alarm_bit)) {
697 bool alarm_status = (packet[2 + i] & alarm_bit) != 0;
698 int log_level = alarm_status ? ESPHOME_LOG_LEVEL_WARN : ESPHOME_LOG_LEVEL_INFO;
702 esp_log_printf_(log_level, TAG, __LINE__,
"Alarm %s (%d): %s", alarm_status ?
"activated" :
"deactivated",
703 alarm_code, alarm_message);
721 float alarm_count = 0.0f;
722 static uint8_t nibble_bits_count[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
724 alarm_count += (float) (nibble_bits_count[packet[2 + i] & 0x0F] + nibble_bits_count[packet[2 + i] >> 4]);
736 if ((this->
sub_sensors_[(
size_t) type] !=
nullptr) && (sens ==
nullptr)) {
738 }
else if ((this->
sub_sensors_[(
size_t) type] ==
nullptr) && (sens !=
nullptr)) {
748 size_t index = (size_t)
type;
756#ifdef USE_BINARY_SENSOR
770 bool converted_value = value == 1;
771 size_t index = (size_t)
type;
779#ifdef USE_TEXT_SENSOR
800 size_t index = (size_t)
type;
823 size_t expected_size =
825 if (size < expected_size) {
826 ESP_LOGW(TAG,
"Unexpected message size %u (expexted >= %zu)",
size, expected_size);
827 return haier_protocol::HandlerError::WRONG_MESSAGE_STRUCTURE;
829 uint16_t subtype = (((uint16_t) packet_buffer[0]) << 8) + packet_buffer[1];
848#ifdef USE_BINARY_SENSOR
862 memcpy(&packet.control, packet_buffer + 2 + this->status_message_header_size_,
864 memcpy(&packet.sensors, packet_buffer + 2 + this->status_message_header_size_ + this->real_control_packet_size_,
866 if (packet.sensors.error_status != 0) {
867 ESP_LOGW(TAG,
"HVAC error, code=0x%02X", packet.sensors.error_status);
880 bool should_publish =
false;
883 optional<ClimatePreset> old_preset = this->
preset;
884 if (packet.control.fast_mode != 0) {
886 }
else if (packet.control.sleep_mode != 0) {
888 }
else if (packet.control.ten_degree != 0) {
893 should_publish = should_publish || (!old_preset.has_value()) ||
899 this->
target_temperature = packet.control.set_point + 16.0f + ((packet.control.half_degree == 1) ? 0.5f : 0.0f);
900 should_publish = should_publish || (old_target_temperature != this->
target_temperature);
910 optional<ClimateFanMode> old_fan_mode = this->
fan_mode;
918 switch (packet.control.fan_mode) {
924 ESP_LOGI(TAG,
"Fan speed Auto is not supported in Fan only AC mode, ignoring");
937 should_publish = should_publish || (!old_fan_mode.has_value()) ||
942 if (packet.control.ac_power != 0) {
944 bool disp_status = packet.control.display_status != 0;
959 should_publish = should_publish || (old_health_mode != this->
get_health_mode());
963 if (packet.control.steri_clean == 1) {
966 }
else if (packet.control.self_cleaning_status == 1) {
974 ESP_LOGD(TAG,
"Cleaning status change: %d => %d", (uint8_t) this->
cleaning_status_, (uint8_t) new_cleaning);
980 this->cleaning_status_ = new_cleaning;
981#ifdef USE_TEXT_SENSOR
989 if (packet.control.ac_power == 0) {
993 switch (packet.control.ac_mode) {
1011 should_publish = should_publish || (old_mode != this->
mode);
1018 bool new_quiet_mode = packet.control.quiet_mode != 0;
1037 if (horizontal_swing_supported &&
1039 if (vertical_swing_supported &&
1046 if (vertical_swing_supported &&
1058 (this->current_vertical_swing_.value() != this->settings_.last_vertiacal_swing)) ||
1066 should_publish = should_publish || (old_swing_mode != this->
swing_mode);
1069 if (should_publish) {
1072 if (should_publish) {
1073 ESP_LOGI(TAG,
"HVAC values changed");
1075 int log_level = should_publish ? ESPHOME_LOG_LEVEL_INFO : ESPHOME_LOG_LEVEL_DEBUG;
1076 esp_log_printf_(log_level, TAG, __LINE__,
"HVAC Mode = 0x%X", packet.control.ac_mode);
1077 esp_log_printf_(log_level, TAG, __LINE__,
"Fan speed Status = 0x%X", packet.control.fan_mode);
1078 esp_log_printf_(log_level, TAG, __LINE__,
"Horizontal Swing Status = 0x%X", packet.control.horizontal_swing_mode);
1079 esp_log_printf_(log_level, TAG, __LINE__,
"Vertical Swing Status = 0x%X", packet.control.vertical_swing_mode);
1080 esp_log_printf_(log_level, TAG, __LINE__,
"Set Point Status = 0x%X", packet.control.set_point);
1081 return haier_protocol::HandlerError::HANDLER_OK;
1108 uint8_t fan_mode_buf[] = {0x00, 0xFF};
1109 uint8_t quiet_mode_buf[] = {0x00, 0xFF};
1110 if (climate_control.
mode.has_value()) {
1111 climate_mode = climate_control.
mode.value();
1112 uint8_t buffer[2] = {0x00, 0x00};
1113 switch (climate_control.
mode.value()) {
1163 ESP_LOGE(
"Control",
"Unsupported climate mode");
1176 uint8_t fast_mode_buf[] = {0x00, 0xFF};
1177 uint8_t away_mode_buf[] = {0x00, 0xFF};
1180 fast_mode_buf[1] = 0x00;
1181 away_mode_buf[1] = 0x00;
1182 }
else if (climate_control.
preset.has_value()) {
1183 switch (climate_control.
preset.value()) {
1185 fast_mode_buf[1] = 0x00;
1186 away_mode_buf[1] = 0x00;
1191 away_mode_buf[1] = 0x00;
1194 fast_mode_buf[1] = 0x00;
1198 ESP_LOGE(
"Control",
"Unsupported preset");
1205 quiet_mode_buf[1] = 0x01;
1207 quiet_mode_buf[1] = 0x00;
1213 if (quiet_mode_buf[1] != 0xFF) {
1233 if (climate_control.
target_temperature.has_value() && (this->mode != ClimateMode::CLIMATE_MODE_FAN_ONLY)) {
1234 uint8_t buffer[2] = {0x00, 0x00};
1242 if (climate_control.
swing_mode.has_value()) {
1245 switch (climate_control.
swing_mode.value()) {
1262 horizontal_swing_buf, 2);
1266 vertical_swing_buf, 2);
1269 if (climate_control.
fan_mode.has_value()) {
1270 switch (climate_control.
fan_mode.value()) {
1285 ESP_LOGE(
"Control",
"Unsupported fan mode");
1288 if (fan_mode_buf[1] != 0xFF) {
1304 switch (action_request.action) {
1307 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
1318 action_request.message = haier_protocol::HaierMessage(
1323 action_request.message =
1324 haier_protocol::HaierMessage(haier_protocol::FrameType::CONTROL,
1335 uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE];
1346 action_request.message = haier_protocol::HaierMessage(
1364 if ((sub_sensor !=
nullptr) && sub_sensor->has_state())
1365 sub_sensor->publish_state(NAN);
ESPPreferenceObject make_entity_preference(uint32_t version=0)
Create a preference object for storing this entity's state/settings.
constexpr size_t count(ValueType value) const
Check if the set contains a specific value (std::set compatibility) Returns 1 if present,...
Base class for all binary_sensor-type classes.
void publish_state(bool new_state)
Publish a new state to the front-end.
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.
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.
optional< ClimatePreset > preset
The active preset of the climate device.
const ClimatePresetMask & get_supported_presets() const
const ClimateSwingModeMask & get_supported_swing_modes() const
ProtocolPhases protocol_phase_
SwitchState display_status_
esphome::climate::ClimateTraits traits_
bool get_health_mode() const
bool is_message_interval_exceeded_(std::chrono::steady_clock::time_point now)
CallbackManager< void(const char *, size_t)> status_message_callback_
bool forced_request_status_
bool is_protocol_initialisation_interval_exceeded_(std::chrono::steady_clock::time_point now)
bool is_status_request_interval_exceeded_(std::chrono::steady_clock::time_point now)
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 void initialization()
virtual void save_settings()
haier_protocol::ProtocolHandler haier_protocol_
virtual void process_protocol_reset()
const char * phase_to_string_(ProtocolPhases phase)
@ SENDING_UPDATE_SIGNAL_REQUEST
@ SENDING_ALARM_STATUS_REQUEST
@ SENDING_FIRST_STATUS_REQUEST
@ SENDING_FIRST_ALARM_STATUS_REQUEST
std::unique_ptr< uint8_t[]> last_status_message_
void send_message_(const haier_protocol::HaierMessage &command, bool use_crc, uint8_t num_repeats=0, std::chrono::milliseconds interval=std::chrono::milliseconds::zero())
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)
void control(const esphome::climate::ClimateCall &call) override
bool can_send_message() const
virtual bool prepare_pending_action()
bool get_display_state() const
std::chrono::steady_clock::time_point last_valid_status_timestamp_
haier_protocol::HaierMessage get_wifi_signal_message_()
bool is_control_message_interval_exceeded_(std::chrono::steady_clock::time_point now)
uint8_t other_modes_fan_speed_
esphome::optional< PendingAction > action_request_
std::chrono::steady_clock::time_point last_status_request_
HvacSettings current_hvac_settings_
void dump_config() override
virtual void set_phase(ProtocolPhases phase)
std::chrono::steady_clock::time_point last_signal_request_
void set_quiet_mode_switch(switch_::Switch *sw)
bool should_get_big_data_()
void dump_config() override
esphome::optional< hon_protocol::VerticalSwingMode > get_vertical_airflow() const
ESPPreferenceObject hon_rtc_
void set_sub_text_sensor(SubTextSensorType type, text_sensor::TextSensor *sens)
uint8_t active_alarms_[8]
haier_protocol::HandlerError status_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size)
HonControlMethod control_method_
void initialization() override
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)
int extra_control_packet_bytes_
CallbackManager< void(uint8_t, const char *)> alarm_end_callback_
esphome::optional< HardwareInfo > hvac_hardware_info_
void set_sub_sensor(SubSensorType type, sensor::Sensor *sens)
void set_handlers() override
CallbackManager< void(uint8_t, const char *)> alarm_start_callback_
void update_sub_sensor_(SubSensorType type, float value)
void set_sub_binary_sensor(SubBinarySensorType type, binary_sensor::BinarySensor *sens)
haier_protocol::HaierMessage get_power_message(bool state) override
bool got_valid_outdoor_temp_
text_sensor::TextSensor * sub_text_sensors_[(size_t) SubTextSensorType::SUB_TEXT_SENSOR_TYPE_COUNT]
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)
int status_message_header_size_
switch_::Switch * beeper_switch_
std::chrono::steady_clock::time_point last_alarm_request_
void start_steri_cleaning()
sensor::Sensor * sub_sensors_[(size_t) SubSensorType::SUB_SENSOR_TYPE_COUNT]
void set_beeper_state(bool state)
uint8_t big_data_counter_
size_t real_control_packet_size_
int real_sensors_packet_size_
void set_horizontal_airflow(hon_protocol::HorizontalSwingMode direction)
haier_protocol::HandlerError process_status_message_(const uint8_t *packet, uint8_t size)
@ SUB_BINARY_SENSOR_TYPE_COUNT
@ INDOOR_ELECTRIC_HEATING_STATUS
void start_self_cleaning()
void set_vertical_airflow(hon_protocol::VerticalSwingMode direction)
bool get_beeper_state() const
CleaningState cleaning_status_
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_
esphome::optional< hon_protocol::HorizontalSwingMode > current_horizontal_swing_
void set_quiet_mode_state(bool state)
void update_sub_text_sensor_(SubTextSensorType type, const std::string &value)
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)
binary_sensor::BinarySensor * sub_binary_sensors_[(size_t) SubBinarySensorType::SUB_BINARY_SENSOR_TYPE_COUNT]
haier_protocol::HandlerError alarm_status_message_handler_(haier_protocol::FrameType type, const uint8_t *buffer, size_t size)
void clear_control_messages_queue_()
float active_alarm_count_
void update_sub_binary_sensor_(SubBinarySensorType type, uint8_t value)
haier_protocol::HaierMessage get_control_message() override
void process_phase(std::chrono::steady_clock::time_point now) override
esphome::optional< hon_protocol::HorizontalSwingMode > pending_horizontal_direction_
bool get_quiet_mode_state() const
switch_::Switch * quiet_mode_switch_
std::string get_cleaning_status_text() const
void process_protocol_reset() override
int extra_sensors_packet_bytes_
CleaningState get_cleaning_status() const
esphome::optional< hon_protocol::HorizontalSwingMode > get_horizontal_airflow() const
SwitchState quiet_mode_state_
void fill_control_messages_queue_()
void set_beeper_switch(switch_::Switch *sw)
esphome::optional< hon_protocol::VerticalSwingMode > current_vertical_swing_
@ BIG_DATA_FRAME_SUB_SENSORS
@ EXPANSION_VALVE_OPEN_DEGREE
@ OUTDOOR_IN_AIR_TEMPERATURE
@ INDOOR_COIL_TEMPERATURE
@ OUTDOOR_COIL_TEMPERATURE
@ OUTDOOR_OUT_AIR_TEMPERATURE
@ OUTDOOR_DEFROST_TEMPERATURE
void process_alarm_message_(const uint8_t *packet, uint8_t size, bool check_new)
bool prepare_pending_action() override
esphome::optional< hon_protocol::VerticalSwingMode > pending_vertical_direction_
Base-class for all sensors.
void publish_state(float state)
Publish a new state to the front-end.
Base class for all switches.
void publish_state(bool state)
Publish a state to the front-end from the back-end.
void publish_state(const std::string &state)
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_PRESET_AWAY
Device is in away preset.
@ CLIMATE_PRESET_BOOST
Device is in boost preset.
@ CLIMATE_PRESET_SLEEP
Device is prepared for sleep.
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
@ 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.
ClimateMode
Enum for all modes a climate device can be in.
@ 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 std::string HON_ALARM_MESSAGES[]
constexpr size_t HON_ALARM_COUNT
constexpr uint8_t CONTROL_MESSAGE_RETRIES
constexpr size_t ALARM_STATUS_REQUEST_INTERVAL_MS
constexpr std::chrono::milliseconds CONTROL_MESSAGE_RETRIES_INTERVAL
constexpr int PROTOCOL_OUTDOOR_TEMPERATURE_OFFSET
constexpr size_t SIGNAL_LEVEL_UPDATE_INTERVAL_MS
Providing packet encoding functions for exchanging data with a remote host.
void HOT esp_log_printf_(int level, const char *tag, int line, const char *format,...)
constexpr uint16_t encode_uint16(uint8_t msb, uint8_t lsb)
Encode a 16-bit value given the most and least significant byte.
esphome::optional< esphome::climate::ClimateFanMode > fan_mode
esphome::optional< esphome::climate::ClimateSwingMode > swing_mode
esphome::optional< esphome::climate::ClimateMode > mode
esphome::optional< esphome::climate::ClimatePreset > preset
esphome::optional< float > target_temperature
hon_protocol::HorizontalSwingMode last_horizontal_swing
hon_protocol::VerticalSwingMode last_vertiacal_swing
uint8_t compressor_status
uint8_t indoor_coil_temperature
uint8_t outdoor_coil_temperature
uint8_t compressor_frequency
uint8_t four_way_valve_status
uint8_t expansion_valve_open_degree[2]
uint8_t outdoor_in_air_temperature
uint8_t indoor_electric_heating_status
uint8_t outdoor_out_air_temperature
uint8_t compressor_current[2]
uint8_t outdoor_fan_status
uint8_t indoor_fan_status
uint8_t vertical_swing_mode
uint8_t self_cleaning_status
uint8_t horizontal_swing_mode