minor formatting - no feature changes

This commit is contained in:
Paul
2020-02-16 21:32:10 +01:00
parent 4ef86e66ae
commit ce49b37a34
7 changed files with 97 additions and 79 deletions

View File

@@ -2694,7 +2694,7 @@ void MyESP::_printMQTTLog(bool show_sub = false) {
for (i = 0; i < MYESP_MQTTLOG_MAX; i++) { for (i = 0; i < MYESP_MQTTLOG_MAX; i++) {
if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_PUBLISH)) { if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_PUBLISH)) {
myDebug_P(PSTR(" (%02d:%02d:%02d) Topic:%s Payload:%s"), myDebug_P(PSTR(" (%02d:%02d:%02d) Topic: %s Payload: %s"),
to_hour(MQTT_log[i].timestamp), to_hour(MQTT_log[i].timestamp),
to_minute(MQTT_log[i].timestamp), to_minute(MQTT_log[i].timestamp),
to_second(MQTT_log[i].timestamp), to_second(MQTT_log[i].timestamp),
@@ -2710,7 +2710,7 @@ void MyESP::_printMQTTLog(bool show_sub = false) {
for (i = 0; i < MYESP_MQTTLOG_MAX; i++) { for (i = 0; i < MYESP_MQTTLOG_MAX; i++) {
if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_SUBSCRIBE)) { if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_SUBSCRIBE)) {
myDebug_P(PSTR(" Topic:%s"), MQTT_log[i].topic); myDebug_P(PSTR(" Topic: %s"), MQTT_log[i].topic);
} }
} }
} }

View File

@@ -108,7 +108,7 @@ function listCustomStats() {
} else if (type === "Heat Pump") { } else if (type === "Heat Pump") {
color = "list-group-item-success"; color = "list-group-item-success";
} }
l.innerHTML = obj[i].model + " (Version:" + obj[i].version + " ProductID:" + obj[i].productid + " DeviceID:0x" + obj[i].deviceid + ")"; l.innerHTML = obj[i].model + " (DeviceID: 0x" + obj[i].deviceid + ", ProductID: " + obj[i].productid + ", Version: " + obj[i].version + ")";
l.className = "list-group-item " + color; l.className = "list-group-item " + color;
list.appendChild(l); list.appendChild(l);
} }

View File

@@ -247,7 +247,7 @@ void showInfo() {
(ems_getBoilerEnabled() ? "enabled" : "disabled"), (ems_getBoilerEnabled() ? "enabled" : "disabled"),
(ems_getThermostatEnabled() ? "enabled" : "disabled"), (ems_getThermostatEnabled() ? "enabled" : "disabled"),
(ems_getSolarModuleEnabled() ? "enabled" : "disabled"), (ems_getSolarModuleEnabled() ? "enabled" : "disabled"),
(ems_getMixingDeviceEnabled() ? "enabled" : "disabled")); (ems_getMixingModuleEnabled() ? "enabled" : "disabled"));
myDebug_P(PSTR(" Shower Timer: %s, Shower Alert: %s"), myDebug_P(PSTR(" Shower Timer: %s, Shower Alert: %s"),
((EMSESP_Settings.shower_timer) ? "enabled" : "disabled"), ((EMSESP_Settings.shower_timer) ? "enabled" : "disabled"),
@@ -485,7 +485,7 @@ void showInfo() {
} }
// Mixing modules sensors // Mixing modules sensors
if (ems_getMixingDeviceEnabled()) { if (ems_getMixingModuleEnabled()) {
myDebug_P(PSTR("")); // newline myDebug_P(PSTR("")); // newline
myDebug_P(PSTR("%sMixing module data:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF); myDebug_P(PSTR("%sMixing module data:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF);
myDebug_P(PSTR(" Mixing Module: %s"), ems_getDeviceDescription(EMS_DEVICE_TYPE_MIXING, buffer_type, false)); myDebug_P(PSTR(" Mixing Module: %s"), ems_getDeviceDescription(EMS_DEVICE_TYPE_MIXING, buffer_type, false));
@@ -530,7 +530,7 @@ void showInfo() {
for (uint8_t i = 0; i < EMSESP_Settings.dallas_sensors; i++) { for (uint8_t i = 0; i < EMSESP_Settings.dallas_sensors; i++) {
float sensorValue = ds18.getValue(i); float sensorValue = ds18.getValue(i);
if (sensorValue != DS18_DISCONNECTED) { if (sensorValue != DS18_DISCONNECTED) {
myDebug_P(PSTR(" Sensor #%d type:%s id:%s temperature: %s C"), myDebug_P(PSTR(" Sensor #%d type: %s id: %s temperature: %s C"),
i + 1, i + 1,
ds18.getDeviceType(buffer, i), ds18.getDeviceType(buffer, i),
ds18.getDeviceID(buffer2, i), ds18.getDeviceID(buffer2, i),
@@ -549,7 +549,7 @@ void scanDallas() {
char buffer[128]; char buffer[128];
char buffer2[128]; char buffer2[128];
for (uint8_t i = 0; i < EMSESP_Settings.dallas_sensors; i++) { for (uint8_t i = 0; i < EMSESP_Settings.dallas_sensors; i++) {
myDebug_P(PSTR("External temperature sensor type:%s id:%s found"), ds18.getDeviceType(buffer, i), ds18.getDeviceID(buffer2, i)); myDebug_P(PSTR("External temperature sensor type: %s id: %s found"), ds18.getDeviceType(buffer, i), ds18.getDeviceID(buffer2, i));
} }
} }
} }
@@ -789,7 +789,7 @@ void publishEMSValues(bool force) {
} }
// handle the mixing values // handle the mixing values
if (ems_getMixingDeviceEnabled() && (ems_Device_has_flags(EMS_DEVICE_UPDATE_FLAG_MIXING) || force)) { if (ems_getMixingModuleEnabled() && (ems_Device_has_flags(EMS_DEVICE_UPDATE_FLAG_MIXING) || force)) {
doc.clear(); doc.clear();
JsonObject rootMixing = doc.to<JsonObject>(); JsonObject rootMixing = doc.to<JsonObject>();

View File

@@ -241,7 +241,7 @@ bool ems_getThermostatEnabled() {
return (EMS_Thermostat.device_id != EMS_ID_NONE); return (EMS_Thermostat.device_id != EMS_ID_NONE);
} }
bool ems_getMixingDeviceEnabled() { bool ems_getMixingModuleEnabled() {
return EMS_MixingModule.device_id != EMS_ID_NONE; return EMS_MixingModule.device_id != EMS_ID_NONE;
} }
@@ -1737,11 +1737,11 @@ bool _addDevice(_EMS_DEVICE_TYPE device_type, uint8_t product_id, uint8_t device
strlcat(line, device_desc_p, sizeof(line)); strlcat(line, device_desc_p, sizeof(line));
} }
strlcat(line, " (DeviceID:0x", sizeof(line)); strlcat(line, " (DeviceID: 0x", sizeof(line));
strlcat(line, _hextoa(device_id, tmp), sizeof(line)); strlcat(line, _hextoa(device_id, tmp), sizeof(line));
strlcat(line, " ProductID:", sizeof(line)); strlcat(line, ", ProductID: ", sizeof(line));
strlcat(line, itoa(product_id, tmp, 10), sizeof(line)); strlcat(line, itoa(product_id, tmp, 10), sizeof(line));
strlcat(line, " Version:", sizeof(line)); strlcat(line, ", Version: ", sizeof(line));
strlcat(line, version, sizeof(line)); strlcat(line, version, sizeof(line));
strlcat(line, ")", sizeof(line)); strlcat(line, ")", sizeof(line));
@@ -1913,7 +1913,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
EMS_MixingModule.device_desc_p = device_desc_p; EMS_MixingModule.device_desc_p = device_desc_p;
EMS_MixingModule.device_flags = flags; EMS_MixingModule.device_flags = flags;
strlcpy(EMS_MixingModule.version, version, sizeof(EMS_MixingModule.version)); strlcpy(EMS_MixingModule.version, version, sizeof(EMS_MixingModule.version));
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, device_id); // fetch MM values ems_getMixingModuleValues(); // fetch Mixing Module values
} }
} }
@@ -2049,14 +2049,27 @@ void ems_getBoilerValues() {
} }
/* /*
* Get other values from EMS devices * Get solar values from EMS devices
*/ */
void ems_getSolarModuleValues() { void ems_getSolarModuleValues() {
if (ems_getSolarModuleEnabled()) { if (ems_getSolarModuleEnabled()) {
if (EMS_SolarModule.device_flags == EMS_DEVICE_FLAG_SM10) { if (EMS_SolarModule.device_flags == EMS_DEVICE_FLAG_SM10) {
ems_doReadCommand(EMS_TYPE_SM10Monitor, EMS_ID_SM); // fetch all from SM10Monitor ems_doReadCommand(EMS_TYPE_SM10Monitor, EMS_SolarModule.device_id); // fetch all from SM10Monitor
} else if (EMS_SolarModule.device_flags == EMS_DEVICE_FLAG_SM100) { } else if (EMS_SolarModule.device_flags == EMS_DEVICE_FLAG_SM100) {
ems_doReadCommand(EMS_TYPE_SM100Monitor, EMS_ID_SM); // fetch all from SM100Monitor ems_doReadCommand(EMS_TYPE_SM100Monitor, EMS_SolarModule.device_id); // fetch all from SM100Monitor
}
}
}
/*
* Get mixing module values from EMS devices
*/
void ems_getMixingModuleValues() {
if (ems_getMixingModuleEnabled()) {
if (EMS_MixingModule.device_flags == EMS_DEVICE_FLAG_MMPLUS) {
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, EMS_MixingModule.device_id);
} else if (EMS_MixingModule.device_flags == EMS_DEVICE_FLAG_MM10) {
ems_doReadCommand(EMS_TYPE_MMStatusMessage, EMS_MixingModule.device_id);
} }
} }
} }
@@ -2159,7 +2172,7 @@ char * ems_getDeviceDescription(_EMS_DEVICE_TYPE device_type, char * buffer, boo
device_desc_p = EMS_HeatPump.device_desc_p; device_desc_p = EMS_HeatPump.device_desc_p;
version = EMS_HeatPump.version; version = EMS_HeatPump.version;
} else if (device_type == EMS_DEVICE_TYPE_MIXING) { } else if (device_type == EMS_DEVICE_TYPE_MIXING) {
enabled = ems_getMixingDeviceEnabled(); enabled = ems_getMixingModuleEnabled();
device_id = EMS_MixingModule.device_id; device_id = EMS_MixingModule.device_id;
product_id = EMS_MixingModule.product_id; product_id = EMS_MixingModule.product_id;
device_desc_p = EMS_MixingModule.device_desc_p; device_desc_p = EMS_MixingModule.device_desc_p;
@@ -2183,12 +2196,12 @@ char * ems_getDeviceDescription(_EMS_DEVICE_TYPE device_type, char * buffer, boo
return buffer; // only interested in the model name return buffer; // only interested in the model name
} }
strlcat(buffer, " (DeviceID:0x", size); strlcat(buffer, " (DeviceID: 0x", size);
char tmp[6] = {0}; char tmp[6] = {0};
strlcat(buffer, _hextoa(device_id, tmp), size); strlcat(buffer, _hextoa(device_id, tmp), size);
strlcat(buffer, " ProductID:", size); strlcat(buffer, ", ProductID: ", size);
strlcat(buffer, itoa(product_id, tmp, 10), size); strlcat(buffer, itoa(product_id, tmp, 10), size);
strlcat(buffer, " Version:", size); strlcat(buffer, ", Version: ", size);
strlcat(buffer, version, size); strlcat(buffer, version, size);
strlcat(buffer, ")", size); strlcat(buffer, ")", size);
@@ -2242,7 +2255,7 @@ void ems_printDevices() {
} }
if ((it->device_type == EMS_DEVICE_TYPE_THERMOSTAT) && (EMS_Sys_Status.emsMasterThermostat == it->product_id)) { if ((it->device_type == EMS_DEVICE_TYPE_THERMOSTAT) && (EMS_Sys_Status.emsMasterThermostat == it->product_id)) {
myDebug_P(PSTR(" %s: %s%s%s (DeviceID:0x%02X ProductID:%d Version:%s) [master]"), myDebug_P(PSTR(" %s: %s%s%s (DeviceID: 0x%02X, ProductID: %d, Version: %s) [master]"),
device_type, device_type,
COLOR_BOLD_ON, COLOR_BOLD_ON,
device_string, device_string,
@@ -2252,7 +2265,7 @@ void ems_printDevices() {
it->version); it->version);
} else { } else {
myDebug_P(PSTR(" %s: %s%s%s (DeviceID:0x%02X ProductID:%d Version:%s)"), myDebug_P(PSTR(" %s: %s%s%s (DeviceID: 0x%02X, ProductID: %d, Version: %s)"),
device_type, device_type,
COLOR_BOLD_ON, COLOR_BOLD_ON,
device_string, device_string,
@@ -3207,8 +3220,9 @@ void ems_scanDevices() {
std::list<uint8_t> Device_Ids; // create a new list std::list<uint8_t> Device_Ids; // create a new list
Device_Ids.push_back(EMS_ID_BOILER); // UBAMaster/Boilers - 0x08 Device_Ids.push_back(EMS_ID_BOILER); // UBAMaster/Boilers - 0x08
Device_Ids.push_back(EMS_ID_HP); // HeatPump - 0x38 Device_Ids.push_back(0x09); // Controllers - 0x09
Device_Ids.push_back(EMS_ID_SM); // Solar Module - 0x30 Device_Ids.push_back(0x38); // HeatPump - 0x38
Device_Ids.push_back(0x30); // Solar Module - 0x30
Device_Ids.push_back(0x09); // Controllers - 0x09 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

View File

@@ -46,8 +46,10 @@
#define EMS_DEVICE_FLAG_NONE 0 // no flags set #define EMS_DEVICE_FLAG_NONE 0 // no flags set
#define EMS_DEVICE_FLAG_SM10 10 // solar module1 #define EMS_DEVICE_FLAG_SM10 10 // solar module1
#define EMS_DEVICE_FLAG_SM100 11 // solar module2 #define EMS_DEVICE_FLAG_SM100 11 // solar module2
#define EMS_DEVICE_FLAG_MMPLUS 12 // mixing module EMS+
#define EMS_DEVICE_FLAG_MM10 13 // mixing modules MM10 and MM50
// group flags specific for thermostats // device flags specific for thermostats
#define EMS_DEVICE_FLAG_NO_WRITE 0x80 // top bit set if write not supported #define EMS_DEVICE_FLAG_NO_WRITE 0x80 // top bit set if write not supported
#define EMS_DEVICE_FLAG_EASY 1 #define EMS_DEVICE_FLAG_EASY 1
#define EMS_DEVICE_FLAG_RC10 2 #define EMS_DEVICE_FLAG_RC10 2
@@ -464,16 +466,21 @@ void ems_setMasterThermostat(uint8_t product_id);
char * ems_getDeviceDescription(_EMS_DEVICE_TYPE device_type, char * buffer, bool name_only = false); char * ems_getDeviceDescription(_EMS_DEVICE_TYPE device_type, char * buffer, bool name_only = false);
bool ems_getDeviceTypeDescription(uint8_t device_id, char * buffer); bool ems_getDeviceTypeDescription(uint8_t device_id, char * buffer);
char * ems_getDeviceTypeName(_EMS_DEVICE_TYPE device_type, char * buffer); char * ems_getDeviceTypeName(_EMS_DEVICE_TYPE device_type, char * buffer);
void ems_getThermostatValues(); void ems_getThermostatValues();
void ems_getBoilerValues(); void ems_getBoilerValues();
void ems_getSolarModuleValues(); void ems_getSolarModuleValues();
void ems_getMixingModuleValues();
bool ems_getPoll(); bool ems_getPoll();
bool ems_getTxEnabled(); bool ems_getTxEnabled();
bool ems_getThermostatEnabled(); bool ems_getThermostatEnabled();
bool ems_getMixingDeviceEnabled(); bool ems_getMixingModuleEnabled();
bool ems_getBoilerEnabled(); bool ems_getBoilerEnabled();
bool ems_getSolarModuleEnabled(); bool ems_getSolarModuleEnabled();
bool ems_getHeatPumpEnabled(); bool ems_getHeatPumpEnabled();
bool ems_getBusConnected(); bool ems_getBusConnected();
_EMS_SYS_LOGGING ems_getLogging(); _EMS_SYS_LOGGING ems_getLogging();
uint8_t ems_getThermostatModel(); uint8_t ems_getThermostatModel();

View File

@@ -14,9 +14,6 @@
// Fixed EMS Device IDs // Fixed EMS Device IDs
#define EMS_ID_ME 0x0B // our device, hardcoded as the "Service Key" #define EMS_ID_ME 0x0B // our device, hardcoded as the "Service Key"
#define EMS_ID_BOILER 0x08 // all UBA Boilers have 0x08 #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 // Heat Pump
#define EMS_ID_CONTROLLER 0x09 // controllers, some are built in
/* /*
* Common Type * Common Type
@@ -230,10 +227,10 @@ static const _EMS_Device EMS_Devices[] = {
// //
// Mixing Devices - type 0x20 or 0x21 // Mixing Devices - type 0x20 or 0x21
// //
{160, EMS_DEVICE_TYPE_MIXING, "MM100 Mixing Module", EMS_DEVICE_FLAG_NONE}, {160, EMS_DEVICE_TYPE_MIXING, "MM100 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
{161, EMS_DEVICE_TYPE_MIXING, "MM200 Mixing Module", EMS_DEVICE_FLAG_NONE}, {161, EMS_DEVICE_TYPE_MIXING, "MM200 Mixing Module", EMS_DEVICE_FLAG_MMPLUS},
{69, EMS_DEVICE_TYPE_MIXING, "MM10 Mixing Module", EMS_DEVICE_FLAG_NONE}, {69, EMS_DEVICE_TYPE_MIXING, "MM10 Mixing Module", EMS_DEVICE_FLAG_MM10},
{159, EMS_DEVICE_TYPE_MIXING, "MM50 Mixing Module", EMS_DEVICE_FLAG_NONE}, {159, EMS_DEVICE_TYPE_MIXING, "MM50 Mixing Module", EMS_DEVICE_FLAG_MM10},
// //
// HeatPump - type 0x38 // HeatPump - type 0x38

View File

@@ -1 +1 @@
#define APP_VERSION "1.9.5b33" #define APP_VERSION "1.9.5b34"