mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
RC20RF tap water one time loading function
This commit is contained in:
@@ -593,6 +593,9 @@ void publishValues(bool force) {
|
||||
if (EMS_Boiler.wWActivated != EMS_VALUE_INT_NOTSET)
|
||||
rootBoiler["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated);
|
||||
|
||||
if (EMS_Boiler.wWActivated != EMS_VALUE_INT_NOTSET)
|
||||
rootBoiler["wWOnetime"] = _bool_to_char(s, EMS_Boiler.wWOneTime);
|
||||
|
||||
if (EMS_Boiler.burnGas != EMS_VALUE_INT_NOTSET)
|
||||
rootBoiler["burnGas"] = _bool_to_char(s, EMS_Boiler.burnGas);
|
||||
|
||||
@@ -1506,8 +1509,9 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
||||
// this is used for example for comfort, flowtemp
|
||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD);
|
||||
|
||||
// these two need to be unqiue topics
|
||||
// these three need to be unqiue topics
|
||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWACTIVATED);
|
||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWONETIME);
|
||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWTEMP);
|
||||
|
||||
// generic incoming MQTT command for EMS-ESP
|
||||
@@ -1621,6 +1625,16 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
||||
return;
|
||||
}
|
||||
|
||||
// wwOneTime
|
||||
if (strcmp(topic, TOPIC_BOILER_CMD_WWONETIME) == 0) {
|
||||
if (message[0] == '1' || strcmp(message, "on") == 0) {
|
||||
ems_setWarmWaterOnetime(true);
|
||||
} else if (message[0] == '0' || strcmp(message, "off") == 0) {
|
||||
ems_setWarmWaterOnetime(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// boiler wwtemp changes
|
||||
if (strcmp(topic, TOPIC_BOILER_CMD_WWTEMP) == 0) {
|
||||
uint8_t t = atoi((char *)message);
|
||||
|
||||
22
src/ems.cpp
22
src/ems.cpp
@@ -1292,6 +1292,28 @@ void _process_UBAMonitorWWMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
EMS_Boiler.wWCurFlow = _toByte(9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate / De-activate One Time warm water 0x35
|
||||
* true = on, false = off
|
||||
*/
|
||||
void ems_setWarmWaterOnetime(bool activated) {
|
||||
myDebug_P(PSTR("Setting boiler warm water OneTime loading %s"), activated ? "on" : "off");
|
||||
|
||||
_EMS_TxTelegram EMS_TxTelegram = EMS_TX_TELEGRAM_NEW; // create new Tx
|
||||
EMS_TxTelegram.timestamp = millis(); // set timestamp
|
||||
EMS_Sys_Status.txRetryCount = 0; // reset retry counter
|
||||
|
||||
EMS_TxTelegram.action = EMS_TX_TELEGRAM_WRITE;
|
||||
EMS_TxTelegram.dest = EMS_Boiler.device_id;
|
||||
EMS_TxTelegram.type = EMS_TYPE_UBAFlags;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_UBAParameterWW_wwOneTime;
|
||||
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH;
|
||||
EMS_TxTelegram.type_validate = EMS_ID_NONE; // don't validate
|
||||
EMS_TxTelegram.dataValue = (activated ? 0x22 : 0x02); // 0x22 is on, 0x02 is off for RC20RF
|
||||
|
||||
EMS_TxQueue.push(EMS_TxTelegram);
|
||||
}
|
||||
|
||||
/**
|
||||
* UBAMonitorFast - type 0x18 - central heating monitor part 1 (25 bytes long)
|
||||
* received every 10 seconds
|
||||
|
||||
@@ -408,6 +408,7 @@ void ems_setThermostatMode(uint8_t mode, uint8_t hc);
|
||||
void ems_setWarmWaterTemp(uint8_t temperature);
|
||||
void ems_setFlowTemp(uint8_t temperature);
|
||||
void ems_setWarmWaterActivated(bool activated);
|
||||
void ems_setWarmWaterOnetime(bool activated);
|
||||
void ems_setWarmTapWaterActivated(bool activated);
|
||||
void ems_setPoll(bool b);
|
||||
void ems_setLogging(_EMS_SYS_LOGGING loglevel, bool silent = false);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define EMS_TYPE_UBAMaintenanceStatusMessage 0x1C // is an automatic monitor broadcast
|
||||
#define EMS_TYPE_UBAParameterWW 0x33
|
||||
#define EMS_TYPE_UBATotalUptimeMessage 0x14
|
||||
#define EMS_TYPE_UBAFlags 0x35
|
||||
#define EMS_TYPE_UBAMaintenanceSettingsMessage 0x15
|
||||
#define EMS_TYPE_UBAParametersMessage 0x16
|
||||
#define EMS_TYPE_UBASetPoints 0x1A
|
||||
@@ -33,6 +34,7 @@
|
||||
|
||||
#define EMS_OFFSET_UBAParameterWW_wwtemp 2 // WW Temperature
|
||||
#define EMS_OFFSET_UBAParameterWW_wwactivated 1 // WW Activated
|
||||
#define EMS_OFFSET_UBAParameterWW_wwOneTime 5 // WW OneTime loading
|
||||
#define EMS_OFFSET_UBAParameterWW_wwComfort 9 // WW is in comfort or eco mode
|
||||
#define EMS_VALUE_UBAParameterWW_wwComfort_Hot 0x00 // the value for hot
|
||||
#define EMS_VALUE_UBAParameterWW_wwComfort_Eco 0xD8 // the value for eco
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
#define TOPIC_BOILER_CMD "boiler_cmd" // for receiving boiler commands via MQTT
|
||||
#define TOPIC_BOILER_CMD_WWACTIVATED "boiler_cmd_wwactivated" // change water on/off
|
||||
#define TOPIC_BOILER_CMD_WWONETIME "boiler_cmd_wwonetime" // warm warter one time loading
|
||||
#define TOPIC_BOILER_CMD_WWTEMP "boiler_cmd_wwtemp" // wwtemp changes via MQTT
|
||||
#define TOPIC_BOILER_CMD_COMFORT "comfort" // ww comfort setting via MQTT
|
||||
#define TOPIC_BOILER_CMD_FLOWTEMP "flowtemp" // flowtemp value via MQTT
|
||||
|
||||
Reference in New Issue
Block a user