mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
Merge branch 'dev_' into dev_no_master_thermostat
This commit is contained in:
@@ -48,6 +48,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
|
||||
// the telegram handlers...
|
||||
// common for all boilers
|
||||
register_telegram_type(0xBF, F("ErrorMessage"), false, MAKE_PF_CB(process_ErrorMessage));
|
||||
register_telegram_type(0x10, F("UBAErrorMessage1"), false, MAKE_PF_CB(process_UBAErrorMessage));
|
||||
register_telegram_type(0x11, F("UBAErrorMessage2"), false, MAKE_PF_CB(process_UBAErrorMessage));
|
||||
register_telegram_type(0xC2, F("UBAErrorMessage3"), false, MAKE_PF_CB(process_UBAErrorMessage2));
|
||||
@@ -70,7 +71,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
}
|
||||
|
||||
// only EMS+
|
||||
if (model() != EMSdevice::EMS_DEVICE_FLAG_EMS && model() != EMSdevice::EMS_DEVICE_FLAG_HT3) {
|
||||
if (model() != EMSdevice::EMS_DEVICE_FLAG_EMS && model() != EMSdevice::EMS_DEVICE_FLAG_HT3 && model() != EMSdevice::EMS_DEVICE_FLAG_HYBRID) {
|
||||
register_telegram_type(0xD1, F("UBAOutdoorTemp"), false, MAKE_PF_CB(process_UBAOutdoorTemp));
|
||||
register_telegram_type(0xE3, F("UBAMonitorSlowPlus2"), false, MAKE_PF_CB(process_UBAMonitorSlowPlus2));
|
||||
register_telegram_type(0xE4, F("UBAMonitorFastPlus"), false, MAKE_PF_CB(process_UBAMonitorFastPlus));
|
||||
@@ -88,6 +89,11 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_telegram_type(0x48A, F("HpPool"), true, MAKE_PF_CB(process_HpPool));
|
||||
}
|
||||
|
||||
/*
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_HYBRID) {
|
||||
register_telegram_type(0xBB, F("HybridHp"), true, MAKE_PF_CB(process_HybridHp));
|
||||
}
|
||||
*/
|
||||
// reset is a command uses a dummy variable which is always zero, shown as blank, but provides command enum options
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &reset_, DeviceValueType::CMD, FL_(enum_reset), FL_(reset), DeviceValueUOM::NONE, MAKE_CF_CB(set_reset));
|
||||
has_update(reset_, 0);
|
||||
@@ -196,6 +202,72 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_maintenancedate));
|
||||
|
||||
/*
|
||||
// Hybrid Heatpump
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_HYBRID) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hybridStrategy_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_hybridStrategy),
|
||||
FL_(hybridStrategy),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_hybridStrategy));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&switchOverTemp_,
|
||||
DeviceValueType::INT,
|
||||
nullptr,
|
||||
FL_(switchOverTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_switchOverTemp),
|
||||
-20,
|
||||
20);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyCostRatio_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
FL_(energyCostRatio),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_energyCostRatio),
|
||||
0,
|
||||
19.9);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&fossileFactor_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
FL_(fossileFactor),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_fossileFactor),
|
||||
0,
|
||||
5);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&electricFactor_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
FL_(electricFactor),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_electricFactor),
|
||||
0,
|
||||
5);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&delayBoiler_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(delayBoiler),
|
||||
DeviceValueUOM::MINUTES,
|
||||
MAKE_CF_CB(set_delayBoiler),
|
||||
5,
|
||||
120);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&tempDiffBoiler_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(tempDiffBoiler),
|
||||
DeviceValueUOM::DEGREES_R,
|
||||
MAKE_CF_CB(set_tempDiffBoiler),
|
||||
1,
|
||||
99);
|
||||
}
|
||||
*/
|
||||
// heatpump info
|
||||
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &upTimeControl_, DeviceValueType::TIME, FL_(div60), FL_(upTimeControl), DeviceValueUOM::MINUTES);
|
||||
@@ -629,9 +701,10 @@ void Boiler::process_UBAMonitorSlow(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, exhaustTemp_, 4);
|
||||
has_update(telegram, switchTemp_, 25); // only if there is a mixer module present
|
||||
has_update(telegram, heatingPumpMod_, 9);
|
||||
has_update(telegram, burnStarts_, 10, 3); // force to 3 bytes
|
||||
has_update(telegram, burnWorkMin_, 13, 3); // force to 3 bytes
|
||||
has_update(telegram, heatWorkMin_, 19, 3); // force to 3 bytes
|
||||
has_update(telegram, burnStarts_, 10, 3); // force to 3 bytes
|
||||
has_update(telegram, burnWorkMin_, 13, 3); // force to 3 bytes
|
||||
has_update(telegram, burn2WorkMin_, 16, 3); // force to 3 bytes
|
||||
has_update(telegram, heatWorkMin_, 19, 3); // force to 3 bytes
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -653,9 +726,10 @@ void Boiler::process_UBAMonitorSlowPlus(std::shared_ptr<const Telegram> telegram
|
||||
has_bitupdate(telegram, heatingPump_, 2, 5);
|
||||
has_bitupdate(telegram, wwCirc_, 2, 7);
|
||||
has_update(telegram, exhaustTemp_, 6);
|
||||
has_update(telegram, burnStarts_, 10, 3); // force to 3 bytes
|
||||
has_update(telegram, burnWorkMin_, 13, 3); // force to 3 bytes
|
||||
has_update(telegram, heatWorkMin_, 19, 3); // force to 3 bytes
|
||||
has_update(telegram, burnStarts_, 10, 3); // force to 3 bytes
|
||||
has_update(telegram, burnWorkMin_, 13, 3); // force to 3 bytes
|
||||
has_update(telegram, burn2WorkMin_, 16, 3); // force to 3 bytes
|
||||
has_update(telegram, heatWorkMin_, 19, 3); // force to 3 bytes
|
||||
has_update(telegram, heatingPumpMod_, 25);
|
||||
// temperature measurements at 4, see #620
|
||||
}
|
||||
@@ -869,6 +943,11 @@ void Boiler::process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegr
|
||||
}
|
||||
}
|
||||
|
||||
// 0xBF
|
||||
void Boiler::process_ErrorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
EMSESP::send_read_request(0xC2, device_id()); // read last errorcode
|
||||
}
|
||||
|
||||
// 0x10, 0x11
|
||||
void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset > 0 || telegram->message_length < 11) {
|
||||
@@ -984,6 +1063,86 @@ void Boiler::process_UBAMaintenanceData(std::shared_ptr<const Telegram> telegram
|
||||
has_update(maintenanceDate_, date, sizeof(maintenanceDate_));
|
||||
}
|
||||
}
|
||||
/*
|
||||
// 0xBB Heatpump optimization
|
||||
// Boiler(0x08) -> Me(0x0B), ?(0xBB), data: 00 00 00 00 00 00 00 00 00 00 00 FF 02 0F 1E 0B 1A 00 14 03
|
||||
void Boiler::process_HybridHp(std::shared_ptr<const Telegram> telegram) {
|
||||
has_enumupdate(telegram, hybridStrategy_, 12, 1); // cost = 2, temperature = 3, mix = 4
|
||||
has_update(telegram, switchOverTemp_, 13); // full degrees
|
||||
has_update(telegram, energyCostRatio_, 14); // is *10
|
||||
has_update(telegram, fossileFactor_, 15); // is * 10
|
||||
has_update(telegram, electricFactor_, 16); // is * 10
|
||||
has_update(telegram, delayBoiler_, 18); // minutes
|
||||
has_update(telegram, tempDiffBoiler_, 19); // relative degrees
|
||||
}
|
||||
*/
|
||||
/*
|
||||
* Settings
|
||||
*/
|
||||
/*
|
||||
bool Boiler::set_hybridStrategy(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_hybridStrategy))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 12, v + 1, 0xBB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Boiler::set_switchOverTemp(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 13, v, 0xBB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Boiler::set_energyCostRatio(const char * value, const int8_t id) {
|
||||
float v;
|
||||
if (!Helpers::value2float(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 14, (uint8_t)(v * 10), 0xBB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Boiler::set_fossileFactor(const char * value, const int8_t id) {
|
||||
float v;
|
||||
if (!Helpers::value2float(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 15, (uint8_t)(v * 10), 0xBB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Boiler::set_electricFactor(const char * value, const int8_t id) {
|
||||
float v;
|
||||
if (!Helpers::value2float(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 16, (uint8_t)(v * 10), 0xBB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Boiler::set_delayBoiler(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 18, v, 0xBB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Boiler::set_tempDiffBoiler(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2temperature(value, v, true)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xBB, 19, v, 0xBB);
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
// Set the dhw temperature 0x33/0x35 or 0xEA
|
||||
bool Boiler::set_ww_temp(const char * value, const int8_t id) {
|
||||
@@ -1475,12 +1634,12 @@ bool Boiler::set_reset(const char * value, const int8_t id) {
|
||||
if (num == 1) {
|
||||
// LOG_INFO(F("Reset boiler maintenance message"));
|
||||
write_command(0x05, 0x08, 0xFF, 0x1C);
|
||||
has_update(reset_);
|
||||
has_update(&reset_);
|
||||
return true;
|
||||
} else if (num == 2) {
|
||||
// LOG_INFO(F("Reset boiler error message"));
|
||||
write_command(0x05, 0x00, 0x5A); // error reset
|
||||
has_update(reset_);
|
||||
has_update(&reset_);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user