mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
fix for "heat" https://github.com/proddy/EMS-ESP/issues/190
This commit is contained in:
@@ -1684,7 +1684,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
myDebug_P(PSTR("MQTT topic: thermostat HC%d mode value %s"), hc, message);
|
myDebug_P(PSTR("MQTT topic: thermostat HC%d mode value %s"), hc, message);
|
||||||
if (strcmp((char *)message, "auto") == 0) {
|
if (strcmp((char *)message, "auto") == 0) {
|
||||||
ems_setThermostatMode(2, hc);
|
ems_setThermostatMode(2, hc);
|
||||||
} else if (strcmp((char *)message, "day") == 0 || strcmp((char *)message, "manual") == 0) {
|
} else if (strcmp((char *)message, "day") == 0 || (strcmp((char *)message, "manual") == 0) || (strcmp((char *)message, "heat") == 0)) {
|
||||||
ems_setThermostatMode(1, hc);
|
ems_setThermostatMode(1, hc);
|
||||||
} else if (strcmp((char *)message, "night") == 0 || strcmp((char *)message, "off") == 0) {
|
} else if (strcmp((char *)message, "night") == 0 || strcmp((char *)message, "off") == 0) {
|
||||||
ems_setThermostatMode(0, hc);
|
ems_setThermostatMode(0, hc);
|
||||||
@@ -1698,7 +1698,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
float f = strtof((char *)message, 0);
|
float f = strtof((char *)message, 0);
|
||||||
char s[10] = {0};
|
char s[10] = {0};
|
||||||
myDebug_P(PSTR("MQTT topic: new thermostat HC%d night temperature value %s"), hc, _float_to_char(s, f));
|
myDebug_P(PSTR("MQTT topic: new thermostat HC%d night temperature value %s"), hc, _float_to_char(s, f));
|
||||||
ems_setThermostatTemp(f, hc, 1);
|
ems_setThermostatTemp(f, hc, 1); // night
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1708,7 +1708,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
float f = strtof((char *)message, 0);
|
float f = strtof((char *)message, 0);
|
||||||
char s[10] = {0};
|
char s[10] = {0};
|
||||||
myDebug_P(PSTR("MQTT topic: new thermostat HC%d day temperature value %s"), hc, _float_to_char(s, f));
|
myDebug_P(PSTR("MQTT topic: new thermostat HC%d day temperature value %s"), hc, _float_to_char(s, f));
|
||||||
ems_setThermostatTemp(f, hc, 2);
|
ems_setThermostatTemp(f, hc, 2); // day
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1718,7 +1718,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
float f = strtof((char *)message, 0);
|
float f = strtof((char *)message, 0);
|
||||||
char s[10] = {0};
|
char s[10] = {0};
|
||||||
myDebug_P(PSTR("MQTT topic: new thermostat HC%d holiday temperature value %s"), hc, _float_to_char(s, f));
|
myDebug_P(PSTR("MQTT topic: new thermostat HC%d holiday temperature value %s"), hc, _float_to_char(s, f));
|
||||||
ems_setThermostatTemp(f, hc, 3);
|
ems_setThermostatTemp(f, hc, 3); // holiday
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2713,7 +2713,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype)
|
|||||||
EMS_TxTelegram.action = EMS_TX_TELEGRAM_WRITE;
|
EMS_TxTelegram.action = EMS_TX_TELEGRAM_WRITE;
|
||||||
EMS_TxTelegram.dest = device_id;
|
EMS_TxTelegram.dest = device_id;
|
||||||
|
|
||||||
myDebug_P(PSTR("Setting new thermostat temperature for heating circuit %d"), hc_num);
|
myDebug_P(PSTR("Setting new thermostat temperature for heating circuit %d type %d (0=none,1=night,2=day,3=holiday)"), hc_num, temptype);
|
||||||
|
|
||||||
if (model_id == EMS_MODEL_RC20) {
|
if (model_id == EMS_MODEL_RC20) {
|
||||||
EMS_TxTelegram.type = EMS_TYPE_RC20Set;
|
EMS_TxTelegram.type = EMS_TYPE_RC20Set;
|
||||||
@@ -2825,7 +2825,7 @@ void ems_setThermostatMode(uint8_t mode, uint8_t hc_num) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myDebug_P(PSTR("Setting thermostat mode to %d for heating circuit"), mode, hc_num);
|
myDebug_P(PSTR("Setting thermostat mode to %d for heating circuit %d"), mode, hc_num);
|
||||||
|
|
||||||
_EMS_TxTelegram EMS_TxTelegram = EMS_TX_TELEGRAM_NEW; // create new Tx
|
_EMS_TxTelegram EMS_TxTelegram = EMS_TX_TELEGRAM_NEW; // create new Tx
|
||||||
EMS_TxTelegram.timestamp = millis(); // set timestamp
|
EMS_TxTelegram.timestamp = millis(); // set timestamp
|
||||||
|
|||||||
Reference in New Issue
Block a user