mirror of
https://github.com/GrKoR/esphome_aux_ac_component.git
synced 2025-12-12 22:47:06 +03:00
fixed: target temperature frac part; power limit when off
This commit is contained in:
@@ -382,13 +382,19 @@ struct packet_small_info_body_t {
|
|||||||
uint8_t cmd_answer;
|
uint8_t cmd_answer;
|
||||||
|
|
||||||
// байт 10 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b10
|
// байт 10 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b10
|
||||||
uint8_t target_temp_int_and_v_louver;
|
//uint8_t target_temp_int_and_v_louver;
|
||||||
|
uint8_t v_louver : 3;
|
||||||
|
bool target_temp_int : 5;
|
||||||
|
|
||||||
|
|
||||||
// байт 11 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b11
|
// байт 11 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b11
|
||||||
uint8_t h_louver;
|
uint8_t h_louver;
|
||||||
|
|
||||||
// байт 12 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b12
|
// байт 12 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b12
|
||||||
uint8_t target_temp_frac;
|
//uint8_t target_temp_frac;
|
||||||
|
uint8_t ir_timer : 6;
|
||||||
|
bool reserv126 : 1;
|
||||||
|
bool target_temp_frac_bool : 1;
|
||||||
|
|
||||||
// байт 13 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b13
|
// байт 13 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b13
|
||||||
uint8_t fan_speed;
|
uint8_t fan_speed;
|
||||||
@@ -419,7 +425,7 @@ struct packet_small_info_body_t {
|
|||||||
bool inverter_power_limitation_enable : 1;
|
bool inverter_power_limitation_enable : 1;
|
||||||
|
|
||||||
// байт 22 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b22
|
// байт 22 пакета: https://github.com/GrKoR/AUX_HVAC_Protocol#packet_cmd_11_b22
|
||||||
uint8_t target_temp_frac2;
|
uint8_t target_temp_frac_dec;
|
||||||
};
|
};
|
||||||
|
|
||||||
//****************************************************************************************************************************************************
|
//****************************************************************************************************************************************************
|
||||||
@@ -1286,12 +1292,14 @@ class AirCon : public esphome::Component, public esphome::climate::Climate {
|
|||||||
small_info_body = (packet_small_info_body_t *)(_inPacket.body);
|
small_info_body = (packet_small_info_body_t *)(_inPacket.body);
|
||||||
|
|
||||||
// в малом пакете передается большое количество установленных пользователем параметров работы
|
// в малом пакете передается большое количество установленных пользователем параметров работы
|
||||||
stateFloat = 8 + (small_info_body->target_temp_int_and_v_louver >> 3) + 0.5 * (float)(small_info_body->target_temp_frac >> 7);
|
//stateFloat = 8 + (small_info_body->target_temp_int_and_v_louver >> 3) + 0.5 * (float)(small_info_body->target_temp_frac >> 7);
|
||||||
|
stateFloat = 8.0 + (float)(small_info_body->target_temp_int) + ( (small_info_body->target_temp_frac_bool) ? 0.5 : 0.0 );
|
||||||
stateChangedFlag = stateChangedFlag || (_current_ac_state.temp_target != stateFloat);
|
stateChangedFlag = stateChangedFlag || (_current_ac_state.temp_target != stateFloat);
|
||||||
_current_ac_state.temp_target = stateFloat;
|
_current_ac_state.temp_target = stateFloat;
|
||||||
_current_ac_state.temp_target_matter = true;
|
_current_ac_state.temp_target_matter = true;
|
||||||
|
|
||||||
stateByte = small_info_body->target_temp_int_and_v_louver & AC_LOUVERV_MASK;
|
//stateByte = small_info_body->target_temp_int_and_v_louver & AC_LOUVERV_MASK;
|
||||||
|
stateByte = small_info_body->v_louver;
|
||||||
stateChangedFlag = stateChangedFlag || (_current_ac_state.louver.louver_v != (ac_louver_V)stateByte);
|
stateChangedFlag = stateChangedFlag || (_current_ac_state.louver.louver_v != (ac_louver_V)stateByte);
|
||||||
_current_ac_state.louver.louver_v = (ac_louver_V)stateByte;
|
_current_ac_state.louver.louver_v = (ac_louver_V)stateByte;
|
||||||
|
|
||||||
@@ -1701,14 +1709,15 @@ class AirCon : public esphome::Component, public esphome::climate::Climate {
|
|||||||
|
|
||||||
// дробная часть температуры
|
// дробная часть температуры
|
||||||
if (cmd->temp_target - (uint8_t)(cmd->temp_target) > 0) {
|
if (cmd->temp_target - (uint8_t)(cmd->temp_target) > 0) {
|
||||||
pack->body[4] = (pack->body[4] & ~AC_TEMP_TARGET_FRAC_PART_MASK) | 1;
|
pack->body[4] = (pack->body[4] | AC_TEMP_TARGET_FRAC_PART_MASK);
|
||||||
} else {
|
} else {
|
||||||
pack->body[4] = (pack->body[4] & ~AC_TEMP_TARGET_FRAC_PART_MASK) | 0;
|
pack->body[4] = (pack->body[4] & ~AC_TEMP_TARGET_FRAC_PART_MASK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ограничение мощности инвертора
|
// ограничение мощности инвертора
|
||||||
if (cmd->inverter_power_limitation_value != AC_INVERTER_POWER_LIMITATION_VALUE_UNTOUCHED) {
|
if ((cmd->inverter_power_limitation_enable) &&
|
||||||
|
(cmd->inverter_power_limitation_value != AC_INVERTER_POWER_LIMITATION_VALUE_UNTOUCHED)) {
|
||||||
pack->body[13] = (pack->body[13] & ~AC_INVERTER_POWER_LIMITATION_ENABLE_MASK) | (cmd->inverter_power_limitation_enable << 7);
|
pack->body[13] = (pack->body[13] & ~AC_INVERTER_POWER_LIMITATION_ENABLE_MASK) | (cmd->inverter_power_limitation_enable << 7);
|
||||||
cmd->inverter_power_limitation_value = _power_limitation_value_normalise(cmd->inverter_power_limitation_value);
|
cmd->inverter_power_limitation_value = _power_limitation_value_normalise(cmd->inverter_power_limitation_value);
|
||||||
pack->body[13] = (pack->body[13] & ~AC_INVERTER_POWER_LIMITATION_VALUE_MASK) | cmd->inverter_power_limitation_value;
|
pack->body[13] = (pack->body[13] & ~AC_INVERTER_POWER_LIMITATION_VALUE_MASK) | cmd->inverter_power_limitation_value;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
external_components:
|
external_components:
|
||||||
- source:
|
- source:
|
||||||
type: local
|
type: local
|
||||||
path: ..\components
|
path: ../components
|
||||||
|
|
||||||
substitutions:
|
substitutions:
|
||||||
devicename: test_local_airflow_dir
|
devicename: test_local_airflow_dir
|
||||||
@@ -89,7 +89,7 @@ climate:
|
|||||||
name: $upper_devicename Defrost State
|
name: $upper_devicename Defrost State
|
||||||
id: ${devicename}_defrost_state
|
id: ${devicename}_defrost_state
|
||||||
internal: false
|
internal: false
|
||||||
invertor_power:
|
inverter_power:
|
||||||
name: $upper_devicename Invertor Power
|
name: $upper_devicename Invertor Power
|
||||||
id: ${devicename}_invertor_power
|
id: ${devicename}_invertor_power
|
||||||
internal: false
|
internal: false
|
||||||
|
|||||||
Reference in New Issue
Block a user