mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 09:19:51 +03:00
add forceheatingoff
This commit is contained in:
@@ -61,6 +61,10 @@
|
||||
#define EMSESP_DEFAULT_TRACELOG_RAW false
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_BOILER_HEATINGOFF
|
||||
#define EMSESP_DEFAULT_BOILER_HEATINGOFF false
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_SHOWER_TIMER
|
||||
#define EMSESP_DEFAULT_SHOWER_TIMER false
|
||||
#endif
|
||||
|
||||
@@ -119,7 +119,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
// 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);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&forceHeatingOff_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(forceHeatingOff),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_forceHeatingOff));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatingActive_, DeviceValueType::BOOL, FL_(heatingActive), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &tapwaterActive_, DeviceValueType::BOOL, FL_(tapwaterActive), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &selFlowTemp_, DeviceValueType::UINT, FL_(selFlowTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flow_temp));
|
||||
@@ -963,6 +968,11 @@ void Boiler::check_active() {
|
||||
EMSESP::tap_water_active(b); // let EMS-ESP know, used in the Shower class
|
||||
}
|
||||
|
||||
if (!Helpers::hasValue(forceHeatingOff_, EMS_VALUE_BOOL)) {
|
||||
EMSESP::webSettingsService.read([&](WebSettings & settings) { forceHeatingOff_ = (settings.boiler_heatingoff || selFlowTemp_ == 0) ? 1 : 0; });
|
||||
has_update(&forceHeatingOff_);
|
||||
}
|
||||
|
||||
// calculate energy for boiler 0x08 from stored modulation an time in units of 0.01 Wh
|
||||
if (model() != EMS_DEVICE_FLAG_HEATPUMP) {
|
||||
// remember values from last call
|
||||
@@ -1220,6 +1230,11 @@ void Boiler::process_UBAMonitorSlow(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, burn2WorkMin_, 16, 3); // force to 3 bytes
|
||||
has_update(telegram, heatWorkMin_, 19, 3); // force to 3 bytes
|
||||
has_update(telegram, heatStarts_, 22, 3); // force to 3 bytes
|
||||
|
||||
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && telegram->dest == 0) {
|
||||
uint8_t data[] = {0, 0, 0, 0};
|
||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1250,6 +1265,11 @@ void Boiler::process_UBAMonitorSlowPlus(std::shared_ptr<const Telegram> telegram
|
||||
has_update(telegram, heatStarts_, 22, 3); // force to 3 bytes
|
||||
has_update(telegram, heatingPumpMod_, 25);
|
||||
// temperature measurements at 4, see #620
|
||||
|
||||
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && telegram->dest == 0) {
|
||||
uint8_t data[] = {0, 0, 0, 0};
|
||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1499,6 +1519,12 @@ void Boiler::process_UBASetPoints(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, setFlowTemp_, 0); // boiler set temp from thermostat
|
||||
has_update(telegram, setBurnPow_, 1); // max burner power in %
|
||||
has_update(telegram, wwSetPumpPower_, 2); // ww pump speed/power?
|
||||
|
||||
// overwrite other settings on receive?
|
||||
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && telegram->dest == 0x08) {
|
||||
uint8_t data[] = {0, 0, 0, 0};
|
||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
@@ -2049,9 +2075,6 @@ bool Boiler::set_ww_chargeOptimization(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// set dhw max power
|
||||
bool Boiler::set_ww_maxpower(const char * value, const int8_t id) {
|
||||
int v;
|
||||
@@ -2360,12 +2383,10 @@ bool Boiler::set_reset(const char * value, const int8_t id) {
|
||||
} else if (num == 1) {
|
||||
// LOG_INFO("Reset boiler maintenance message");
|
||||
write_command(0x05, 0x08, 0xFF, 0x1C);
|
||||
has_update(&reset_);
|
||||
return true;
|
||||
} else if (num == 2) {
|
||||
// LOG_INFO("Reset boiler error message");
|
||||
write_command(0x05, 0x00, 0x5A); // error reset
|
||||
has_update(&reset_);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -2768,6 +2789,22 @@ bool Boiler::set_wwAltOpPrio(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Boiler::set_forceHeatingOff(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (Helpers::value2bool(value, v)) {
|
||||
has_update(forceHeatingOff_, v);
|
||||
if (!v && Helpers::hasValue(heatingTemp_)) {
|
||||
uint8_t data[] = {heatingTemp_,
|
||||
(Helpers::hasValue(burnMaxPower_) ? burnMaxPower_ : (uint8_t)100),
|
||||
(Helpers::hasValue(pumpModMax_) ? pumpModMax_ : (uint8_t)0),
|
||||
0};
|
||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// energy counters. Setting an invalid value does not update, but trigger a store.
|
||||
bool Boiler::set_nrgHeat(const char * value, const int8_t id) {
|
||||
float v;
|
||||
|
||||
@@ -88,7 +88,6 @@ class Boiler : public EMSdevice {
|
||||
uint32_t wwWorkM_; // DHW minutes
|
||||
int8_t wwHystOn_;
|
||||
int8_t wwHystOff_;
|
||||
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
|
||||
uint16_t wwMixerTemp_; // mixing temperature
|
||||
uint16_t wwCylMiddleTemp_; // Cyl middle temperature (TS3)
|
||||
uint16_t wwSolarTemp_;
|
||||
@@ -96,6 +95,10 @@ class Boiler : public EMSdevice {
|
||||
uint8_t wwAltOpPrioHeat_; // alternating operation, prioritize heat time
|
||||
uint8_t wwAltOpPrioWw_; // alternating operation, prioritize dhw time
|
||||
|
||||
// special function
|
||||
uint8_t forceHeatingOff_;
|
||||
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
|
||||
|
||||
// main
|
||||
uint8_t reset_; // for reset command
|
||||
uint8_t heatingActive_; // Central heating is on/off
|
||||
@@ -470,6 +473,8 @@ class Boiler : public EMSdevice {
|
||||
inline bool set_wwAltOpPrioWw(const char * value, const int8_t id) {
|
||||
return set_wwAltOpPrio(value, 3);
|
||||
}
|
||||
bool set_forceHeatingOff(const char * value, const int8_t id);
|
||||
|
||||
/*
|
||||
bool set_hybridStrategy(const char * value, const int8_t id);
|
||||
bool set_switchOverTemp(const char * value, const int8_t id);
|
||||
|
||||
@@ -283,6 +283,7 @@ MAKE_TRANSLATION(haclimate, "haclimate", "Discovery current room temperature", "
|
||||
|
||||
// Entity translations: tag, mqtt, en, de, nl, sv, pl, no, fr, tr, it
|
||||
// Boiler
|
||||
MAKE_TRANSLATION(forceHeatingOff, "heatingoff", "force heating off", "Heizen abschalten", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(wwtapactivated, "wwtapactivated", "turn on/off", "Durchlauferhitzer aktiv", "zet aan/uit", "på/av", "system przygotowywania", "Varmtvann active", "ecs activée", "aç/kapa", "commuta on/off")
|
||||
MAKE_TRANSLATION(reset, "reset", "reset", "Reset", "Reset", "Nollställ", "kasowanie komunikatu", "nullstill", "reset", "Sıfırla", "Reset")
|
||||
MAKE_TRANSLATION(oilPreHeat, "oilpreheat", "oil preheating", "Ölvorwärmung", "Olie voorverwarming", "Förvärmning olja", "podgrzewanie oleju", "oljeforvarming", "préchauffage de l'huile", "Yakıt Ön ısıtma devrede", "preriscaldamento olio")
|
||||
|
||||
@@ -46,6 +46,7 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) {
|
||||
root["syslog_mark_interval"] = settings.syslog_mark_interval;
|
||||
root["syslog_host"] = settings.syslog_host;
|
||||
root["syslog_port"] = settings.syslog_port;
|
||||
root["boiler_heatingoff"] = settings.boiler_heatingoff;
|
||||
root["shower_timer"] = settings.shower_timer;
|
||||
root["shower_alert"] = settings.shower_alert;
|
||||
root["shower_alert_coldshot"] = settings.shower_alert_coldshot;
|
||||
@@ -273,8 +274,9 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
||||
settings.trace_raw = root["trace_raw"] | EMSESP_DEFAULT_TRACELOG_RAW;
|
||||
EMSESP::trace_raw(settings.trace_raw);
|
||||
|
||||
settings.notoken_api = root["notoken_api"] | EMSESP_DEFAULT_NOTOKEN_API;
|
||||
settings.solar_maxflow = root["solar_maxflow"] | EMSESP_DEFAULT_SOLAR_MAXFLOW;
|
||||
settings.notoken_api = root["notoken_api"] | EMSESP_DEFAULT_NOTOKEN_API;
|
||||
settings.solar_maxflow = root["solar_maxflow"] | EMSESP_DEFAULT_SOLAR_MAXFLOW;
|
||||
settings.boiler_heatingoff = root["boiler_heatingoff"] | EMSESP_DEFAULT_BOILER_HEATINGOFF;
|
||||
|
||||
settings.fahrenheit = root["fahrenheit"];
|
||||
EMSESP::system_.fahrenheit(settings.fahrenheit);
|
||||
|
||||
@@ -33,6 +33,7 @@ class WebSettings {
|
||||
String locale;
|
||||
uint8_t tx_mode;
|
||||
uint8_t ems_bus_id;
|
||||
bool boiler_heatingoff;
|
||||
bool shower_timer;
|
||||
bool shower_alert;
|
||||
uint8_t shower_alert_trigger;
|
||||
|
||||
Reference in New Issue
Block a user