mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
add mqtt-subscription for WWcirculation
This commit is contained in:
@@ -1423,6 +1423,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
// these three need to be unique topics
|
// these three need to be unique topics
|
||||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWACTIVATED);
|
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWACTIVATED);
|
||||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWONETIME);
|
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWONETIME);
|
||||||
|
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWCIRCULATION);
|
||||||
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWTEMP);
|
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWTEMP);
|
||||||
|
|
||||||
// generic incoming MQTT command for EMS-ESP
|
// generic incoming MQTT command for EMS-ESP
|
||||||
@@ -1552,6 +1553,16 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wwCirculation
|
||||||
|
if (strcmp(topic, TOPIC_BOILER_CMD_WWCIRCULATION) == 0) {
|
||||||
|
if (message[0] == '1' || strcmp(message, "on") == 0) {
|
||||||
|
ems_setWarmWaterCirculation(true);
|
||||||
|
} else if (message[0] == '0' || strcmp(message, "off") == 0) {
|
||||||
|
ems_setWarmWaterCirculation(false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// boiler wwtemp changes
|
// boiler wwtemp changes
|
||||||
if (strcmp(topic, TOPIC_BOILER_CMD_WWTEMP) == 0) {
|
if (strcmp(topic, TOPIC_BOILER_CMD_WWTEMP) == 0) {
|
||||||
uint8_t t = atoi((char *)message);
|
uint8_t t = atoi((char *)message);
|
||||||
|
|||||||
22
src/ems.cpp
22
src/ems.cpp
@@ -1013,13 +1013,33 @@ void ems_setWarmWaterOnetime(bool activated) {
|
|||||||
EMS_TxTelegram.timestamp = millis(); // set timestamp
|
EMS_TxTelegram.timestamp = millis(); // set timestamp
|
||||||
EMS_Sys_Status.txRetryCount = 0; // reset retry counter
|
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);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Activate / De-activate circulation of warm water 0x35
|
||||||
|
* true = on, false = off
|
||||||
|
*/
|
||||||
|
void ems_setWarmWaterCirculation(bool activated) {
|
||||||
|
myDebug_P(PSTR("Setting boiler warm water circulation %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.action = EMS_TX_TELEGRAM_WRITE;
|
||||||
EMS_TxTelegram.dest = EMS_Boiler.device_id;
|
EMS_TxTelegram.dest = EMS_Boiler.device_id;
|
||||||
EMS_TxTelegram.type = EMS_TYPE_UBAFlags;
|
EMS_TxTelegram.type = EMS_TYPE_UBAFlags;
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_UBAParameterWW_wwOneTime;
|
EMS_TxTelegram.offset = EMS_OFFSET_UBAParameterWW_wwOneTime;
|
||||||
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH+1;
|
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH+1;
|
||||||
EMS_TxTelegram.type_validate = EMS_ID_NONE; // don't validate
|
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_TxTelegram.data[4] = 0x11;
|
EMS_TxTelegram.data[4] = 0x11;
|
||||||
EMS_TxTelegram.data[5] = (activated ? 0x33 : 0x11);
|
EMS_TxTelegram.data[5] = (activated ? 0x33 : 0x11);
|
||||||
|
|
||||||
|
|||||||
@@ -432,6 +432,7 @@ void ems_setWarmWaterTemp(uint8_t temperature);
|
|||||||
void ems_setFlowTemp(uint8_t temperature);
|
void ems_setFlowTemp(uint8_t temperature);
|
||||||
void ems_setWarmWaterActivated(bool activated);
|
void ems_setWarmWaterActivated(bool activated);
|
||||||
void ems_setWarmWaterOnetime(bool activated);
|
void ems_setWarmWaterOnetime(bool activated);
|
||||||
|
void ems_setWarmWaterCirculation(bool activated);
|
||||||
void ems_setWarmTapWaterActivated(bool activated);
|
void ems_setWarmTapWaterActivated(bool activated);
|
||||||
void ems_setPoll(bool b);
|
void ems_setPoll(bool b);
|
||||||
void ems_setLogging(_EMS_SYS_LOGGING loglevel, uint16_t type_id);
|
void ems_setLogging(_EMS_SYS_LOGGING loglevel, uint16_t type_id);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#define TOPIC_BOILER_CMD "boiler_cmd" // for receiving boiler commands via MQTT
|
#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_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_WWONETIME "boiler_cmd_wwonetime" // warm warter one time loading
|
||||||
|
#define TOPIC_BOILER_CMD_WWCIRCULATION "boiler_cmd_wwcirculation" // start warm warter circulation
|
||||||
#define TOPIC_BOILER_CMD_WWTEMP "boiler_cmd_wwtemp" // wwtemp changes via MQTT
|
#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_COMFORT "comfort" // ww comfort setting via MQTT
|
||||||
#define TOPIC_BOILER_CMD_FLOWTEMP "flowtemp" // flowtemp value via MQTT
|
#define TOPIC_BOILER_CMD_FLOWTEMP "flowtemp" // flowtemp value via MQTT
|
||||||
|
|||||||
Reference in New Issue
Block a user