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) {
|
} else if (mode == 1) {
|
||||||
thermoMode = EMS_THERMOSTAT_MODE_AUTO;
|
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) {
|
if (mode == 1) {
|
||||||
thermoMode = EMS_THERMOSTAT_MODE_MANUAL;
|
thermoMode = EMS_THERMOSTAT_MODE_MANUAL;
|
||||||
} else if (mode == 2) {
|
} 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;
|
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) {
|
if (mode == 3) {
|
||||||
thermoMode = EMS_THERMOSTAT_MODE_DAY;
|
thermoMode = EMS_THERMOSTAT_MODE_DAY;
|
||||||
} else if (mode == 2) {
|
} else if (mode == 2) {
|
||||||
@@ -435,7 +435,8 @@ void showInfo() {
|
|||||||
_m_setpoint = 10; // *100
|
_m_setpoint = 10; // *100
|
||||||
_m_curr = 10; // *100
|
_m_curr = 10; // *100
|
||||||
break;
|
break;
|
||||||
case EMS_DEVICE_FLAG_JUNKERS:
|
case EMS_DEVICE_FLAG_JUNKERS1:
|
||||||
|
case EMS_DEVICE_FLAG_JUNKERS2:
|
||||||
_m_setpoint = 1; // *10
|
_m_setpoint = 1; // *10
|
||||||
_m_curr = 1; // *10
|
_m_curr = 1; // *10
|
||||||
break;
|
break;
|
||||||
@@ -834,7 +835,7 @@ bool publishEMSValues_thermostat() {
|
|||||||
dataThermostat[THERMOSTAT_SELTEMP] = (float)thermostat->setpoint_roomTemp / 100;
|
dataThermostat[THERMOSTAT_SELTEMP] = (float)thermostat->setpoint_roomTemp / 100;
|
||||||
if (thermostat->curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
if (thermostat->curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||||
dataThermostat[THERMOSTAT_CURRTEMP] = (float)thermostat->curr_roomTemp / 100;
|
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)
|
if (thermostat->setpoint_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||||
dataThermostat[THERMOSTAT_SELTEMP] = (float)thermostat->setpoint_roomTemp / 10;
|
dataThermostat[THERMOSTAT_SELTEMP] = (float)thermostat->setpoint_roomTemp / 10;
|
||||||
if (thermostat->curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
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;
|
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)
|
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;
|
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)
|
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;
|
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)
|
if (EMS_Thermostat.hc[hc_num - 1].curr_roomTemp > EMS_VALUE_SHORT_NOTSET)
|
||||||
|
|||||||
36
src/ems.cpp
36
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;
|
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+
|
EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+
|
||||||
|
|
||||||
// figure out if we have older or new thermostats
|
// 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)
|
// see https://github.com/proddy/EMS-ESP/issues/335#issuecomment-593324716)
|
||||||
if ((model & 0x3F) == EMS_DEVICE_FLAG_JUNKERS_CONFIG1) {
|
if (model == EMS_DEVICE_FLAG_JUNKERS1) {
|
||||||
// EMS_DEVICE_FLAG_JUNKERS_CONFIG1 - new models like the FW series
|
|
||||||
switch (temptype) {
|
switch (temptype) {
|
||||||
case THERMOSTAT_TEMP_MODE_NOFROST:
|
case THERMOSTAT_TEMP_MODE_NOFROST:
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp;
|
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.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1; // 0x65
|
||||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc_num - 1;
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc_num - 1;
|
||||||
} else {
|
} else {
|
||||||
// EMS_DEVICE_FLAG_JUNKERS_CONFIG2
|
// EMS_DEVICE_FLAG_JUNKERS2
|
||||||
switch (temptype) {
|
switch (temptype) {
|
||||||
case THERMOSTAT_TEMP_MODE_NOFROST:
|
case THERMOSTAT_TEMP_MODE_NOFROST:
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp;
|
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.offset = EMS_OFFSET_RC35Set_mode;
|
||||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||||
|
|
||||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
// Junkers
|
||||||
if ((model & 0x3F) == EMS_DEVICE_FLAG_JUNKERS_CONFIG1) {
|
} else if (model == EMS_DEVICE_FLAG_JUNKERS1) {
|
||||||
// config 1
|
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1;
|
||||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1;
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
||||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_set_mode;
|
||||||
} else {
|
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||||
// config 2
|
} else if (model == EMS_DEVICE_FLAG_JUNKERS2) {
|
||||||
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage2_HC1 + hc_num - 1;
|
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage2_HC1 + hc_num - 1;
|
||||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1;
|
||||||
}
|
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_set_mode;
|
||||||
|
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
||||||
|
}
|
||||||
|
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_set_mode;
|
else if (model == EMS_DEVICE_FLAG_RC300) {
|
||||||
EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
|
|
||||||
|
|
||||||
} else if (model == EMS_DEVICE_FLAG_RC300) {
|
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RCPLUSSet_mode;
|
EMS_TxTelegram.offset = EMS_OFFSET_RCPLUSSet_mode;
|
||||||
|
|
||||||
if (hc_num == 1) {
|
if (hc_num == 1) {
|
||||||
|
|||||||
32
src/ems.h
32
src/ems.h
@@ -48,22 +48,22 @@
|
|||||||
// Device Flags
|
// Device Flags
|
||||||
// They are unique to the model type (mixing, solar, thermostat etc)
|
// They are unique to the model type (mixing, solar, thermostat etc)
|
||||||
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, MM50
|
||||||
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,
|
||||||
EMS_DEVICE_FLAG_RC10 = 2,
|
EMS_DEVICE_FLAG_RC10 = 2,
|
||||||
EMS_DEVICE_FLAG_RC20 = 3,
|
EMS_DEVICE_FLAG_RC20 = 3,
|
||||||
EMS_DEVICE_FLAG_RC30 = 4,
|
EMS_DEVICE_FLAG_RC30 = 4,
|
||||||
EMS_DEVICE_FLAG_RC30N = 5, // newer type of RC30 with RC35 circuit
|
EMS_DEVICE_FLAG_RC30N = 5, // newer type of RC30 with RC35 circuit
|
||||||
EMS_DEVICE_FLAG_RC35 = 6,
|
EMS_DEVICE_FLAG_RC35 = 6,
|
||||||
EMS_DEVICE_FLAG_RC300 = 7,
|
EMS_DEVICE_FLAG_RC300 = 7,
|
||||||
EMS_DEVICE_FLAG_JUNKERS_CONFIG1 = 1, // use 0x65 for HC
|
EMS_DEVICE_FLAG_JUNKERS1 = 31, // use 0x65 for HC
|
||||||
EMS_DEVICE_FLAG_JUNKERS_CONFIG2 = 2, // 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
|
||||||
EMS_DEVICE_FLAG_NO_WRITE = (1 << 7) // top bit set if thermostat write not supported
|
EMS_DEVICE_FLAG_NO_WRITE = (1 << 7) // top bit set if thermostat write not supported
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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
|
||||||
|
|||||||
@@ -188,7 +188,7 @@
|
|||||||
#define EMS_OFFSET_JunkersStatusMessage_setpoint 2 // setpoint temp
|
#define EMS_OFFSET_JunkersStatusMessage_setpoint 2 // setpoint temp
|
||||||
#define EMS_OFFSET_JunkersStatusMessage_curr 4 // current 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
|
// Junkers FR10, FR50, FW100, FW120
|
||||||
#define EMS_TYPE_JunkersSetMessage1_HC1 0x65
|
#define EMS_TYPE_JunkersSetMessage1_HC1 0x65
|
||||||
#define EMS_TYPE_JunkersSetMessage1_HC2 0x66
|
#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_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
|
#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
|
// Junkers FR100
|
||||||
#define EMS_TYPE_JunkersSetMessage2_HC1 0x79
|
#define EMS_TYPE_JunkersSetMessage2_HC1 0x79
|
||||||
#define EMS_TYPE_JunkersSetMessage2_HC2 0x7A
|
#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
|
{113, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES72", EMS_DEVICE_FLAG_RC20}, // 0x17
|
||||||
|
|
||||||
// Junkers - all 0x10
|
// Junkers - all 0x10
|
||||||
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", 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_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
{106, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW200", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||||
{107, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR100", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG2}, // 0x10
|
{107, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR100", EMS_DEVICE_FLAG_JUNKERS2}, // 0x10
|
||||||
{108, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR110", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG2}, // 0x10
|
{108, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR110", EMS_DEVICE_FLAG_JUNKERS2}, // 0x10
|
||||||
{111, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR10", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
{111, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR10", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||||
{147, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR50", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
{147, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR50", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||||
{191, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR120", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1}, // 0x10
|
{191, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR120", EMS_DEVICE_FLAG_JUNKERS1}, // 0x10
|
||||||
{192, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW120", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_JUNKERS_CONFIG1} // 0x10
|
{192, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW120", EMS_DEVICE_FLAG_JUNKERS1} // 0x10
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user