merged with PR366 with fixed to RC20 and MM50

This commit is contained in:
Paul
2020-04-22 16:25:55 +02:00
parent 2eefb7a688
commit 48bcd06e25
5 changed files with 50 additions and 50 deletions

View File

@@ -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 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 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) - 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 ### Fixed
- set boiler warm water temp on Junkers/Bosch HT3 - set boiler warm water temp on Junkers/Bosch HT3

Binary file not shown.

View File

@@ -1454,10 +1454,10 @@ void _process_RC10Set(_EMS_RxTelegram * EMS_RxTelegram) {
void _process_RC20NSet(_EMS_RxTelegram * EMS_RxTelegram) { void _process_RC20NSet(_EMS_RxTelegram * EMS_RxTelegram) {
uint8_t hc = EMS_THERMOSTAT_DEFAULTHC - 1; // use HC1 uint8_t hc = EMS_THERMOSTAT_DEFAULTHC - 1; // use HC1
EMS_Thermostat.hc[hc].active = true; 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].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].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].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].heatingtype, EMS_OFFSET_RC20NSet_heatingtype); // byte 0 bit floor heating = 3
} }
/** /**
* type 0xA8 - for reading the mode from the RC20 thermostat (0x17) * 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; EMS_Thermostat.device_desc_p = device_desc_p;
strlcpy(EMS_Thermostat.version, version, sizeof(EMS_Thermostat.version)); strlcpy(EMS_Thermostat.version, version, sizeof(EMS_Thermostat.version));
ems_getThermostatValues(); // get Thermostat values ems_getThermostatValues(); // get Thermostat values
ems_getSettingsValues() ; // get Settings from Thermostat ems_getSettingsValues(); // get Settings from Thermostat
} }
} else if (type == EMS_DEVICE_TYPE_SOLAR) { } else if (type == EMS_DEVICE_TYPE_SOLAR) {
EMS_SolarModule.device_id = device_id; EMS_SolarModule.device_id = device_id;
@@ -2081,9 +2081,9 @@ void ems_getThermostatValues() {
statusMsg = EMS_TYPE_RC35StatusMessage_HC4; statusMsg = EMS_TYPE_RC35StatusMessage_HC4;
opMode = EMS_TYPE_RC35Set_HC4; opMode = EMS_TYPE_RC35Set_HC4;
} }
ems_doReadCommand(statusMsg, device_id); // to get the temps ems_doReadCommand(statusMsg, device_id); // to get the temps
ems_doReadCommand(opMode, device_id); // to get the mode ems_doReadCommand(opMode, device_id); // to get the mode
ems_doReadCommand(opMode, device_id, 27); // to get the mode ems_doReadCommand(opMode, device_id, 27); // to get the mode
} }
break; break;
case EMS_DEVICE_FLAG_RC300: 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); 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) { if (model == EMS_DEVICE_FLAG_RC10) {
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
EMS_TxTelegram.type = EMS_TYPE_RC10Set; EMS_TxTelegram.type = EMS_TYPE_RC10Set;
EMS_TxTelegram.offset = EMS_OFFSET_RC10Set_temp; EMS_TxTelegram.offset = EMS_OFFSET_RC10Set_temp;
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC10StatusMessage; EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC10StatusMessage;
EMS_TxTelegram.type_validate = EMS_TxTelegram.type; EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
} }
else if (model == EMS_DEVICE_FLAG_RC20) { else if (model == EMS_DEVICE_FLAG_RC20) {
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
EMS_TxTelegram.type = EMS_TYPE_RC20Set; EMS_TxTelegram.type = EMS_TYPE_RC20Set;
EMS_TxTelegram.offset = EMS_OFFSET_RC20Set_temp; EMS_TxTelegram.offset = EMS_OFFSET_RC20Set_temp;
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20StatusMessage; EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20StatusMessage;
EMS_TxTelegram.type_validate = EMS_TxTelegram.type; EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
} }
else if (model == EMS_DEVICE_FLAG_RC20N) { else if (model == EMS_DEVICE_FLAG_RC20N) {
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
EMS_TxTelegram.type = EMS_TYPE_RC20NSet; EMS_TxTelegram.type = EMS_TYPE_RC20NSet;
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20NStatusMessage; EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20NStatusMessage;
EMS_TxTelegram.type_validate = EMS_TxTelegram.type; EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
switch (temptype) { switch (temptype) {
case EMS_THERMOSTAT_MODE_NIGHT: // change the night temp case EMS_THERMOSTAT_MODE_NIGHT: // change the night temp
EMS_TxTelegram.offset = EMS_OFFSET_RC20NSet_temp_night; 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) { else if (model == EMS_DEVICE_FLAG_RC30) {
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
EMS_TxTelegram.type = EMS_TYPE_RC30Set; EMS_TxTelegram.type = EMS_TYPE_RC30Set;
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_temp; EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_temp;
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC30StatusMessage; EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC30StatusMessage;
EMS_TxTelegram.type_validate = EMS_TxTelegram.type; EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
} }
else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) { 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 // check mode to determine offset
if (EMS_Thermostat.hc[hc - 1].mode == 1) { // auto if (EMS_Thermostat.hc[hc - 1].mode == 1) { // auto
EMS_TxTelegram.offset = 0x08; // auto offset 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)) { else if ((model == EMS_DEVICE_FLAG_RC35) || (model == EMS_DEVICE_FLAG_RC30N)) {
switch (temptype) { switch (temptype) {
case EMS_THERMOSTAT_MODE_NIGHT: // change the night temp case EMS_THERMOSTAT_MODE_NIGHT: // change the night temp
EMS_Thermostat.hc[hc- 1].nighttemp = temperature * 2; EMS_Thermostat.hc[hc - 1].nighttemp = temperature * 2;
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night; EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
break; break;
case EMS_THERMOSTAT_MODE_DAY: // change the day temp case EMS_THERMOSTAT_MODE_DAY: // change the day temp
EMS_Thermostat.hc[hc- 1].daytemp = temperature * 2; EMS_Thermostat.hc[hc - 1].daytemp = temperature * 2;
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day; EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
break; break;
case EMS_THERMOSTAT_MODE_HOLIDAY: // change the holiday temp case EMS_THERMOSTAT_MODE_HOLIDAY: // change the holiday temp
EMS_Thermostat.hc[hc- 1].holidaytemp = temperature * 2; EMS_Thermostat.hc[hc - 1].holidaytemp = temperature * 2;
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_holiday; EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_holiday;
break; break;
default: default:
case EMS_THERMOSTAT_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code case EMS_THERMOSTAT_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code
if (model == EMS_DEVICE_FLAG_RC35) { if (model == EMS_DEVICE_FLAG_RC35) {
switch(EMS_Thermostat.hc[hc - 1].mode) { switch (EMS_Thermostat.hc[hc - 1].mode) {
case 0: // if in nightmode, change nighttemp, seltemp is set automatically case 0: // if in nightmode, change nighttemp, seltemp is set automatically
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night; EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
break; 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; EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
break; 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 EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/proddy/EMS-ESP/issues/310
break; break;
} }
} else { } else {
EMS_TxTelegram.offset = (EMS_Thermostat.hc[hc - 1].mode_type == 0) ? EMS_OFFSET_RC35Set_temp_night : EMS_OFFSET_RC35Set_temp_day; 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; 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)) { else if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+ EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
// figure out if we have older or new thermostats // figure out if we have older or new thermostats
// Heating Circuits on 0x65 or 0x79 // 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.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc - 1; // 0x65
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc - 1; EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc - 1;
} else { } else {
EMS_Thermostat.hc[hc- 1].setpoint_roomTemp = temperature * 2; EMS_Thermostat.hc[hc - 1].setpoint_roomTemp = temperature * 2;
// EMS_DEVICE_FLAG_JUNKERS2 // EMS_DEVICE_FLAG_JUNKERS2
switch (temptype) { switch (temptype) {
case EMS_THERMOSTAT_MODE_NOFROST: 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); 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 EMS_TxTelegram = EMS_TX_TELEGRAM_NEW; // create new Tx
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
@@ -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.action = EMS_TX_TELEGRAM_READ; // read command
EMS_TxTelegram.dest = dest; // 8th bit will be set to indicate a read 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.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.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 EMS_TxTelegram.dataValue = EMS_MAX_TELEGRAM_LENGTH; // for a read this is the # bytes we want back

View File

@@ -145,9 +145,9 @@
#define EMS_OFFSET_RC20NStatusMessage_curr 3 // current temp in AE #define EMS_OFFSET_RC20NStatusMessage_curr 3 // current temp in AE
#define EMS_TYPE_RC20NSet 0xAD #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_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_temp_night 1 // position of thermostat setpoint temperature for night time
#define EMS_OFFSET_RC20NSet_mode 3 // position mode #define EMS_OFFSET_RC20NSet_mode 3 // position mode
#define EMS_OFFSET_RC20NSet_heatingtype 0 #define EMS_OFFSET_RC20NSet_heatingtype 0
#define EMS_TYPE_RC20Set 0xA8 // for setting values like temp and mode #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 {165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1000/1010", EMS_DEVICE_FLAG_RC100}, // 0x18, 0x38
// Sieger // Sieger
{76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10 {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
{113, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES72/Buderus RC20", EMS_DEVICE_FLAG_RC20N}, // 0x17 {113, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES72/Buderus RC20", EMS_DEVICE_FLAG_RC20N}, // 0x17
// Junkers - all 0x10 // Junkers - all 0x10

View File

@@ -1 +1 @@
#define APP_VERSION "1.9.5b58" #define APP_VERSION "1.9.5b59"