mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
merged with dev 1.9.5b12
This commit is contained in:
70
src/ems.cpp
70
src/ems.cpp
@@ -161,7 +161,6 @@ void ems_init() {
|
||||
EMS_Boiler.burnStarts = EMS_VALUE_LONG_NOTSET; // # burner restarts
|
||||
EMS_Boiler.burnWorkMin = EMS_VALUE_LONG_NOTSET; // Total burner operating time
|
||||
EMS_Boiler.heatWorkMin = EMS_VALUE_LONG_NOTSET; // Total heat operating time
|
||||
EMS_Boiler.switchTemp = EMS_VALUE_SHORT_NOTSET;
|
||||
|
||||
// UBAMonitorWWMessage
|
||||
EMS_Boiler.wWCurTmp = EMS_VALUE_USHORT_NOTSET; // Warm Water current temperature
|
||||
@@ -1244,7 +1243,7 @@ void _process_MMPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
|
||||
// 0xAB
|
||||
void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
uint8_t hc = 1; // fixed, for 0xAB
|
||||
uint8_t hc = 0; // fixed, for 0xAB
|
||||
EMS_Mixing.hc[hc].active = true;
|
||||
|
||||
_setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].flowTemp, EMS_OFFSET_MMStatusMessage_flow_temp);
|
||||
@@ -1371,19 +1370,43 @@ int8_t _getHeatingCircuit(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
|
||||
int8_t hc;
|
||||
|
||||
if ((EMS_RxTelegram->type == EMS_TYPE_RC35StatusMessage_HC1) || (EMS_RxTelegram->type == EMS_TYPE_RC35Set_HC1)) {
|
||||
switch (EMS_RxTelegram->type) {
|
||||
case EMS_TYPE_RC35StatusMessage_HC1:
|
||||
case EMS_TYPE_RC35Set_HC1:
|
||||
case EMS_TYPE_JunkersStatusMessage_HC1:
|
||||
case EMS_TYPE_JunkersSetMessage_HC1:
|
||||
hc = 0;
|
||||
} else if ((EMS_RxTelegram->type == EMS_TYPE_RC35StatusMessage_HC2) || (EMS_RxTelegram->type == EMS_TYPE_RC35Set_HC2)) {
|
||||
break;
|
||||
|
||||
case EMS_TYPE_RC35StatusMessage_HC2:
|
||||
case EMS_TYPE_RC35Set_HC2:
|
||||
case EMS_TYPE_JunkersStatusMessage_HC2:
|
||||
case EMS_TYPE_JunkersSetMessage_HC2:
|
||||
hc = 1;
|
||||
} else if ((EMS_RxTelegram->type == EMS_TYPE_RC35StatusMessage_HC3) || (EMS_RxTelegram->type == EMS_TYPE_RC35Set_HC3)) {
|
||||
break;
|
||||
|
||||
case EMS_TYPE_RC35StatusMessage_HC3:
|
||||
case EMS_TYPE_RC35Set_HC3:
|
||||
case EMS_TYPE_JunkersStatusMessage_HC3:
|
||||
case EMS_TYPE_JunkersSetMessage_HC3:
|
||||
hc = 2;
|
||||
} else if ((EMS_RxTelegram->type == EMS_TYPE_RC35StatusMessage_HC4) || (EMS_RxTelegram->type == EMS_TYPE_RC35Set_HC4)) {
|
||||
break;
|
||||
|
||||
case EMS_TYPE_RC35StatusMessage_HC4:
|
||||
case EMS_TYPE_RC35Set_HC4:
|
||||
case EMS_TYPE_JunkersStatusMessage_HC4:
|
||||
case EMS_TYPE_JunkersSetMessage_HC4:
|
||||
hc = 3;
|
||||
} else {
|
||||
return -1; // not a valid HC
|
||||
break;
|
||||
|
||||
default:
|
||||
hc = -1; // not a valid HC
|
||||
break;
|
||||
}
|
||||
|
||||
EMS_Thermostat.hc[hc].active = true;
|
||||
if (hc != -1) {
|
||||
EMS_Thermostat.hc[hc].active = true;
|
||||
}
|
||||
|
||||
return (hc);
|
||||
}
|
||||
@@ -1578,7 +1601,7 @@ bool _addDevice(_EMS_DEVICE_TYPE device_type, uint8_t product_id, uint8_t device
|
||||
_Detected_Device device;
|
||||
|
||||
// check for duplicates
|
||||
// a combi of product_id and device_id make it unique
|
||||
// a pair of product_id and device_id together make it unique
|
||||
for (std::list<_Detected_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) {
|
||||
if (((it)->product_id == product_id) && ((it)->device_id == device_id)) {
|
||||
return (true); // it already exists in the list, don't add
|
||||
@@ -1712,9 +1735,11 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
uint8_t i = 0;
|
||||
uint8_t found_index = 0;
|
||||
bool typeFound = false;
|
||||
while ((i < _EMS_Devices_max) && (!typeFound)) {
|
||||
while (i++ < _EMS_Devices_max) {
|
||||
if (EMS_Devices[i].product_id == product_id) {
|
||||
// we have a matching product id
|
||||
/*
|
||||
// this code is to check also that we have a matching device type (e.g. boiler, thermostat etc)
|
||||
// now lets see if there is a matching device_id since product_id can be on multiple devices
|
||||
// e.g. with UBAMasters, there is only one device_id 0x08. To avoid https://github.com/proddy/EMS-ESP/issues/271
|
||||
_EMS_DEVICE_TYPE device_type = EMS_Devices[i].type;
|
||||
@@ -1725,27 +1750,31 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
typeFound = true;
|
||||
found_index = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// if not found, just add it as an unknown device
|
||||
// if not found, just add it as an unknown device and exit
|
||||
if (!typeFound) {
|
||||
(void)_addDevice(EMS_DEVICE_TYPE_UNKNOWN, product_id, device_id, nullptr, version);
|
||||
return;
|
||||
}
|
||||
|
||||
const char * device_desc_p = (EMS_Devices[found_index].device_desc); // pointer to the full description of the device
|
||||
_EMS_DEVICE_TYPE type = EMS_Devices[found_index].type; // type
|
||||
_EMS_DEVICE_TYPE type = EMS_Devices[found_index].type; // device type
|
||||
|
||||
// we recognized it, see if we already have it in our recognized list
|
||||
if (_addDevice(type, product_id, device_id, device_desc_p, version)) {
|
||||
return; // already in list
|
||||
}
|
||||
|
||||
uint8_t flags = EMS_Devices[found_index].flags; // it's a new entry, set the specifics
|
||||
uint8_t flags = EMS_Devices[found_index].flags; // it's a new entry, get the specifics
|
||||
|
||||
if (type == EMS_DEVICE_TYPE_BOILER) {
|
||||
// for a boiler, sometimes we get a device_id of 0x09 with the same product_id, so lets make sure it is the UBA Master
|
||||
if ((type == EMS_DEVICE_TYPE_BOILER) && (device_id == EMS_ID_BOILER)) {
|
||||
EMS_Boiler.device_id = device_id;
|
||||
EMS_Boiler.product_id = product_id;
|
||||
EMS_Boiler.device_flags = flags;
|
||||
@@ -1783,7 +1812,6 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||
EMS_Mixing.device_desc_p = device_desc_p;
|
||||
EMS_Mixing.device_flags = flags;
|
||||
EMS_Mixing.detected = true;
|
||||
strlcpy(EMS_Mixing.version, version, sizeof(EMS_Mixing.version));
|
||||
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, device_id); // fetch MM values
|
||||
}
|
||||
}
|
||||
@@ -1996,12 +2024,6 @@ char * ems_getDeviceDescription(_EMS_DEVICE_TYPE device_type, char * buffer, boo
|
||||
product_id = EMS_HeatPump.product_id;
|
||||
device_desc_p = EMS_HeatPump.device_desc_p;
|
||||
version = EMS_HeatPump.version;
|
||||
} else if (device_type == EMS_DEVICE_TYPE_MIXING) {
|
||||
enabled = ems_getMixingDeviceEnabled();
|
||||
device_id = EMS_Mixing.device_id;
|
||||
product_id = EMS_Mixing.product_id;
|
||||
device_desc_p = EMS_Mixing.device_desc_p;
|
||||
version = EMS_Mixing.version;
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
@@ -2776,7 +2798,7 @@ const _EMS_Type EMS_Types[] = {
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35StatusMessage_HC1, "RC35StatusMessage_HC1", _process_RC35StatusMessage},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35Set_HC2, "RC35Set_HC2", _process_RC35Set},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35StatusMessage_HC2, "RC35StatusMessage_HC2", _process_RC35StatusMessage},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35Set_HC3, "RC35Set_HC3", _process_RC35Set},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35Set_HC3, "RC35Set_HC2", _process_RC35Set},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35StatusMessage_HC3, "RC35StatusMessage_HC3", _process_RC35StatusMessage},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35Set_HC4, "RC35Set_HC4", _process_RC35Set},
|
||||
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RC35StatusMessage_HC4, "RC35StatusMessage_HC4", _process_RC35StatusMessage},
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define EMS_ID_BOILER 0x08 // all UBA Boilers have 0x08
|
||||
#define EMS_ID_SM 0x30 // Solar Module SM10, SM100, SM200 and ISM1
|
||||
#define EMS_ID_HP 0x38 // HeatPump
|
||||
#define EMS_ID_GATEWAY 0x48 // Gateway e.g. KM200 Web Gateway
|
||||
#define EMS_ID_GATEWAY 0x48 // Gateway Modem e.g. KM200 Web Gateway. Also on 0x0A->0x0D
|
||||
#define EMS_ID_MIXING1 0x20 // Mixing
|
||||
#define EMS_ID_MIXING2 0x21 // Mixing
|
||||
#define EMS_ID_SWITCH 0x11 // Switch
|
||||
@@ -26,7 +26,6 @@
|
||||
#define EMS_ID_THERMOSTAT1 0x10 // Thermostat
|
||||
#define EMS_ID_THERMOSTAT2 0x17 // Thermostat
|
||||
#define EMS_ID_THERMOSTAT3 0x18 // Thermostat
|
||||
#define EMS_ID_MODEM 0x19 // Modem
|
||||
|
||||
// mapping for EMS_Devices_Type
|
||||
const _EMS_Device_Types EMS_Devices_Types[] = {
|
||||
@@ -45,8 +44,7 @@ const _EMS_Device_Types EMS_Devices_Types[] = {
|
||||
{EMS_ID_SWITCH, EMS_DEVICE_TYPE_SWITCH, "Switching Module"},
|
||||
{EMS_ID_CONTROLLER, EMS_DEVICE_TYPE_CONTROLLER, "Controller"},
|
||||
{EMS_ID_CONNECT1, EMS_DEVICE_TYPE_CONNECT, "Connect"},
|
||||
{EMS_ID_CONNECT2, EMS_DEVICE_TYPE_CONNECT, "Connect"},
|
||||
{EMS_ID_MODEM, EMS_DEVICE_TYPE_MODEM, "Modem"}
|
||||
{EMS_ID_CONNECT2, EMS_DEVICE_TYPE_CONNECT, "Connect"}
|
||||
|
||||
};
|
||||
|
||||
@@ -226,7 +224,7 @@ const _EMS_Device_Types EMS_Devices_Types[] = {
|
||||
static const _EMS_Device EMS_Devices[] = {
|
||||
|
||||
//
|
||||
// UBA Masters - typically with device_id of 0x08
|
||||
// UBA Masters - must have device_id of 0x08
|
||||
//
|
||||
{72, EMS_DEVICE_TYPE_BOILER, "MC10 Module", EMS_DEVICE_FLAG_NONE},
|
||||
{123, EMS_DEVICE_TYPE_BOILER, "Buderus GBx72/Nefit Trendline/Junkers Cerapur/Worcester Greenstar Si/27i", EMS_DEVICE_FLAG_NONE},
|
||||
@@ -257,9 +255,8 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{161, EMS_DEVICE_TYPE_MIXING, "MM200 Mixing Module", EMS_DEVICE_FLAG_NONE},
|
||||
{69, EMS_DEVICE_TYPE_MIXING, "MM10 Mixer Module", EMS_DEVICE_FLAG_NONE},
|
||||
{159, EMS_DEVICE_TYPE_MIXING, "MM50 Mixing Module", EMS_DEVICE_FLAG_NONE},
|
||||
{79, EMS_DEVICE_TYPE_MIXING, "MM100 Mixer Module", EMS_DEVICE_FLAG_NONE},
|
||||
{80, EMS_DEVICE_TYPE_MIXING, "MM200 Mixer Module", EMS_DEVICE_FLAG_NONE},
|
||||
{78, EMS_DEVICE_TYPE_MIXING, "MM400 Mixer Module", EMS_DEVICE_FLAG_NONE},
|
||||
{79, EMS_DEVICE_TYPE_MIXING, "Junkers M100", EMS_DEVICE_FLAG_NONE},
|
||||
{80, EMS_DEVICE_TYPE_MIXING, "Junkers M200", EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
//
|
||||
// HeatPump - type 0x38
|
||||
@@ -286,10 +283,10 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{206, EMS_DEVICE_TYPE_CONNECT, "Bosch Easy Connect", EMS_DEVICE_FLAG_NONE}, // 0x02
|
||||
{171, EMS_DEVICE_TYPE_CONNECT, "EMS-OT OpenTherm converter", EMS_DEVICE_FLAG_NONE}, // 0x02
|
||||
{189, EMS_DEVICE_TYPE_GATEWAY, "Web Gateway KM200", EMS_DEVICE_FLAG_NONE}, // 0x48
|
||||
{94, EMS_DEVICE_TYPE_MODEM, "RC Remote Device", EMS_DEVICE_FLAG_NONE}, // 0x19
|
||||
{94, EMS_DEVICE_TYPE_MODEM, "RC Remote Device", EMS_DEVICE_FLAG_NONE}, // 0x18
|
||||
|
||||
//
|
||||
// Thermostats, typically device id of 0x10, 0x17, 0x18 and 0x39 (easy)
|
||||
// Thermostats, typically device id of 0x10, 0x17, 0x18, 0x38 (RC100), 0x39 (Easy)
|
||||
//
|
||||
|
||||
// Easy devices - not currently supporting write operations
|
||||
@@ -303,9 +300,9 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{67, EMS_DEVICE_TYPE_THERMOSTAT, "RC30", EMS_DEVICE_FLAG_RC30}, // 0x10
|
||||
{78, EMS_DEVICE_TYPE_THERMOSTAT, "RC30/Moduline 400", EMS_DEVICE_FLAG_RC30}, // 0x10
|
||||
{86, EMS_DEVICE_TYPE_THERMOSTAT, "RC35", EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
{93, EMS_DEVICE_TYPE_THERMOSTAT, "RC20RF", EMS_DEVICE_FLAG_RC20}, // 0x18
|
||||
{93, EMS_DEVICE_TYPE_THERMOSTAT, "RC20RF", EMS_DEVICE_FLAG_RC20}, // 0x19
|
||||
{158, EMS_DEVICE_TYPE_THERMOSTAT, "RC300/RC310/Moduline 3000/Bosch CW400/W-B Sense II", EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1010", EMS_DEVICE_FLAG_RC300 | EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
{165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1010", EMS_DEVICE_FLAG_RC300 | EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, 0x38 - cannot write
|
||||
|
||||
// Sieger
|
||||
{76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define APP_VERSION "1.9.5b11"
|
||||
#define APP_VERSION "1.9.5b12"
|
||||
|
||||
Reference in New Issue
Block a user