mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
selflowtemp and forceheatingoff for ems+ telegrams (2E0 command)
This commit is contained in:
@@ -1208,9 +1208,14 @@ void Boiler::check_active() {
|
|||||||
static uint32_t lastSendHeatingOff = 0;
|
static uint32_t lastSendHeatingOff = 0;
|
||||||
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && (uuid::get_uptime_sec() - lastSendHeatingOff) >= 60) {
|
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && (uuid::get_uptime_sec() - lastSendHeatingOff) >= 60) {
|
||||||
lastSendHeatingOff = uuid::get_uptime_sec();
|
lastSendHeatingOff = uuid::get_uptime_sec();
|
||||||
|
if (has_telegram_id(0xE4)) {
|
||||||
|
uint8_t data[] = {1, 0, 0, 1, 1};
|
||||||
|
write_command(EMS_TYPE_UBASetPoints2, 0, data, sizeof(data), 0);
|
||||||
|
} else {
|
||||||
uint8_t data[] = {0, 0, 0, 0};
|
uint8_t data[] = {0, 0, 0, 0};
|
||||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// calculate energy for boiler 0x08 from stored modulation an time in units of 0.01 Wh
|
// calculate energy for boiler 0x08 from stored modulation an time in units of 0.01 Wh
|
||||||
if (!isHeatPump() && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
if (!isHeatPump() && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
||||||
@@ -1841,9 +1846,14 @@ void Boiler::process_UBASetPoints(std::shared_ptr<const Telegram> telegram) {
|
|||||||
|
|
||||||
// overwrite other settings on receive?
|
// overwrite other settings on receive?
|
||||||
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && telegram->dest == 0x08 && (setFlowTemp_ + setBurnPow_ + wwSetBurnPow_) != 0) {
|
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && telegram->dest == 0x08 && (setFlowTemp_ + setBurnPow_ + wwSetBurnPow_) != 0) {
|
||||||
|
if (has_telegram_id(0xE4)) {
|
||||||
|
uint8_t data[] = {1, 0, 0, 1, 1};
|
||||||
|
write_command(EMS_TYPE_UBASetPoints2, 0, data, sizeof(data), 0);
|
||||||
|
} else {
|
||||||
uint8_t data[] = {0, 0, 0, 0};
|
uint8_t data[] = {0, 0, 0, 0};
|
||||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0x35 - not yet implemented, not readable, only for settings
|
// 0x35 - not yet implemented, not readable, only for settings
|
||||||
@@ -2420,12 +2430,16 @@ bool Boiler::set_flow_temp(const char * value, const int8_t id) {
|
|||||||
// see https://github.com/emsesp/EMS-ESP32/issues/654, https://github.com/emsesp/EMS-ESP32/issues/954
|
// see https://github.com/emsesp/EMS-ESP32/issues/654, https://github.com/emsesp/EMS-ESP32/issues/954
|
||||||
if (v == selFlowTemp_) {
|
if (v == selFlowTemp_) {
|
||||||
uint8_t v1 = v;
|
uint8_t v1 = v;
|
||||||
|
if (has_telegram_id(0xE4)) {
|
||||||
|
EMSESP::txservice_.add(Telegram::Operation::TX_WRITE, device_id(), EMS_TYPE_UBASetPoints2, 1, &v1, 1, 0, false);
|
||||||
|
} else {
|
||||||
EMSESP::txservice_.add(Telegram::Operation::TX_WRITE, device_id(), EMS_TYPE_UBASetPoints, 0, &v1, 1, 0, false);
|
EMSESP::txservice_.add(Telegram::Operation::TX_WRITE, device_id(), EMS_TYPE_UBASetPoints, 0, &v1, 1, 0, false);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (has_telegram_id(0xE4)) {
|
if (has_telegram_id(0xE4)) {
|
||||||
write_command(EMS_TYPE_UBASetPoints, 0, v, 0xE4);
|
write_command(EMS_TYPE_UBASetPoints2, 1, v, 0xE4);
|
||||||
} else {
|
} else {
|
||||||
write_command(EMS_TYPE_UBASetPoints, 0, v, 0x18);
|
write_command(EMS_TYPE_UBASetPoints, 0, v, 0x18);
|
||||||
}
|
}
|
||||||
@@ -2439,8 +2453,11 @@ bool Boiler::set_burn_power(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
write_command(EMS_TYPE_UBASetPoints, 1, v, EMS_TYPE_UBASetPoints);
|
if (has_telegram_id(0xE4)) {
|
||||||
|
write_command(EMS_TYPE_UBASetPoints2, 2, v);
|
||||||
|
} else {
|
||||||
|
write_command(EMS_TYPE_UBASetPoints, 1, v);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3418,12 +3435,17 @@ bool Boiler::set_forceHeatingOff(const char * value, const int8_t id) {
|
|||||||
if (Helpers::value2bool(value, v)) {
|
if (Helpers::value2bool(value, v)) {
|
||||||
has_update(forceHeatingOff_, v);
|
has_update(forceHeatingOff_, v);
|
||||||
if (!v && Helpers::hasValue(heatingTemp_)) {
|
if (!v && Helpers::hasValue(heatingTemp_)) {
|
||||||
|
if (has_telegram_id(0xE4)) {
|
||||||
|
uint8_t data[] = {1, heatingTemp_, (Helpers::hasValue(burnMaxPower_) ? burnMaxPower_ : (uint8_t)100), 1, 1};
|
||||||
|
write_command(EMS_TYPE_UBASetPoints2, 0, data, sizeof(data), 0);
|
||||||
|
} else {
|
||||||
uint8_t data[] = {heatingTemp_,
|
uint8_t data[] = {heatingTemp_,
|
||||||
(Helpers::hasValue(burnMaxPower_) ? burnMaxPower_ : (uint8_t)100),
|
(Helpers::hasValue(burnMaxPower_) ? burnMaxPower_ : (uint8_t)100),
|
||||||
(Helpers::hasValue(pumpModMax_) ? pumpModMax_ : (uint8_t)0),
|
(Helpers::hasValue(pumpModMax_) ? pumpModMax_ : (uint8_t)0),
|
||||||
0};
|
0};
|
||||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user