mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
BIN
EMS-ESP-1_9_5b58-d1_mini.bin
Normal file
BIN
EMS-ESP-1_9_5b58-d1_mini.bin
Normal file
Binary file not shown.
118
src/ems.cpp
118
src/ems.cpp
@@ -1180,26 +1180,15 @@ void _process_RC10StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_RC10StatusMessage_curr); // is * 10
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_RC10StatusMessage_curr); // is * 10
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* type 0xAD - data from the RC20 thermostat (0x17)
|
|
||||||
* e.g. 17 00 AD 0D 2E
|
|
||||||
*/
|
|
||||||
void _process_RC20StatusMessage2(_EMS_RxTelegram * EMS_RxTelegram) {
|
|
||||||
uint8_t hc = EMS_THERMOSTAT_DEFAULTHC - 1; // use HC1
|
|
||||||
EMS_Thermostat.hc[hc].active = true;
|
|
||||||
|
|
||||||
// _setValue8(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, 0); // is * 2, force as single byte
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type 0xAE - data from the RC20 thermostat (0x17)
|
* type 0xAE - data from the RC20 thermostat (0x17)
|
||||||
* e.g. 17 00 AE 00 80 12 2E 00 D0 00 00 64
|
* e.g. 17 00 AE 00 80 12 2E 00 D0 00 00 64
|
||||||
*/
|
*/
|
||||||
void _process_RC20StatusMessage3(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_RC20NStatusMessage(_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_type, 0, 7); // day/night MSB 7th bit is day
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode_type, 1, 1); // day/night 1th bit is day
|
||||||
_setValue8(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, 2); // is * 2, force as single byte
|
_setValue8(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, 2); // is * 2, force as single byte
|
||||||
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, 3); // is * 10
|
_setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, 3); // is * 10
|
||||||
}
|
}
|
||||||
@@ -1365,17 +1354,6 @@ void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
//_setValue(EMS_RxTelegram, &EMS_MixingModule.hc[hc].valveStatus, EMS_OFFSET_MMStatusMessage_valve_status);
|
//_setValue(EMS_RxTelegram, &EMS_MixingModule.hc[hc].valveStatus, EMS_OFFSET_MMStatusMessage_valve_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mixing Parameters - 0xAC
|
|
||||||
// We assume MM10 is on HC2 and WM10 is using HC1
|
|
||||||
void _process_MM10ParameterMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|
||||||
//uint8_t hc = 1; // fixed to HC2
|
|
||||||
//EMS_MixingModule.hc[hc].active = true;
|
|
||||||
|
|
||||||
//_setValue(EMS_RxTelegram, &EMS_MixingModule.hc[hc].flowTemp, EMS_OFFSET_MMStatusMessage_flow_temp);
|
|
||||||
//_setValue(EMS_RxTelegram, &EMS_MixingModule.hc[hc].pumpMod, EMS_OFFSET_MMStatusMessage_pump_mod);
|
|
||||||
//_setValue(EMS_RxTelegram, &EMS_MixingModule.hc[hc].flowSetTemp, EMS_OFFSET_MMStatusMessage_flow_set);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type 0x01A5 - data from the Nefit RC1010/3000 thermostat (0x18) and RC300/310s on 0x10
|
* type 0x01A5 - data from the Nefit RC1010/3000 thermostat (0x18) and RC300/310s on 0x10
|
||||||
* EMS+ messages may come in with different offsets so handle them here
|
* EMS+ messages may come in with different offsets so handle them here
|
||||||
@@ -1469,6 +1447,18 @@ void _process_RC10Set(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
// mode not implemented yet
|
// mode not implemented yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* type 0xAD - for reading the mode from the new RC20 thermostat (0x17)
|
||||||
|
* received only after requested
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* type 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
* type 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
||||||
* received only after requested
|
* received only after requested
|
||||||
@@ -1950,7 +1940,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
if (type == EMS_DEVICE_TYPE_THERMOSTAT) {
|
if (type == EMS_DEVICE_TYPE_THERMOSTAT) {
|
||||||
// we can only support a single thermostat currently, so check which product_id we may have chosen
|
// we can only support a single thermostat currently, so check which product_id we may have chosen
|
||||||
// to be the master - see https://github.com/proddy/EMS-ESP/issues/238
|
// to be the master - see https://github.com/proddy/EMS-ESP/issues/238
|
||||||
if ((EMS_Sys_Status.emsMasterThermostat == 0) || (EMS_Sys_Status.emsMasterThermostat == product_id)) {
|
if (((EMS_Sys_Status.emsMasterThermostat == 0) && (EMS_Thermostat.device_id == EMS_ID_NONE)) || (EMS_Sys_Status.emsMasterThermostat == product_id)) {
|
||||||
EMS_Thermostat.device_id = device_id;
|
EMS_Thermostat.device_id = device_id;
|
||||||
EMS_Thermostat.device_flags = (flags & 0x7F); // remove 7th bit
|
EMS_Thermostat.device_flags = (flags & 0x7F); // remove 7th bit
|
||||||
EMS_Thermostat.write_supported = (flags & EMS_DEVICE_FLAG_NO_WRITE) == 0;
|
EMS_Thermostat.write_supported = (flags & EMS_DEVICE_FLAG_NO_WRITE) == 0;
|
||||||
@@ -1958,6 +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
|
||||||
}
|
}
|
||||||
} 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;
|
||||||
@@ -2063,6 +2054,10 @@ void ems_getThermostatValues() {
|
|||||||
ems_doReadCommand(EMS_TYPE_RC20StatusMessage, device_id); // to get the temps
|
ems_doReadCommand(EMS_TYPE_RC20StatusMessage, device_id); // to get the temps
|
||||||
ems_doReadCommand(EMS_TYPE_RC20Set, device_id); // to get the mode
|
ems_doReadCommand(EMS_TYPE_RC20Set, device_id); // to get the mode
|
||||||
break;
|
break;
|
||||||
|
case EMS_DEVICE_FLAG_RC20N:
|
||||||
|
ems_doReadCommand(EMS_TYPE_RC20NStatusMessage, device_id); // to get the temps
|
||||||
|
ems_doReadCommand(EMS_TYPE_RC20NSet, device_id); // to get the mode
|
||||||
|
break;
|
||||||
case EMS_DEVICE_FLAG_RC30:
|
case EMS_DEVICE_FLAG_RC30:
|
||||||
ems_doReadCommand(EMS_TYPE_RC30StatusMessage, device_id); // to get the temps
|
ems_doReadCommand(EMS_TYPE_RC30StatusMessage, device_id); // to get the temps
|
||||||
ems_doReadCommand(EMS_TYPE_RC30Set, device_id); // to get the mode
|
ems_doReadCommand(EMS_TYPE_RC30Set, device_id); // to get the mode
|
||||||
@@ -2088,6 +2083,7 @@ void ems_getThermostatValues() {
|
|||||||
}
|
}
|
||||||
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
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EMS_DEVICE_FLAG_RC300:
|
case EMS_DEVICE_FLAG_RC300:
|
||||||
@@ -2152,6 +2148,11 @@ void ems_getMixingModuleValues() {
|
|||||||
if (ems_getMixingModuleEnabled()) {
|
if (ems_getMixingModuleEnabled()) {
|
||||||
if (EMS_MixingModule.device_flags == EMS_DEVICE_FLAG_MMPLUS) {
|
if (EMS_MixingModule.device_flags == EMS_DEVICE_FLAG_MMPLUS) {
|
||||||
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, EMS_MixingModule.device_id);
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, EMS_MixingModule.device_id);
|
||||||
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC2, EMS_MixingModule.device_id);
|
||||||
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC3, EMS_MixingModule.device_id);
|
||||||
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC4, EMS_MixingModule.device_id);
|
||||||
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_WWC1, EMS_MixingModule.device_id);
|
||||||
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_WWC2, EMS_MixingModule.device_id);
|
||||||
} else if (EMS_MixingModule.device_flags == EMS_DEVICE_FLAG_MM10) {
|
} else if (EMS_MixingModule.device_flags == EMS_DEVICE_FLAG_MM10) {
|
||||||
ems_doReadCommand(EMS_TYPE_MMStatusMessage, EMS_MixingModule.device_id);
|
ems_doReadCommand(EMS_TYPE_MMStatusMessage, EMS_MixingModule.device_id);
|
||||||
}
|
}
|
||||||
@@ -2440,6 +2441,7 @@ 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_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;
|
||||||
@@ -2447,13 +2449,34 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (model == EMS_DEVICE_FLAG_RC20) {
|
else if (model == EMS_DEVICE_FLAG_RC20) {
|
||||||
|
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) {
|
||||||
|
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;
|
||||||
|
break;
|
||||||
|
case EMS_THERMOSTAT_MODE_DAY: // change the day temp
|
||||||
|
EMS_TxTelegram.offset = EMS_OFFSET_RC20NSet_temp_day;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case EMS_THERMOSTAT_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code
|
||||||
|
EMS_TxTelegram.offset = (EMS_Thermostat.hc[hc - 1].mode_type == 0) ? EMS_OFFSET_RC20NSet_temp_night : EMS_OFFSET_RC20NSet_temp_day;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (model == EMS_DEVICE_FLAG_RC30) {
|
else if (model == EMS_DEVICE_FLAG_RC30) {
|
||||||
|
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;
|
||||||
@@ -2461,6 +2484,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc, _EMS_THERMOSTAT_MODE t
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
// 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
|
||||||
@@ -2488,21 +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_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_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_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) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/proddy/EMS-ESP/issues/310
|
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
|
||||||
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||||
|
break;
|
||||||
|
default: // in automode change only seltemp
|
||||||
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/proddy/EMS-ESP/issues/310
|
||||||
|
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
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2524,6 +2562,7 @@ 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;
|
||||||
|
|
||||||
// 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
|
||||||
@@ -2548,6 +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_DEVICE_FLAG_JUNKERS2
|
// EMS_DEVICE_FLAG_JUNKERS2
|
||||||
switch (temptype) {
|
switch (temptype) {
|
||||||
case EMS_THERMOSTAT_MODE_NOFROST:
|
case EMS_THERMOSTAT_MODE_NOFROST:
|
||||||
@@ -2746,6 +2786,12 @@ void ems_setThermostatMode(_EMS_THERMOSTAT_MODE mode, uint8_t hc) {
|
|||||||
EMS_TxTelegram.type_validate = EMS_TYPE_RC20Set;
|
EMS_TxTelegram.type_validate = EMS_TYPE_RC20Set;
|
||||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20StatusMessage;
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20StatusMessage;
|
||||||
|
|
||||||
|
} else if (model == EMS_DEVICE_FLAG_RC20N) {
|
||||||
|
EMS_TxTelegram.type = EMS_TYPE_RC20NSet;
|
||||||
|
EMS_TxTelegram.offset = EMS_OFFSET_RC20NSet_mode;
|
||||||
|
EMS_TxTelegram.type_validate = EMS_TYPE_RC20NSet;
|
||||||
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC20NStatusMessage;
|
||||||
|
|
||||||
} else if (model == EMS_DEVICE_FLAG_RC30) {
|
} else if (model == EMS_DEVICE_FLAG_RC30) {
|
||||||
EMS_TxTelegram.type = EMS_TYPE_RC30Set;
|
EMS_TxTelegram.type = EMS_TYPE_RC30Set;
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_mode;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_mode;
|
||||||
@@ -2917,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_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
|
||||||
@@ -3203,8 +3249,10 @@ const _EMS_Type EMS_Types[] = {
|
|||||||
// RC20 and RC20RF
|
// RC20 and RC20RF
|
||||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20Set, "RC20Set", _process_RC20Set},
|
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20Set, "RC20Set", _process_RC20Set},
|
||||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20StatusMessage, "RC20StatusMessage", _process_RC20StatusMessage},
|
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20StatusMessage, "RC20StatusMessage", _process_RC20StatusMessage},
|
||||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20StatusMessage2, "RC20StatusMessage2", _process_RC20StatusMessage2},
|
|
||||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20StatusMessage3, "RC20StatusMessage3", _process_RC20StatusMessage3},
|
// RC20 and ES72
|
||||||
|
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20NSet, "RC20NSet", _process_RC20NSet},
|
||||||
|
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC20NStatusMessage, "RC20NStatusMessage", _process_RC20NStatusMessage},
|
||||||
|
|
||||||
// RC30
|
// RC30
|
||||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC30Set, "RC30Set", _process_RC30Set},
|
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC30Set, "RC30Set", _process_RC30Set},
|
||||||
@@ -3247,8 +3295,7 @@ const _EMS_Type EMS_Types[] = {
|
|||||||
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_HC4, "MMPLUSStatusMessage_HC4", _process_MMPLUSStatusMessage},
|
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_HC4, "MMPLUSStatusMessage_HC4", _process_MMPLUSStatusMessage},
|
||||||
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_WWC1, "MMPLUSStatusMessage_WWC1", _process_MMPLUSStatusMessageWW},
|
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_WWC1, "MMPLUSStatusMessage_WWC1", _process_MMPLUSStatusMessageWW},
|
||||||
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_WWC2, "MMPLUSStatusMessage_WWC2", _process_MMPLUSStatusMessageWW},
|
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_WWC2, "MMPLUSStatusMessage_WWC2", _process_MMPLUSStatusMessageWW},
|
||||||
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMStatusMessage, "MMStatusMessage", _process_MMStatusMessage},
|
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMStatusMessage, "MMStatusMessage", _process_MMStatusMessage}};
|
||||||
{EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MM10ParameterMessage, "MM10ParameterMessage", _process_MM10ParameterMessage}};
|
|
||||||
|
|
||||||
// calculate sizes of arrays at compile time
|
// calculate sizes of arrays at compile time
|
||||||
uint8_t _EMS_Types_max = ArraySize(EMS_Types);
|
uint8_t _EMS_Types_max = ArraySize(EMS_Types);
|
||||||
@@ -3543,7 +3590,7 @@ void _processType(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
* Send a command to UART Tx to Read from another device
|
* Send a command to UART Tx to Read from another device
|
||||||
* Read commands when sent must respond by the destination (target) immediately (or within 10ms)
|
* Read commands when sent must respond by the destination (target) immediately (or within 10ms)
|
||||||
*/
|
*/
|
||||||
void ems_doReadCommand(uint16_t type, uint8_t dest) {
|
void ems_doReadCommand(uint16_t type, uint8_t dest, uint8_t offset) {
|
||||||
// if not a valid type of boiler is not accessible then quits
|
// if not a valid type of boiler is not accessible then quits
|
||||||
if ((type == EMS_ID_NONE) || (dest == EMS_ID_NONE)) {
|
if ((type == EMS_ID_NONE) || (dest == EMS_ID_NONE)) {
|
||||||
return;
|
return;
|
||||||
@@ -3573,7 +3620,7 @@ void ems_doReadCommand(uint16_t type, uint8_t dest) {
|
|||||||
}
|
}
|
||||||
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 = 0; // 0 for all data
|
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
|
||||||
@@ -3595,14 +3642,15 @@ void ems_scanDevices() {
|
|||||||
Device_Ids.push_back(0x09); // Controllers - 0x09
|
Device_Ids.push_back(0x09); // Controllers - 0x09
|
||||||
Device_Ids.push_back(0x38); // HeatPump - 0x38
|
Device_Ids.push_back(0x38); // HeatPump - 0x38
|
||||||
Device_Ids.push_back(0x30); // Solar Module - 0x30
|
Device_Ids.push_back(0x30); // Solar Module - 0x30
|
||||||
Device_Ids.push_back(0x09); // Controllers - 0x09
|
|
||||||
Device_Ids.push_back(0x02); // Connect - 0x02
|
Device_Ids.push_back(0x02); // Connect - 0x02
|
||||||
Device_Ids.push_back(0x48); // Gateway - 0x48
|
Device_Ids.push_back(0x48); // Gateway - 0x48
|
||||||
Device_Ids.push_back(0x20); // Mixing Devices - 0x20
|
Device_Ids.push_back(0x20); // Mixing Devices - 0x20
|
||||||
Device_Ids.push_back(0x21); // Mixing Devices - 0x21
|
Device_Ids.push_back(0x21); // Mixing Devices - 0x21
|
||||||
Device_Ids.push_back(0x10); // Thermostats - 0x10
|
Device_Ids.push_back(0x10); // Thermostats - 0x10
|
||||||
Device_Ids.push_back(0x17); // Thermostats - 0x17
|
Device_Ids.push_back(0x17); // Thermostats - 0x17
|
||||||
Device_Ids.push_back(0x18); // Thermostats - 0x18
|
Device_Ids.push_back(0x18); // Remote Thermostats - 0x18
|
||||||
|
Device_Ids.push_back(0x19); // Remote Thermostats - 0x19
|
||||||
|
Device_Ids.push_back(0x11); // Switch WM10 - 0x11
|
||||||
|
|
||||||
// remove duplicates and reserved IDs (like our own device)
|
// remove duplicates and reserved IDs (like our own device)
|
||||||
// Device_Ids.sort();
|
// Device_Ids.sort();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
enum EMS_DEVICE_FLAG_TYPES : uint8_t {
|
enum EMS_DEVICE_FLAG_TYPES : uint8_t {
|
||||||
EMS_DEVICE_FLAG_NONE = 0,
|
EMS_DEVICE_FLAG_NONE = 0,
|
||||||
EMS_DEVICE_FLAG_MMPLUS = 20, // mixing EMS+
|
EMS_DEVICE_FLAG_MMPLUS = 20, // mixing EMS+
|
||||||
EMS_DEVICE_FLAG_MM10 = 21, // mixing MM10, MM50
|
EMS_DEVICE_FLAG_MM10 = 21, // mixing MM10
|
||||||
EMS_DEVICE_FLAG_SM10 = 10,
|
EMS_DEVICE_FLAG_SM10 = 10,
|
||||||
EMS_DEVICE_FLAG_SM100 = 11, // for SM100 and SM200
|
EMS_DEVICE_FLAG_SM100 = 11, // for SM100 and SM200
|
||||||
EMS_DEVICE_FLAG_EASY = 1,
|
EMS_DEVICE_FLAG_EASY = 1,
|
||||||
@@ -61,6 +61,7 @@ enum EMS_DEVICE_FLAG_TYPES : uint8_t {
|
|||||||
EMS_DEVICE_FLAG_RC35 = 6,
|
EMS_DEVICE_FLAG_RC35 = 6,
|
||||||
EMS_DEVICE_FLAG_RC100 = 7,
|
EMS_DEVICE_FLAG_RC100 = 7,
|
||||||
EMS_DEVICE_FLAG_RC300 = 8,
|
EMS_DEVICE_FLAG_RC300 = 8,
|
||||||
|
EMS_DEVICE_FLAG_RC20N = 9,
|
||||||
EMS_DEVICE_FLAG_JUNKERS1 = 31, // use 0x65 for HC
|
EMS_DEVICE_FLAG_JUNKERS1 = 31, // use 0x65 for HC
|
||||||
EMS_DEVICE_FLAG_JUNKERS2 = 32, // use 0x79 for HC, older models
|
EMS_DEVICE_FLAG_JUNKERS2 = 32, // use 0x79 for HC, older models
|
||||||
EMS_DEVICE_FLAG_JUNKERS = (1 << 6), // 6th bit set if its junkers HT3
|
EMS_DEVICE_FLAG_JUNKERS = (1 << 6), // 6th bit set if its junkers HT3
|
||||||
@@ -485,7 +486,7 @@ typedef enum : uint8_t {
|
|||||||
void ems_dumpBuffer(const char * prefix, uint8_t * telegram, uint8_t length);
|
void ems_dumpBuffer(const char * prefix, uint8_t * telegram, uint8_t length);
|
||||||
void ems_parseTelegram(uint8_t * telegram, uint8_t len);
|
void ems_parseTelegram(uint8_t * telegram, uint8_t len);
|
||||||
void ems_init();
|
void ems_init();
|
||||||
void ems_doReadCommand(uint16_t type, uint8_t dest);
|
void ems_doReadCommand(uint16_t type, uint8_t dest, uint8_t offset = 0);
|
||||||
void ems_sendRawTelegram(char * telegram);
|
void ems_sendRawTelegram(char * telegram);
|
||||||
void ems_printDevices();
|
void ems_printDevices();
|
||||||
uint8_t ems_printDevices_s(char * buffer, uint16_t len);
|
uint8_t ems_printDevices_s(char * buffer, uint16_t len);
|
||||||
|
|||||||
@@ -140,8 +140,15 @@
|
|||||||
#define EMS_OFFSET_RC20StatusMessage_setpoint 1 // setpoint temp
|
#define EMS_OFFSET_RC20StatusMessage_setpoint 1 // setpoint temp
|
||||||
#define EMS_OFFSET_RC20StatusMessage_curr 2 // current temp
|
#define EMS_OFFSET_RC20StatusMessage_curr 2 // current temp
|
||||||
|
|
||||||
#define EMS_TYPE_RC20StatusMessage2 0xAD
|
#define EMS_TYPE_RC20NStatusMessage 0xAE
|
||||||
#define EMS_TYPE_RC20StatusMessage3 0xAE
|
#define EMS_OFFSET_RC20NStatusMessage_setpoint 2 // setpoint temp in AE
|
||||||
|
#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_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
|
||||||
#define EMS_OFFSET_RC20Set_mode 23 // position of thermostat mode
|
#define EMS_OFFSET_RC20Set_mode 23 // position of thermostat mode
|
||||||
@@ -276,7 +283,7 @@ static const _EMS_Device EMS_Devices[] = {
|
|||||||
{160, EMS_DEVICE_TYPE_MIXING, "MM100 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
|
{160, EMS_DEVICE_TYPE_MIXING, "MM100 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
|
||||||
{161, EMS_DEVICE_TYPE_MIXING, "MM200 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
|
{161, EMS_DEVICE_TYPE_MIXING, "MM200 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
|
||||||
{69, EMS_DEVICE_TYPE_MIXING, "MM10 Mixing Module", EMS_DEVICE_FLAG_MM10},
|
{69, EMS_DEVICE_TYPE_MIXING, "MM10 Mixing Module", EMS_DEVICE_FLAG_MM10},
|
||||||
{159, EMS_DEVICE_TYPE_MIXING, "MM50 Mixing Module", EMS_DEVICE_FLAG_MM10},
|
{159, EMS_DEVICE_TYPE_MIXING, "MM50 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
|
||||||
|
|
||||||
//
|
//
|
||||||
// HeatPump - type 0x38
|
// HeatPump - type 0x38
|
||||||
@@ -328,7 +335,8 @@ static const _EMS_Device EMS_Devices[] = {
|
|||||||
|
|
||||||
// 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, "Sieger ES72/Buderus RC20", EMS_DEVICE_FLAG_RC20}, // 0x17
|
{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
|
||||||
|
|
||||||
// Junkers - all 0x10
|
// Junkers - all 0x10
|
||||||
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||||
|
|||||||
Reference in New Issue
Block a user