mirror of
https://github.com/GrKoR/esphome_aux_ac_component.git
synced 2025-12-31 21:59:31 +03:00
Compare commits
11 Commits
2e0c421c9f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3296a96368 | ||
|
|
f8b1210222 | ||
|
|
36dc1fe15f | ||
|
|
8597e46e3f | ||
|
|
c49bed261d | ||
|
|
babcb8f895 | ||
|
|
0a09ad6642 | ||
|
|
fa0b698afa | ||
|
|
3391368179 | ||
|
|
fc56fb7966 | ||
|
|
efa0991dd0 |
@@ -4,183 +4,238 @@
|
||||
#include "esphome/core/automation.h"
|
||||
#include "esphome/core/component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace aux_ac {
|
||||
namespace esphome
|
||||
{
|
||||
namespace aux_ac
|
||||
{
|
||||
|
||||
// **************************************** DISPLAY ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConDisplayOffAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConDisplayOffAction(AirCon *ac) : ac_(ac) {}
|
||||
// **************************************** DISPLAY ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConDisplayOffAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConDisplayOffAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->displayOffSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->displayOffSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConDisplayOnAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConDisplayOnAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConDisplayOnAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConDisplayOnAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->displayOnSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->displayOnSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
// **************************************** VERTICAL LOUVER ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConVLouverSwingAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverSwingAction(AirCon *ac) : ac_(ac) {}
|
||||
// **************************************** VERTICAL LOUVER ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConVLouverSwingAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverSwingAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverSwingSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverSwingSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverStopAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverStopAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConVLouverStopAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverStopAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverStopSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverStopSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverTopAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverTopAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConVLouverTopAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverTopAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverTopSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverTopSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleAboveAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverMiddleAboveAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleAboveAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverMiddleAboveAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverMiddleAboveSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverMiddleAboveSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverMiddleAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverMiddleAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverMiddleSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverMiddleSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleBelowAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverMiddleBelowAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConVLouverMiddleBelowAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverMiddleBelowAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverMiddleBelowSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverMiddleBelowSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverBottomAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConVLouverBottomAction(AirCon *ac) : ac_(ac) {}
|
||||
template <typename... Ts>
|
||||
class AirConVLouverBottomAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConVLouverBottomAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
void play(Ts... x) override { this->ac_->setVLouverBottomSequence(); }
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->setVLouverBottomSequence();
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConVLouverSetAction : public Action<Ts...> {
|
||||
public:
|
||||
AirConVLouverSetAction(AirCon *ac) : ac_(ac) {}
|
||||
TEMPLATABLE_VALUE(uint8_t, value);
|
||||
template <typename... Ts>
|
||||
class AirConVLouverSetAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint8_t, value);
|
||||
|
||||
void play(Ts... x) {
|
||||
vlpos_ = this->value_.value(x...);
|
||||
this->ac_->setVLouverFrontendSequence((ac_vlouver_frontend)vlpos_);
|
||||
}
|
||||
AirConVLouverSetAction(AirCon *ac) : ac_(ac) {};
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
uint8_t vlpos_;
|
||||
};
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
vlpos_ = this->value_.value(x...);
|
||||
this->ac_->setVLouverFrontendSequence((ac_vlouver_frontend)vlpos_);
|
||||
};
|
||||
|
||||
// **************************************** SEND TEST PACKET ACTION ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConSendTestPacketAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConSendTestPacketAction(AirCon *ac) : ac_(ac) {}
|
||||
void set_data_template(std::function<std::vector<uint8_t>(Ts...)> func) {
|
||||
this->data_func_ = func;
|
||||
this->static_ = false;
|
||||
}
|
||||
void set_data_static(const std::vector<uint8_t> &data) {
|
||||
this->data_static_ = data;
|
||||
this->static_ = true;
|
||||
}
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
uint8_t vlpos_;
|
||||
};
|
||||
|
||||
void play(Ts... x) override {
|
||||
if (this->static_) {
|
||||
this->ac_->sendTestPacket(this->data_static_);
|
||||
} else {
|
||||
auto val = this->data_func_(x...);
|
||||
this->ac_->sendTestPacket(val);
|
||||
}
|
||||
}
|
||||
// **************************************** SEND TEST PACKET ACTION ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConSendTestPacketAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConSendTestPacketAction(AirCon *ac) : ac_(ac) {}
|
||||
void set_data_template(std::function<std::vector<uint8_t>(Ts...)> func)
|
||||
{
|
||||
this->data_func_ = func;
|
||||
this->static_ = false;
|
||||
}
|
||||
void set_data_static(const std::vector<uint8_t> &data)
|
||||
{
|
||||
this->data_static_ = data;
|
||||
this->static_ = true;
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
bool static_{false};
|
||||
std::function<std::vector<uint8_t>(Ts...)> data_func_{};
|
||||
std::vector<uint8_t> data_static_{};
|
||||
};
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
if (this->static_)
|
||||
{
|
||||
this->ac_->sendTestPacket(this->data_static_);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto val = this->data_func_(x...);
|
||||
this->ac_->sendTestPacket(val);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************** POWER LIMITATION ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConPowerLimitationOffAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit AirConPowerLimitationOffAction(AirCon *ac) : ac_(ac) {}
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
bool static_{false};
|
||||
std::function<std::vector<uint8_t>(Ts...)> data_func_{};
|
||||
std::vector<uint8_t> data_static_{};
|
||||
};
|
||||
|
||||
void play(Ts... x) override { this->ac_->powerLimitationOffSequence(); }
|
||||
// **************************************** POWER LIMITATION ACTIONS ****************************************
|
||||
template <typename... Ts>
|
||||
class AirConPowerLimitationOffAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
explicit AirConPowerLimitationOffAction(AirCon *ac) : ac_(ac) {}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->ac_->powerLimitationOffSequence();
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
class AirConPowerLimitationOnAction : public Action<Ts...> {
|
||||
public:
|
||||
AirConPowerLimitationOnAction(AirCon *ac) : ac_(ac) {}
|
||||
TEMPLATABLE_VALUE(uint8_t, value);
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
};
|
||||
|
||||
void play(Ts... x) {
|
||||
this->pwr_lim_ = this->value_.value(x...);
|
||||
this->ac_->powerLimitationOnSequence(this->pwr_lim_);
|
||||
}
|
||||
template <typename... Ts>
|
||||
class AirConPowerLimitationOnAction : public Action<Ts...>
|
||||
{
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint8_t, value);
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
uint8_t pwr_lim_;
|
||||
};
|
||||
AirConPowerLimitationOnAction(AirCon *ac) : ac_(ac) {};
|
||||
|
||||
} // namespace aux_ac
|
||||
} // namespace esphome
|
||||
void play(const Ts &...x) override
|
||||
{
|
||||
this->pwr_lim_ = this->value_.value(x...);
|
||||
this->ac_->powerLimitationOnSequence(this->pwr_lim_);
|
||||
}
|
||||
|
||||
protected:
|
||||
AirCon *ac_;
|
||||
uint8_t pwr_lim_;
|
||||
};
|
||||
|
||||
} // namespace aux_ac
|
||||
} // namespace esphome
|
||||
@@ -1476,13 +1476,12 @@ namespace esphome
|
||||
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.0 + (float)(small_info_body->target_temp_int) + ((small_info_body->target_temp_frac_bool) ? 0.5 : 0.0);
|
||||
// stateFloat = 8.0 + (float)(small_info_body->target_temp_int) + ((small_info_body->target_temp_frac_bool) ? 0.5 : 0.0);
|
||||
stateFloat = 8.0 + (float)(small_info_body->target_temp_int) + (small_info_body->target_temp_frac_dec / 10.0);
|
||||
stateChangedFlag = stateChangedFlag || (_current_ac_state.temp_target != stateFloat);
|
||||
_current_ac_state.temp_target = stateFloat;
|
||||
_current_ac_state.temp_target_matter = true;
|
||||
|
||||
// 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);
|
||||
_current_ac_state.louver.louver_v = (ac_louver_V)stateByte;
|
||||
@@ -1946,6 +1945,7 @@ namespace esphome
|
||||
{
|
||||
pack->body[4] = (pack->body[4] & ~AC_TEMP_TARGET_FRAC_PART_MASK);
|
||||
}
|
||||
pack->body[14] = ((uint8_t)(cmd->temp_target * 10)) % 10;
|
||||
}
|
||||
|
||||
// значение ограничения мощности инвертора
|
||||
@@ -4025,7 +4025,7 @@ namespace esphome
|
||||
// initAC() в формируемом питоном коде вызывается до вызова aux_ac.set_supported_***() с установленными пользователем в конфиге параметрами
|
||||
#if ESPHOME_VERSION_CODE >= VERSION_CODE(2025, 11, 0)
|
||||
_traits.add_feature_flags(climate::CLIMATE_SUPPORTS_CURRENT_TEMPERATURE);
|
||||
_traits.add_feature_flags(climate::CLIMATE_REQUIRES_TWO_POINT_TARGET_TEMPERATURE);
|
||||
// NOT setting CLIMATE_REQUIRES_TWO_POINT_TARGET_TEMPERATURE - this device uses single target temperature
|
||||
#else
|
||||
_traits.set_supports_current_temperature(true);
|
||||
_traits.set_supports_two_point_target_temperature(false); // if the climate device's target temperature should be split in target_temperature_low and target_temperature_high instead of just the single target_temperature
|
||||
|
||||
@@ -34,7 +34,7 @@ from esphome.components.climate import (
|
||||
ClimateSwingMode,
|
||||
)
|
||||
|
||||
AUX_AC_FIRMWARE_VERSION = '0.3.1'
|
||||
AUX_AC_FIRMWARE_VERSION = '0.3.2'
|
||||
AC_PACKET_TIMEOUT_MIN = 150
|
||||
AC_PACKET_TIMEOUT_MAX = 600
|
||||
AC_POWER_LIMIT_MIN = 30
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
+ AUX (models: ALLD-H18/4R1C / AL-H18/4R1C(U), ALMD-H48/5DR2 / AL-H48/5DR2(U), ALMD-H24/4DR2A / AL-H24/4DR2A(U), AMWM-H07/4R1 multisplit, AMWM-H07/4R2(J) multisplit, AMWM-H12/4R2(J) multisplit, AMWM-H12/4R3 multisplit, ASM-H12LL, ASM-H24LD, ASW-12A3INV/SS, ASW-H07A4/DE-R1DI, ASW-H07A4/FP-R1DI, ASW-H07A4/JD-R1, ASW-H09A4/FP-R1DI, ASW-H09A4/LK-700R1, ASW-H09A4/LK-700R1DI, ASW-H09B4/LK-700R1, ASW-H09B7A4, ASW-H12A4/FAR1, ASW-H12A4/HA-R2DI, ASW-H12A4/JD-R2DI, ASW-H12B4/JD-R2DI, ASW-H12C5C4/JER3DI-B8-2, ASW-H12C5C4/JOR3DI-B8, ASW-H12U3/JIR1DI-US, ASW-H18A4/QH-R1DI / AS-H18A4/QH-R1DI, ASW-H18E3A4, AUX-07JO/I / AUX-M3-21LCLH multisplit, AUX-09CAA/I / ASW-H09A4/CAR3DI-C3, AUX-12JO/I / AUX-M3-21LCLH multisplit, AUX-12F3H, AUX-18QC/I / AUX-18QC/O, AWM-09G1V4-X, HA-18000BTU, KFR-26GW/BpHRB+3, KFR-26GW/BpQYA2+2R3, KFR-26GW/BpQYD2+2R3, KFR-26GW/BpR3QYA1+1, KFR-26GW/BpR3QYD1+1, KFR-26GW/BpR3QYQ1+1, KFR-26GW/BpR3QYQ2+2, KFR-35GW/BpQYA1+1R3, KFR-35GW/BpQYA2+2R3, KFR-35GW/BpQYD1+1R3, KFR-35GW/BpQYD2+2R3, KFR-35GW/BpR3QYQ1+1, KFR-35GW/BpR3QYQ2+2 (see [issue #71](https://github.com/GrKoR/esphome_aux_ac_component/issues/71) for detais of `Aegean Sea`[爱琴海] AUX family AC connection)
|
||||
+ Ballu (models: BLC_CF/in-60HN1 / BLC_O/out-60HN1, Orbis BPAC-08 OR/N6, BSUI/in-09HN8 / BSUI/out-09HN8, BSUI/in-12HN8 / BSUI/out-12HN8, BSUI/in-18HN8 / BSUI/out-18HN8, BSW/in-09HN1 / BSW/out-09HN1, BSW/in-12HN1 / BSW/out-12HN1, BSW/in-18HN1 / BSW/out-18HN1)
|
||||
+ Baymak (models: Elegant Plus 9, Elegant Plus 12)
|
||||
+ Baxi (models: JSGNW25, JSGNW35)
|
||||
+ Centek (models: CT-65A09, CT-65A12, CT-65EDC07, CT-65F09, CT-65F12, CT-65FDC07, CT-65FDC09, CT-65J09, CT-65J12, CT-65J24, CT-65K07, CT-65Q09, CT-65Q12, CT-65RDC07, CT-65RDC09, CT-65RDC12, CT-65SDC07, CT-65SDC09, CT-65SDC18, CT-65U13, CT-65U18, CT-65V12, CT-65V24, CT-65X12, CT-65Z10, CT-65Z18)
|
||||
+ Costway (models: FP10318US-22WH, FP10524US-22WH)
|
||||
+ Dimstal (model: SMND-QC-12-J-Smart ECO)
|
||||
|
||||
Reference in New Issue
Block a user