mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
#335 fix again
This commit is contained in:
@@ -160,7 +160,7 @@ _EMS_THERMOSTAT_MODE _getThermostatMode(uint8_t hc_num) {
|
||||
} else if (mode == 1) {
|
||||
thermoMode = EMS_THERMOSTAT_MODE_AUTO;
|
||||
}
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
} else if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
|
||||
if (mode == 1) {
|
||||
thermoMode = EMS_THERMOSTAT_MODE_MANUAL;
|
||||
} else if (mode == 2) {
|
||||
@@ -188,7 +188,7 @@ _EMS_THERMOSTAT_MODE _getThermostatMode2(uint8_t hc_num) {
|
||||
|
||||
uint8_t mode = EMS_Thermostat.hc[hc_num - 1].mode_type;
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
|
||||
if (mode == 3) {
|
||||
thermoMode = EMS_THERMOSTAT_MODE_DAY;
|
||||
} else if (mode == 2) {
|
||||
@@ -435,7 +435,8 @@ void showInfo() {
|
||||
_m_setpoint = 10; // *100
|
||||
_m_curr = 10; // *100
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_JUNKERS:
|
||||
case EMS_DEVICE_FLAG_JUNKERS1:
|
||||
case EMS_DEVICE_FLAG_JUNKERS2:
|
||||
_m_setpoint = 1; // *10
|
||||
_m_curr = 1; // *10
|
||||
break;
|
||||
@@ -834,7 +835,7 @@ bool publishEMSValues_thermostat() {
|
||||
dataThermostat[THERMOSTAT_SELTEMP] = (float)thermostat->setpoint_roomTemp / 100;
|
||||
if (thermostat->curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||
dataThermostat[THERMOSTAT_CURRTEMP] = (float)thermostat->curr_roomTemp / 100;
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
} else if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
|
||||
if (thermostat->setpoint_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||
dataThermostat[THERMOSTAT_SELTEMP] = (float)thermostat->setpoint_roomTemp / 10;
|
||||
if (thermostat->curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||
@@ -2160,7 +2161,7 @@ void WebCallback(JsonObject root) {
|
||||
thermostat["ts"] = (float)EMS_Thermostat.hc[hc_num - 1].setpoint_roomTemp / 100;
|
||||
if (EMS_Thermostat.hc[hc_num - 1].curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||
thermostat["tc"] = (float)EMS_Thermostat.hc[hc_num - 1].curr_roomTemp / 100;
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
} else if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
|
||||
if (EMS_Thermostat.hc[hc_num - 1].setpoint_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||
thermostat["ts"] = (float)EMS_Thermostat.hc[hc_num - 1].setpoint_roomTemp / 10;
|
||||
if (EMS_Thermostat.hc[hc_num - 1].curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||
|
||||
28
src/ems.cpp
28
src/ems.cpp
@@ -2461,14 +2461,13 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
}
|
||||
|
||||
else if (model & EMS_DEVICE_FLAG_JUNKERS) {
|
||||
else if ((model == EMS_DEVICE_FLAG_JUNKERS1) || (model == EMS_DEVICE_FLAG_JUNKERS2)) {
|
||||
EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+
|
||||
|
||||
// figure out if we have older or new thermostats
|
||||
// Heating Circuits on 0x65 (EMS_DEVICE_FLAG_JUNKERS_CONFIG1) or 0x79 (EMS_DEVICE_FLAG_JUNKERS_CONFIG2)
|
||||
// Heating Circuits on 0x65 or 0x79
|
||||
// see https://github.com/proddy/EMS-ESP/issues/335#issuecomment-593324716)
|
||||
if ((model & 0x3F) == EMS_DEVICE_FLAG_JUNKERS_CONFIG1) {
|
||||
// EMS_DEVICE_FLAG_JUNKERS_CONFIG1 - new models like the FW series
|
||||
if (model == EMS_DEVICE_FLAG_JUNKERS1) {
|
||||
switch (temptype) {
|
||||
case THERMOSTAT_TEMP_MODE_NOFROST:
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp;
|
||||
@@ -2491,7 +2490,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M
|
||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1; // 0x65
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc_num - 1;
|
||||
} else {
|
||||
// EMS_DEVICE_FLAG_JUNKERS_CONFIG2
|
||||
// EMS_DEVICE_FLAG_JUNKERS2
|
||||
switch (temptype) {
|
||||
case THERMOSTAT_TEMP_MODE_NOFROST:
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp;
|
||||
@@ -2605,21 +2604,20 @@ void ems_setThermostatMode(uint8_t mode, uint8_t hc_num) {
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_mode;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
if ((model & 0x3F) == EMS_DEVICE_FLAG_JUNKERS_CONFIG1) {
|
||||
// config 1
|
||||
// Junkers
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS1) {
|
||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
||||
} else {
|
||||
// config 2
|
||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage2_HC1 + hc_num - 1;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
||||
}
|
||||
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_set_mode;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS2) {
|
||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage2_HC1 + hc_num - 1;
|
||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_set_mode;
|
||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||
}
|
||||
|
||||
} else if (model == EMS_DEVICE_FLAG_RC300) {
|
||||
else if (model == EMS_DEVICE_FLAG_RC300) {
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_RCPLUSSet_mode;
|
||||
|
||||
if (hc_num == 1) {
|
||||
|
||||
@@ -60,8 +60,8 @@ enum EMS_DEVICE_FLAG_TYPES : uint8_t {
|
||||
EMS_DEVICE_FLAG_RC30N = 5, // newer type of RC30 with RC35 circuit
|
||||
EMS_DEVICE_FLAG_RC35 = 6,
|
||||
EMS_DEVICE_FLAG_RC300 = 7,
|
||||
EMS_DEVICE_FLAG_JUNKERS_CONFIG1 = 1, // use 0x65 for HC
|
||||
EMS_DEVICE_FLAG_JUNKERS_CONFIG2 = 2, // use 0x79 for HC, older models
|
||||
EMS_DEVICE_FLAG_JUNKERS1 = 31, // use 0x65 for HC
|
||||
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_NO_WRITE = (1 << 7) // top bit set if thermostat write not supported
|
||||
};
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
#define EMS_OFFSET_JunkersStatusMessage_setpoint 2 // setpoint temp
|
||||
#define EMS_OFFSET_JunkersStatusMessage_curr 4 // current temp
|
||||
|
||||
// HC1-4 0x65-0x68 - EMS_DEVICE_FLAG_JUNKERS_CONFIG1
|
||||
// HC1-4 0x65-0x68 - EMS_DEVICE_FLAG_JUNKERS1
|
||||
// Junkers FR10, FR50, FW100, FW120
|
||||
#define EMS_TYPE_JunkersSetMessage1_HC1 0x65
|
||||
#define EMS_TYPE_JunkersSetMessage1_HC2 0x66
|
||||
@@ -199,7 +199,7 @@
|
||||
#define EMS_OFFSET_JunkersSetMessage_no_frost_temp 0x0F // EMS offset to set temperature on thermostat for no frost mode
|
||||
#define EMS_OFFSET_JunkersSetMessage_set_mode 0x0E // EMS offset to set mode on thermostat
|
||||
|
||||
// HC1-4 0x79-0x7C - EMS_DEVICE_FLAG_JUNKERS_CONFIG2
|
||||
// HC1-4 0x79-0x7C - EMS_DEVICE_FLAG_JUNKERS2
|
||||
// Junkers FR100
|
||||
#define EMS_TYPE_JunkersSetMessage2_HC1 0x79
|
||||
#define EMS_TYPE_JunkersSetMessage2_HC2 0x7A
|
||||
@@ -302,14 +302,14 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{113, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES72", EMS_DEVICE_FLAG_RC20}, // 0x17
|
||||
|
||||
// Junkers - all 0x10
|
||||
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
||||
{106, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW200", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
||||
{107, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR100", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG2}, // 0x10
|
||||
{108, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR110", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG2}, // 0x10
|
||||
{111, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR10", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
||||
{147, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR50", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
||||
{191, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR120", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
||||
{192, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW120", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1} // 0x10
|
||||
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||
{106, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW200", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||
{107, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR100", EMS_DEVICE_FLAG_JUNKERS2}, // 0x10
|
||||
{108, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR110", EMS_DEVICE_FLAG_JUNKERS2}, // 0x10
|
||||
{111, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR10", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||
{147, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR50", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||
{191, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR120", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||
{192, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW120", EMS_DEVICE_FLAG_JUNKERS1} // 0x10
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user