RC20RF tap water one time loading function

This commit is contained in:
Christian Weithe
2019-10-28 19:26:29 +01:00
parent 13f86edd8a
commit c62502052d
5 changed files with 41 additions and 1 deletions

View File

@@ -592,6 +592,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);