mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
RC300 changes - #256
This commit is contained in:
@@ -183,13 +183,13 @@ _EMS_THERMOSTAT_MODE _getThermostatMode(uint8_t hc_num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// figures out the thermostat day/night mode depending on the thermostat type
|
// figures out the thermostat day/night mode depending on the thermostat type
|
||||||
// returns {EMS_THERMOSTAT_MODE_NIGHT, EMS_THERMOSTAT_MODE_DAY}
|
// returns {EMS_THERMOSTAT_MODE_NIGHT, EMS_THERMOSTAT_MODE_DAY, etc...}
|
||||||
// hc_num is 1 to 4
|
// hc_num is 1 to 4
|
||||||
_EMS_THERMOSTAT_MODE _getThermostatDayMode(uint8_t hc_num) {
|
_EMS_THERMOSTAT_MODE _getThermostatMode2(uint8_t hc_num) {
|
||||||
_EMS_THERMOSTAT_MODE thermoMode = EMS_THERMOSTAT_MODE_UNKNOWN;
|
_EMS_THERMOSTAT_MODE thermoMode = EMS_THERMOSTAT_MODE_UNKNOWN;
|
||||||
uint8_t model = ems_getThermostatModel();
|
uint8_t model = ems_getThermostatModel();
|
||||||
|
|
||||||
uint8_t mode = EMS_Thermostat.hc[hc_num - 1].day_mode;
|
uint8_t mode = EMS_Thermostat.hc[hc_num - 1].mode_type;
|
||||||
|
|
||||||
if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||||
if (mode == 3) {
|
if (mode == 3) {
|
||||||
@@ -205,9 +205,9 @@ _EMS_THERMOSTAT_MODE _getThermostatDayMode(uint8_t hc_num) {
|
|||||||
}
|
}
|
||||||
} else if (model == EMS_DEVICE_FLAG_RC300) {
|
} else if (model == EMS_DEVICE_FLAG_RC300) {
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
thermoMode = EMS_THERMOSTAT_MODE_NIGHT;
|
thermoMode = EMS_THERMOSTAT_MODE_ECO;
|
||||||
} else if (mode == 1) {
|
} else if (mode == 1) {
|
||||||
thermoMode = EMS_THERMOSTAT_MODE_DAY;
|
thermoMode = EMS_THERMOSTAT_MODE_COMFORT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,6 +447,8 @@ void showInfo() {
|
|||||||
_renderIntValue(" Night temperature", "C", EMS_Thermostat.hc[hc_num - 1].nighttemp, 2); // convert to a single byte * 2
|
_renderIntValue(" Night temperature", "C", EMS_Thermostat.hc[hc_num - 1].nighttemp, 2); // convert to a single byte * 2
|
||||||
_renderIntValue(" Vacation temperature", "C", EMS_Thermostat.hc[hc_num - 1].holidaytemp, 2); // convert to a single byte * 2
|
_renderIntValue(" Vacation temperature", "C", EMS_Thermostat.hc[hc_num - 1].holidaytemp, 2); // convert to a single byte * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show flow temp if we have it
|
||||||
if (EMS_Thermostat.hc[hc_num - 1].circuitcalctemp < EMS_VALUE_INT_NOTSET)
|
if (EMS_Thermostat.hc[hc_num - 1].circuitcalctemp < EMS_VALUE_INT_NOTSET)
|
||||||
_renderIntValue(" Calculated flow temperature", "C", EMS_Thermostat.hc[hc_num - 1].circuitcalctemp);
|
_renderIntValue(" Calculated flow temperature", "C", EMS_Thermostat.hc[hc_num - 1].circuitcalctemp);
|
||||||
|
|
||||||
@@ -465,12 +467,18 @@ void showInfo() {
|
|||||||
myDebug_P(PSTR(" Mode is set to day"));
|
myDebug_P(PSTR(" Mode is set to day"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render Thermostat Day Mode
|
// Render Thermostat Mode2, only if its in Auto mode
|
||||||
thermoMode = _getThermostatDayMode(hc_num);
|
if (thermoMode == EMS_THERMOSTAT_MODE_AUTO) {
|
||||||
|
thermoMode = _getThermostatMode2(hc_num);
|
||||||
if (thermoMode == EMS_THERMOSTAT_MODE_NIGHT) {
|
if (thermoMode == EMS_THERMOSTAT_MODE_NIGHT) {
|
||||||
myDebug_P(PSTR(" Day Mode is set to night"));
|
myDebug_P(PSTR(" Mode type is set to night"));
|
||||||
} else if (thermoMode == EMS_THERMOSTAT_MODE_DAY) {
|
} else if (thermoMode == EMS_THERMOSTAT_MODE_DAY) {
|
||||||
myDebug_P(PSTR(" Day Mode is set to day"));
|
myDebug_P(PSTR(" Mode type is set to day"));
|
||||||
|
} else if (thermoMode == EMS_THERMOSTAT_MODE_COMFORT) {
|
||||||
|
myDebug_P(PSTR(" Mode type is set to comfort"));
|
||||||
|
} else if (thermoMode == EMS_THERMOSTAT_MODE_ECO) {
|
||||||
|
myDebug_P(PSTR(" Mode type is set to eco"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
src/ems.cpp
27
src/ems.cpp
@@ -107,7 +107,7 @@ void ems_init() {
|
|||||||
EMS_Thermostat.hc[i].hc = i + 1;
|
EMS_Thermostat.hc[i].hc = i + 1;
|
||||||
EMS_Thermostat.hc[i].active = false;
|
EMS_Thermostat.hc[i].active = false;
|
||||||
EMS_Thermostat.hc[i].mode = EMS_VALUE_INT_NOTSET;
|
EMS_Thermostat.hc[i].mode = EMS_VALUE_INT_NOTSET;
|
||||||
EMS_Thermostat.hc[i].day_mode = EMS_VALUE_INT_NOTSET;
|
EMS_Thermostat.hc[i].mode_type = EMS_VALUE_INT_NOTSET;
|
||||||
EMS_Thermostat.hc[i].summer_mode = EMS_VALUE_INT_NOTSET;
|
EMS_Thermostat.hc[i].summer_mode = EMS_VALUE_INT_NOTSET;
|
||||||
EMS_Thermostat.hc[i].holiday_mode = EMS_VALUE_INT_NOTSET;
|
EMS_Thermostat.hc[i].holiday_mode = EMS_VALUE_INT_NOTSET;
|
||||||
EMS_Thermostat.hc[i].daytemp = EMS_VALUE_INT_NOTSET;
|
EMS_Thermostat.hc[i].daytemp = EMS_VALUE_INT_NOTSET;
|
||||||
@@ -1270,7 +1270,7 @@ void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_RC35StatusMessage_curr); // is * 10
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_RC35StatusMessage_curr); // is * 10
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].day_mode, EMS_OFFSET_RC35StatusMessage_mode, 1);
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode_type, EMS_OFFSET_RC35StatusMessage_mode, 1);
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].summer_mode, EMS_OFFSET_RC35StatusMessage_mode, 0);
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].summer_mode, EMS_OFFSET_RC35StatusMessage_mode, 0);
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].holiday_mode, EMS_OFFSET_RC35StatusMessage_mode1, 5);
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].holiday_mode, EMS_OFFSET_RC35StatusMessage_mode1, 5);
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].circuitcalctemp, EMS_OFFSET_RC35Set_circuitcalctemp);
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].circuitcalctemp, EMS_OFFSET_RC35Set_circuitcalctemp);
|
||||||
@@ -1351,12 +1351,13 @@ void _process_RCPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
// quite often this is 0x8000 (n/a). still not sure why
|
// quite often this is 0x8000 (n/a). still not sure why
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_RCPLUSStatusMessage_curr); // value is * 10
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_RCPLUSStatusMessage_curr); // value is * 10
|
||||||
|
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].day_mode, EMS_OFFSET_RCPLUSStatusMessage_mode, 1);
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode_type, EMS_OFFSET_RCPLUSStatusMessage_mode, 1);
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_RCPLUSStatusMessage_mode, 0); // bit 1, mode (auto=1 or manual=0)
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_RCPLUSStatusMessage_mode, 0); // bit 1, mode (auto=1 or manual=0)
|
||||||
|
|
||||||
// setpoint is in position 3 and also 6 (EMS_OFFSET_RCPLUSStatusMessage_currsetpoint). We're sticking to 3 for now.
|
// setpoint is in position 3 and also 6 (EMS_OFFSET_RCPLUSStatusMessage_currsetpoint). We're sticking to 3 for now.
|
||||||
// don't fetch temp if in nightmode
|
// only fetch temp if in comfort mode (not eco/night mode)
|
||||||
if (EMS_Thermostat.hc[hc].day_mode) {
|
// also ignore if its 0 - see https://github.com/proddy/EMS-ESP/issues/256#issuecomment-585171426
|
||||||
|
if ((EMS_Thermostat.hc[hc].mode_type) && (EMS_RxTelegram->data[EMS_OFFSET_RCPLUSStatusMessage_setpoint] != 0)) {
|
||||||
_setValue8(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, EMS_OFFSET_RCPLUSStatusMessage_setpoint); // convert to single byte, value is * 2
|
_setValue8(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, EMS_OFFSET_RCPLUSStatusMessage_setpoint); // convert to single byte, value is * 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1381,7 +1382,7 @@ void _process_JunkersStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
|
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_JunkersStatusMessage_curr); // value is * 10
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_JunkersStatusMessage_curr); // value is * 10
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, EMS_OFFSET_JunkersStatusMessage_setpoint); // value is * 10
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, EMS_OFFSET_JunkersStatusMessage_setpoint); // value is * 10
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].day_mode, EMS_OFFSET_JunkersStatusMessage_daymode); // 3 = day, 2 = night
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode_type, EMS_OFFSET_JunkersStatusMessage_daymode); // 3 = day, 2 = night
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_JunkersStatusMessage_mode); // 1 = manual, 2 = auto
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_JunkersStatusMessage_mode); // 1 = manual, 2 = auto
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2328,7 +2329,7 @@ void ems_sendRawTelegram(char * telegram) {
|
|||||||
/**
|
/**
|
||||||
* Set the temperature of the thermostat
|
* Set the temperature of the thermostat
|
||||||
* hc_num is 1 to 4
|
* hc_num is 1 to 4
|
||||||
* temptype 0 = normal, 1=night temp, 2=day temp, 3=holiday temp
|
* temptype 0=normal, 1=night temp, 2=day temp, 3=holiday temp
|
||||||
*/
|
*/
|
||||||
void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype) {
|
void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype) {
|
||||||
if (!ems_getThermostatEnabled()) {
|
if (!ems_getThermostatEnabled()) {
|
||||||
@@ -2357,10 +2358,14 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype)
|
|||||||
EMS_TxTelegram.dest = device_id;
|
EMS_TxTelegram.dest = device_id;
|
||||||
|
|
||||||
char s[10] = {0};
|
char s[10] = {0};
|
||||||
|
if ((model == EMS_DEVICE_FLAG_RC35) || (model == EMS_DEVICE_FLAG_RC30N)) {
|
||||||
myDebug_P(PSTR("Setting new thermostat temperature to %s for heating circuit %d type %d (0=auto,1=night,2=day,3=holiday)"),
|
myDebug_P(PSTR("Setting new thermostat temperature to %s for heating circuit %d type %d (0=auto,1=night,2=day,3=holiday)"),
|
||||||
_float_to_char(s, temperature),
|
_float_to_char(s, temperature),
|
||||||
hc_num,
|
hc_num,
|
||||||
temptype);
|
temptype);
|
||||||
|
} else {
|
||||||
|
myDebug_P(PSTR("Setting new thermostat temperature to %s for heating circuit %d"), _float_to_char(s, temperature), hc_num);
|
||||||
|
}
|
||||||
|
|
||||||
if (model == EMS_DEVICE_FLAG_RC20) {
|
if (model == EMS_DEVICE_FLAG_RC20) {
|
||||||
EMS_TxTelegram.type = EMS_TYPE_RC20Set;
|
EMS_TxTelegram.type = EMS_TYPE_RC20Set;
|
||||||
@@ -2421,9 +2426,9 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype)
|
|||||||
// https://github.com/proddy/EMS-ESP/issues/310
|
// https://github.com/proddy/EMS-ESP/issues/310
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp;
|
||||||
} else {
|
} else {
|
||||||
if (EMS_Thermostat.hc[hc_num - 1].day_mode == 0) {
|
if (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
||||||
} else if (EMS_Thermostat.hc[hc_num - 1].day_mode == 1) {
|
} else if (EMS_Thermostat.hc[hc_num - 1].mode_type == 1) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2460,9 +2465,9 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype)
|
|||||||
default:
|
default:
|
||||||
case 0: // automatic selection, if no type is defined, we use the standard code
|
case 0: // automatic selection, if no type is defined, we use the standard code
|
||||||
// not sure if this is correct for Junkers
|
// not sure if this is correct for Junkers
|
||||||
if (EMS_Thermostat.hc[hc_num - 1].day_mode == 0) {
|
if (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_night_temp;
|
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_night_temp;
|
||||||
} else if (EMS_Thermostat.hc[hc_num - 1].day_mode == 1) {
|
} else if (EMS_Thermostat.hc[hc_num - 1].mode_type == 1) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_day_temp;
|
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_day_temp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ typedef enum {
|
|||||||
EMS_THERMOSTAT_MODE_MANUAL,
|
EMS_THERMOSTAT_MODE_MANUAL,
|
||||||
EMS_THERMOSTAT_MODE_AUTO,
|
EMS_THERMOSTAT_MODE_AUTO,
|
||||||
EMS_THERMOSTAT_MODE_NIGHT,
|
EMS_THERMOSTAT_MODE_NIGHT,
|
||||||
EMS_THERMOSTAT_MODE_DAY
|
EMS_THERMOSTAT_MODE_DAY,
|
||||||
|
EMS_THERMOSTAT_MODE_ECO,
|
||||||
|
EMS_THERMOSTAT_MODE_COMFORT
|
||||||
} _EMS_THERMOSTAT_MODE;
|
} _EMS_THERMOSTAT_MODE;
|
||||||
|
|
||||||
// trigger settings to determine if hot tap water or the heating is active
|
// trigger settings to determine if hot tap water or the heating is active
|
||||||
@@ -397,7 +399,7 @@ typedef struct {
|
|||||||
int16_t setpoint_roomTemp; // current set temp
|
int16_t setpoint_roomTemp; // current set temp
|
||||||
int16_t curr_roomTemp; // current room temp
|
int16_t curr_roomTemp; // current room temp
|
||||||
uint8_t mode; // 0=low, 1=manual, 2=auto (or night, day on RC35s)
|
uint8_t mode; // 0=low, 1=manual, 2=auto (or night, day on RC35s)
|
||||||
uint8_t day_mode; // 0=night, 1=day
|
uint8_t mode_type; // 0=night/eco, 1=day/comfort
|
||||||
uint8_t summer_mode;
|
uint8_t summer_mode;
|
||||||
uint8_t holiday_mode;
|
uint8_t holiday_mode;
|
||||||
uint8_t daytemp;
|
uint8_t daytemp;
|
||||||
|
|||||||
Reference in New Issue
Block a user