This commit is contained in:
proddy
2020-12-16 18:30:31 +01:00
parent a8b89e8d35
commit 3bbd4ef66f
5 changed files with 66 additions and 12 deletions

View File

@@ -82,6 +82,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_mqtt_cmd(F("pumpdelay"), [&](const char * value, const int8_t id) { return set_pump_delay(value, id); });
// register_mqtt_cmd(F("reset"), [&](const char * value, const int8_t id) { return set_reset(value, id); });
register_mqtt_cmd(F("maintenance"), [&](const char * value, const int8_t id) { return set_maintenance(value, id); });
register_mqtt_cmd(F("pumpmodmax"), [&](const char * value, const int8_t id) { return set_max_pump(value, id); });
register_mqtt_cmd(F("pumpmodmin"), [&](const char * value, const int8_t id) { return set_min_pump(value, id); });
System::show_mem("after mqtt cmd reg"); // TODO remove debug
@@ -743,6 +745,8 @@ void Boiler::process_UBAParametersPlus(std::shared_ptr<const Telegram> telegram)
has_update(telegram->read_value(boilHystOff_, 8));
has_update(telegram->read_value(boilHystOn_, 9));
has_update(telegram->read_value(burnMinPeriod_, 10));
// changed_ |= telegram->read_value(pumpModMax_, 13); // guess
// changed_ |= telegram->read_value(pumpModMin_, 14); // guess
}
// 0xEA
@@ -973,7 +977,7 @@ bool Boiler::set_heating_temp(const char * value, const int8_t id) {
return false;
}
LOG_INFO(F("Setting boiler heating temperature to "), v);
LOG_INFO(F("Setting boiler heating temperature to %d C"), v);
if (get_toggle_fetch(EMS_TYPE_UBAParametersPlus)) {
write_command(EMS_TYPE_UBAParametersPlus, 1, v, EMS_TYPE_UBAParametersPlus);
} else {
@@ -991,7 +995,7 @@ bool Boiler::set_min_power(const char * value, const int8_t id) {
return false;
}
LOG_INFO(F("Setting boiler min power to "), v);
LOG_INFO(F("Setting boiler min power to %d %%"), v);
if (get_toggle_fetch(EMS_TYPE_UBAParametersPlus)) {
write_command(EMS_TYPE_UBAParametersPlus, 7, v, EMS_TYPE_UBAParametersPlus);
} else {
@@ -1009,7 +1013,7 @@ bool Boiler::set_max_power(const char * value, const int8_t id) {
return false;
}
LOG_INFO(F("Setting boiler max power to %d C"), v);
LOG_INFO(F("Setting boiler max power to %d %%"), v);
if (get_toggle_fetch(EMS_TYPE_UBAParametersPlus)) {
write_command(EMS_TYPE_UBAParametersPlus, 6, v, EMS_TYPE_UBAParametersPlus);
} else {
@@ -1019,6 +1023,42 @@ bool Boiler::set_max_power(const char * value, const int8_t id) {
return true;
}
// set min pump modulation
bool Boiler::set_min_pump(const char * value, const int8_t id) {
int v = 0;
if (!Helpers::value2number(value, v)) {
LOG_WARNING(F("Set pump min: Invalid value"));
return false;
}
LOG_INFO(F("Setting pump min to %d %%"), v);
if (get_toggle_fetch(EMS_TYPE_UBAParametersPlus)) {
write_command(EMS_TYPE_UBAParametersPlus, 14, v, EMS_TYPE_UBAParametersPlus);
} else {
write_command(EMS_TYPE_UBAParameters, 10, v, EMS_TYPE_UBAParameters);
}
return true;
}
// set max pump modulation
bool Boiler::set_max_pump(const char * value, const int8_t id) {
int v = 0;
if (!Helpers::value2number(value, v)) {
LOG_WARNING(F("Set pump max: Invalid value"));
return false;
}
LOG_INFO(F("Setting pump max to %d %%"), v);
if (get_toggle_fetch(EMS_TYPE_UBAParametersPlus)) {
write_command(EMS_TYPE_UBAParametersPlus, 13, v, EMS_TYPE_UBAParametersPlus);
} else {
write_command(EMS_TYPE_UBAParameters, 9, v, EMS_TYPE_UBAParameters);
}
return true;
}
// set boiler on hysteresis
bool Boiler::set_hyst_on(const char * value, const int8_t id) {
int v = 0;

View File

@@ -189,6 +189,8 @@ class Boiler : public EMSdevice {
bool set_heating_temp(const char * value, const int8_t id);
bool set_min_power(const char * value, const int8_t id);
bool set_max_power(const char * value, const int8_t id);
bool set_min_pump(const char * value, const int8_t id);
bool set_max_pump(const char * value, const int8_t id);
bool set_hyst_on(const char * value, const int8_t id);
bool set_hyst_off(const char * value, const int8_t id);
bool set_burn_period(const char * value, const int8_t id);

View File

@@ -1043,7 +1043,7 @@ bool Thermostat::set_calinttemp(const char * value, const int8_t id) {
return false;
}
LOG_INFO(F("Calibrating internal temperature to %d.%d"), ct / 10, ct < 0 ? -ct % 10 : ct % 10);
LOG_INFO(F("Calibrating internal temperature to %d.%d C"), ct / 10, ct < 0 ? -ct % 10 : ct % 10);
write_command(EMS_TYPE_IBASettings, 2, ct, EMS_TYPE_IBASettings);
return true;
@@ -1120,8 +1120,8 @@ bool Thermostat::set_language(const char * value, const int8_t id) {
// Set the control-mode for hc 0-off, 1-RC20, 2-RC3x
bool Thermostat::set_control(const char * value, const int8_t id) {
int ctrl = 0;
if (!Helpers::value2number(value, ctrl)) {
uint8_t ctrl = 0;
if (!Helpers::value2enum(value, ctrl, {F("off"), F("rc20"), F("rc3x")})) {
LOG_WARNING(F("Set control: Invalid value"));
return false;
}
@@ -1167,7 +1167,7 @@ bool Thermostat::set_wwtemp(const char * value, const int8_t id) {
LOG_WARNING(F("Set warm water high temperature: Invalid value"));
return false;
}
LOG_INFO(F("Setting warm water high temperature to %d"), t);
LOG_INFO(F("Setting warm water high temperature to %d C"), t);
write_command(0x031B, 0, t, 0x031B);
return true;
}
@@ -1179,7 +1179,7 @@ bool Thermostat::set_wwtemplow(const char * value, const int8_t id) {
LOG_WARNING(F("Set warm water low temperature: Invalid value"));
return false;
}
LOG_INFO(F("Setting warm water low temperature to %d"), t);
LOG_INFO(F("Setting warm water low temperature to %d C"), t);
write_command(0x031B, 1, t, 0x031B);
return true;
}