mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
merged with PR366 with fixed to RC20 and MM50
This commit is contained in:
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Added features to WW messages (0x33, 0x34) to improve WW monitoring. (PR#338 by @ypaindaveine)
|
||||
- Added mixing log and stub for EMS type 0xAC (PR#338 by @ypaindaveine)
|
||||
- Added Thermostat retrieving settings (0xA5) (validated on RC30N) with MQTT support (thanks Yves @ypaindaveine. See #352)
|
||||
- Merged with PR https://github.com/proddy/EMS-ESP/pull/366 from @MichaelDvP fixing RC20 and MM50
|
||||
|
||||
### Fixed
|
||||
- set boiler warm water temp on Junkers/Bosch HT3
|
||||
|
||||
Binary file not shown.
88
src/ems.cpp
88
src/ems.cpp
@@ -1454,10 +1454,10 @@ void _process_RC10Set(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
void _process_RC20NSet(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
uint8_t hc = EMS_THERMOSTAT_DEFAULTHC - 1; // use HC1
|
||||
EMS_Thermostat.hc[hc].active = true;
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_RC20NSet_mode); // note, fixed for HC1
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].daytemp, EMS_OFFSET_RC20NSet_temp_day); // is * 2
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].nighttemp, EMS_OFFSET_RC20NSet_temp_night); // is * 2
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].heatingtype, EMS_OFFSET_RC20NSet_heatingtype); // byte 0 bit floor heating = 3
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_RC20NSet_mode); // note, fixed for HC1
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].daytemp, EMS_OFFSET_RC20NSet_temp_day); // is * 2
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].nighttemp, EMS_OFFSET_RC20NSet_temp_night); // is * 2
|
||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].heatingtype, EMS_OFFSET_RC20NSet_heatingtype); // byte 0 bit floor heating = 3
|
||||
}
|
||||
/**
|
||||
* type 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
||||
@@ -1948,7 +1948,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
EMS_Thermostat.device_desc_p = device_desc_p;
|
||||
strlcpy(EMS_Thermostat.version, version, sizeof(EMS_Thermostat.version));
|
||||
ems_getThermostatValues(); // get Thermostat values
|
||||
ems_getSettingsValues() ; // get Settings from Thermostat
|
||||
ems_getSettingsValues(); // get Settings from Thermostat
|
||||
}
|
||||
} else if (type == EMS_DEVICE_TYPE_SOLAR) {
|
||||
EMS_SolarModule.device_id = device_id;
|
||||
@@ -2081,9 +2081,9 @@ void ems_getThermostatValues() {
|
||||
statusMsg = EMS_TYPE_RC35StatusMessage_HC4;
|
||||
opMode = EMS_TYPE_RC35Set_HC4;
|
||||
}
|
||||
ems_doReadCommand(statusMsg, device_id); // to get the temps
|
||||
ems_doReadCommand(opMode, device_id); // to get the mode
|
||||
ems_doReadCommand(opMode, device_id, 27); // to get the mode
|
||||
ems_doReadCommand(statusMsg, device_id); // to get the temps
|
||||
ems_doReadCommand(opMode, device_id); // to get the mode
|
||||
ems_doReadCommand(opMode, device_id, 27); // to get the mode
|
||||
}
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC300:
|
||||
@@ -2441,26 +2441,26 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
||||
myDebug_P(PSTR("Setting thermostat temperature to %s for heating circuit %d, mode %s"), _float_to_char(s, temperature), hc, mode_str);
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_RC10) {
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC10Set;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC10Set_temp;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC10StatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC10Set;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC10Set_temp;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC10StatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
}
|
||||
|
||||
else if (model == EMS_DEVICE_FLAG_RC20) {
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC20Set;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC20Set_temp;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20StatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC20Set;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC20Set_temp;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20StatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
}
|
||||
|
||||
else if (model == EMS_DEVICE_FLAG_RC20N) {
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC20NSet;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20NStatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC20NSet;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20NStatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
switch (temptype) {
|
||||
case EMS_THERMOSTAT_MODE_NIGHT: // change the night temp
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC20NSet_temp_night;
|
||||
@@ -2476,15 +2476,15 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
||||
}
|
||||
|
||||
else if (model == EMS_DEVICE_FLAG_RC30) {
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC30Set;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_temp;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC30StatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.type = EMS_TYPE_RC30Set;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_temp;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC30StatusMessage;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
}
|
||||
|
||||
else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) {
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
// check mode to determine offset
|
||||
if (EMS_Thermostat.hc[hc - 1].mode == 1) { // auto
|
||||
EMS_TxTelegram.offset = 0x08; // auto offset
|
||||
@@ -2512,35 +2512,35 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
||||
else if ((model == EMS_DEVICE_FLAG_RC35) || (model == EMS_DEVICE_FLAG_RC30N)) {
|
||||
switch (temptype) {
|
||||
case EMS_THERMOSTAT_MODE_NIGHT: // change the night temp
|
||||
EMS_Thermostat.hc[hc- 1].nighttemp = temperature * 2;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
||||
EMS_Thermostat.hc[hc - 1].nighttemp = temperature * 2;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
||||
break;
|
||||
case EMS_THERMOSTAT_MODE_DAY: // change the day temp
|
||||
EMS_Thermostat.hc[hc- 1].daytemp = temperature * 2;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||
EMS_Thermostat.hc[hc - 1].daytemp = temperature * 2;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||
break;
|
||||
case EMS_THERMOSTAT_MODE_HOLIDAY: // change the holiday temp
|
||||
EMS_Thermostat.hc[hc- 1].holidaytemp = temperature * 2;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_holiday;
|
||||
EMS_Thermostat.hc[hc - 1].holidaytemp = temperature * 2;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_holiday;
|
||||
break;
|
||||
default:
|
||||
case EMS_THERMOSTAT_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code
|
||||
if (model == EMS_DEVICE_FLAG_RC35) {
|
||||
switch(EMS_Thermostat.hc[hc - 1].mode) {
|
||||
case 0: // if in nightmode, change nighttemp, seltemp is set automatically
|
||||
switch (EMS_Thermostat.hc[hc - 1].mode) {
|
||||
case 0: // if in nightmode, change nighttemp, seltemp is set automatically
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
||||
break;
|
||||
case 1: // if in daymode, change daytemp, seltemp is set automatically
|
||||
case 1: // if in daymode, change daytemp, seltemp is set automatically
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||
break;
|
||||
default: // in automode change only seltemp
|
||||
default: // in automode change only seltemp
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/proddy/EMS-ESP/issues/310
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
EMS_TxTelegram.offset = (EMS_Thermostat.hc[hc - 1].mode_type == 0) ? EMS_OFFSET_RC35Set_temp_night : EMS_OFFSET_RC35Set_temp_day;
|
||||
}
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; // set temperature for immediate publish back
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2; // set temperature for immediate publish back
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2561,8 +2561,8 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
||||
}
|
||||
|
||||
else if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
|
||||
EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
|
||||
// figure out if we have older or new thermostats
|
||||
// Heating Circuits on 0x65 or 0x79
|
||||
@@ -2587,7 +2587,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc - 1; // 0x65
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc - 1;
|
||||
} else {
|
||||
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2;
|
||||
EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
|
||||
// EMS_DEVICE_FLAG_JUNKERS2
|
||||
switch (temptype) {
|
||||
case EMS_THERMOSTAT_MODE_NOFROST:
|
||||
@@ -2963,7 +2963,7 @@ void ems_setWarmWaterTemp(uint8_t temperature) {
|
||||
}
|
||||
|
||||
myDebug_P(PSTR("Setting boiler warm water temperature to %d C"), temperature);
|
||||
EMS_Boiler.wWSelTemp = temperature;
|
||||
EMS_Boiler.wWSelTemp = temperature;
|
||||
_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
|
||||
@@ -3620,7 +3620,7 @@ void ems_doReadCommand(uint16_t type, uint8_t dest, uint8_t offset) {
|
||||
}
|
||||
EMS_TxTelegram.action = EMS_TX_TELEGRAM_READ; // read command
|
||||
EMS_TxTelegram.dest = dest; // 8th bit will be set to indicate a read
|
||||
EMS_TxTelegram.offset = offset; // defaults to 0
|
||||
EMS_TxTelegram.offset = offset; // defaults to 0
|
||||
EMS_TxTelegram.type = type;
|
||||
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH; // EMS 1.0: 6 bytes long (including CRC at end), EMS+ will add 2 bytes. includes CRC
|
||||
EMS_TxTelegram.dataValue = EMS_MAX_TELEGRAM_LENGTH; // for a read this is the # bytes we want back
|
||||
|
||||
@@ -145,9 +145,9 @@
|
||||
#define EMS_OFFSET_RC20NStatusMessage_curr 3 // current temp in AE
|
||||
|
||||
#define EMS_TYPE_RC20NSet 0xAD
|
||||
#define EMS_OFFSET_RC20NSet_temp_day 2 // position of thermostat setpoint temperature for day time
|
||||
#define EMS_OFFSET_RC20NSet_temp_night 1 // position of thermostat setpoint temperature for night time
|
||||
#define EMS_OFFSET_RC20NSet_mode 3 // position mode
|
||||
#define EMS_OFFSET_RC20NSet_temp_day 2 // position of thermostat setpoint temperature for day time
|
||||
#define EMS_OFFSET_RC20NSet_temp_night 1 // position of thermostat setpoint temperature for night time
|
||||
#define EMS_OFFSET_RC20NSet_mode 3 // position mode
|
||||
#define EMS_OFFSET_RC20NSet_heatingtype 0
|
||||
|
||||
#define EMS_TYPE_RC20Set 0xA8 // for setting values like temp and mode
|
||||
@@ -334,8 +334,7 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1000/1010", EMS_DEVICE_FLAG_RC100}, // 0x18, 0x38
|
||||
|
||||
// Sieger
|
||||
{76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
{113, EMS_DEVICE_TYPE_THERMOSTAT, "RC20/Sieger ES72", EMS_DEVICE_FLAG_RC20N}, // 0x17
|
||||
{76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
{113, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES72/Buderus RC20", EMS_DEVICE_FLAG_RC20N}, // 0x17
|
||||
|
||||
// Junkers - all 0x10
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define APP_VERSION "1.9.5b58"
|
||||
#define APP_VERSION "1.9.5b59"
|
||||
|
||||
Reference in New Issue
Block a user