mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
fix #1495 wwComfort mode
This commit is contained in:
@@ -846,6 +846,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
FL_(wwComfort),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_ww_mode));
|
||||
wwComfort2_ = EMS_VALUE_UINT_NOTSET; // read separately, but published as wwComfort1_
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wwComfort1_,
|
||||
DeviceValueType::ENUM,
|
||||
@@ -1469,8 +1470,11 @@ void Boiler::process_UBAParameterWWPlus(std::shared_ptr<const Telegram> telegram
|
||||
has_update(telegram, wwChargeOptimization_, 25);
|
||||
has_update(telegram, wwSelTempEcoplus_, 27);
|
||||
|
||||
telegram->read_value(wwComfort2_, 26);
|
||||
uint8_t wwComfort1 = EMS_VALUE_UINT_NOTSET;
|
||||
if (telegram->read_value(wwComfort1, 13)) {
|
||||
if (Helpers::hasValue(wwComfort2_)) {
|
||||
has_update(wwComfort1_, wwComfort2_);
|
||||
} else if (telegram->read_value(wwComfort1, 13)) {
|
||||
if (wwComfort1 == 0) {
|
||||
wwComfort1 = 0; // High_Comfort
|
||||
} else if (wwComfort1 == 0xD8) {
|
||||
@@ -2417,10 +2421,15 @@ bool Boiler::set_ww_mode(const char * value, const int8_t id) {
|
||||
uint8_t set;
|
||||
uint8_t comfort[] = {0x00, 0xD8, 0xEC}; // heat, eco, intelligent
|
||||
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (Helpers::hasValue(wwComfort2_)) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_comfort1))) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 26, set, EMS_TYPE_UBAParameterWWPlus);
|
||||
return true;
|
||||
}
|
||||
} else if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_comfort1))) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 13, comfort[set], EMS_TYPE_UBAParameterWWPlus);
|
||||
write_command(0x05, 70, set == 0 ? 0xAA : 0x55); //
|
||||
write_command(0x05, 70, set == 1 ? 0xAA : 0x55); //
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -60,7 +60,8 @@ class Boiler : public EMSdevice {
|
||||
uint8_t wwSelTempEcoplus_; // DHW ECO+ temperature
|
||||
uint8_t wwType_; // 0-off, 1-flow, 2-flowbuffer, 3-buffer, 4-layered buffer
|
||||
uint8_t wwComfort_; // WW comfort mode
|
||||
uint8_t wwComfort1_; // WW comfort mode RC310
|
||||
uint8_t wwComfort1_; // WW comfort mode RC310, 0xEA offset 13
|
||||
uint8_t wwComfort2_; // WW comfort mode emsplus 0xEA, offset 26
|
||||
uint8_t wwCircPump_; // DHW circulation pump available
|
||||
uint8_t wwChargeType_; // DHW charge type (pump or 3-way-valve)
|
||||
uint8_t wwChargeOptimization_; // DHW charge optimization
|
||||
|
||||
@@ -88,7 +88,7 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hybridDHW_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_comfort1),
|
||||
FL_(enum_comfort2),
|
||||
FL_(hybridDHW),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_hybridDHW));
|
||||
@@ -332,7 +332,7 @@ bool Heatpump::set_lowNoiseStop(const char * value, const int8_t id) {
|
||||
}
|
||||
bool Heatpump::set_hybridDHW(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_comfort1))) {
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_comfort2))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 1, v, 0x998);
|
||||
|
||||
Reference in New Issue
Block a user