From 8f564ab1f732792d5d74387a12ebae6109fe94da Mon Sep 17 00:00:00 2001 From: Proddy Date: Thu, 16 Jan 2020 10:30:56 +0100 Subject: [PATCH 1/7] fix link to supported devices --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 774b1a468..890370502 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ EMS-ESP is a open-source system built for the Espressif ESP8266 microcontroller ## Features -* Supporting more than [50 EMS devices](https://proddy.github.io/EMS-ESP/#/Supported-EMS-Devices) (EMS 1.0, 2.0 and Heatronics). +* Supporting more than [50 EMS devices](https://emsesp.github.io/docs/#/Supported-EMS-Devices) (EMS 1, EMS 2.0/Plus and Heatronics 3). * A web interface for easy configuration and real-time monitoring of the EMS bus. * Telnet for advanced configuration and verbose traffic logging. * Configurable MQTT, with templates for Home Assistant and Domoticz. From ed4b16f24d04207794da70f7322f6aa8b20f40c5 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 19 Jan 2020 14:52:17 +0100 Subject: [PATCH 2/7] update arduinojson --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 747006030..7bf25ed66 100644 --- a/platformio.ini +++ b/platformio.ini @@ -52,7 +52,7 @@ lib_deps = JustWifi@2.0.2 ; https://github.com/xoseperez/justwifi AsyncMqttClient@0.8.2 ; https://github.com/marvinroger/async-mqtt-client EEPROM_Rotate@0.9.2 ; https://github.com/xoseperez/eeprom_rotate - ArduinoJson@6.13.0 ; https://github.com/bblanchon/ArduinoJson + ArduinoJson@6.14.0 ; https://github.com/bblanchon/ArduinoJson ESPAsyncTCP@1.2.2 ; https://github.com/me-no-dev/ESPAsyncTCP upload_speed = 921600 monitor_speed = 115200 From 5911aa8506ef3ccaa99990fa071e18491faf6c22 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 19 Jan 2020 14:52:26 +0100 Subject: [PATCH 3/7] bump to b18 --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 32897e3e2..6406162bd 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "1.9.5b17" +#define APP_VERSION "1.9.5b18" From db2d2e994dce9f097e6bcfdc916f195bf9607a3b Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 19 Jan 2020 14:52:54 +0100 Subject: [PATCH 4/7] mqttlog [all] function --- src/MyESP.cpp | 35 +++++++++++++++++++---------------- src/MyESP.h | 16 ++++++++-------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/MyESP.cpp b/src/MyESP.cpp index 0d0f3f645..a8804efbd 100644 --- a/src/MyESP.cpp +++ b/src/MyESP.cpp @@ -725,8 +725,8 @@ void MyESP::_consoleShowHelp() { myDebug_P(PSTR("*")); myDebug_P(PSTR("* Commands:")); - myDebug_P(PSTR("* ?/help=show commands, CTRL-D/quit=close telnet session")); - myDebug_P(PSTR("* set, system, restart, mqttlog, kick, save")); + myDebug_P(PSTR("* ?/help=show commands, CTRL-D/quit=end telnet session")); + myDebug_P(PSTR("* set, system, restart, mqttlog [all], kick, save")); #ifdef CRASH myDebug_P(PSTR("* crash ")); @@ -1052,12 +1052,12 @@ void MyESP::_telnetCommand(char * commandLine) { } // print mqtt log command - if ((strcmp(ptrToCommandName, "mqttlog") == 0) && (wc == 1)) { - _printMQTTLog(); + if (strcmp(ptrToCommandName, "mqttlog") == 0) { + _printMQTTLog(wc != 1); return; } - // show system stats + // show system status if ((strcmp(ptrToCommandName, "system") == 0) && (wc == 1)) { showSystemStats(); return; @@ -1070,7 +1070,7 @@ void MyESP::_telnetCommand(char * commandLine) { return; } - // show system stats + // quit if ((strcmp(ptrToCommandName, "quit") == 0) && (wc == 1)) { myDebug_P(PSTR("[TELNET] exiting telnet session")); SerialAndTelnet.disconnectClient(); @@ -1333,13 +1333,13 @@ void MyESP::_systemCheckLoop() { } } -// print out ESP system stats +// print out ESP system status // for battery power is ESP.getVcc() void MyESP::showSystemStats() { #if defined(ESP8266) - myDebug_P(PSTR("%sESP8266 System stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF); + myDebug_P(PSTR("%sESP8266 System status:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF); #else - myDebug_P(PSTR("ESP32 System stats:")); + myDebug_P(PSTR("ESP32 System status:")); #endif myDebug_P(PSTR("")); @@ -2688,13 +2688,13 @@ void MyESP::_printHeap(const char * prefix) { } // print MQTT log - everything that was published last per topic -void MyESP::_printMQTTLog() { +void MyESP::_printMQTTLog(bool show_sub = false) { myDebug_P(PSTR("MQTT publish log:")); uint8_t i; for (i = 0; i < MYESP_MQTTLOG_MAX; i++) { if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_PUBLISH)) { - myDebug_P(PSTR(" Timestamp:%02d:%02d:%02d Topic:%s Payload:%s"), + myDebug_P(PSTR(" (%02d:%02d:%02d) Topic:%s Payload:%s"), to_hour(MQTT_log[i].timestamp), to_minute(MQTT_log[i].timestamp), to_second(MQTT_log[i].timestamp), @@ -2703,12 +2703,15 @@ void MyESP::_printMQTTLog() { } } - myDebug_P(PSTR("")); // newline - myDebug_P(PSTR("MQTT subscriptions:")); + // show subscriptions + if (show_sub) { + myDebug_P(PSTR("")); // newline + myDebug_P(PSTR("MQTT subscriptions:")); - for (i = 0; i < MYESP_MQTTLOG_MAX; i++) { - if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_SUBSCRIBE)) { - myDebug_P(PSTR(" Topic:%s"), MQTT_log[i].topic); + for (i = 0; i < MYESP_MQTTLOG_MAX; i++) { + if ((MQTT_log[i].topic != nullptr) && (MQTT_log[i].type == MYESP_MQTTLOGTYPE_SUBSCRIBE)) { + myDebug_P(PSTR(" Topic:%s"), MQTT_log[i].topic); + } } } diff --git a/src/MyESP.h b/src/MyESP.h index 3f78b7b5b..53bfdf1e8 100644 --- a/src/MyESP.h +++ b/src/MyESP.h @@ -9,7 +9,7 @@ #ifndef MyESP_h #define MyESP_h -#define MYESP_VERSION "1.2.24" +#define MYESP_VERSION "1.2.25" #include #include @@ -335,17 +335,17 @@ class MyESP { private: // mqtt - void _mqttOnMessage(char * topic, char * payload, size_t len); - void _mqttConnect(); - void _mqtt_setup(); - void _mqttOnConnect(); - void _sendStart(); - char * _mqttTopic(const char * topic); + void _mqttOnMessage(char * topic, char * payload, size_t len); + void _mqttConnect(); + void _mqtt_setup(); + void _mqttOnConnect(); + void _sendStart(); + char * _mqttTopic(const char * topic); // mqtt log _MQTT_Log_t MQTT_log[MYESP_MQTTLOG_MAX]; // log for publish and subscribe messages - void _printMQTTLog(); + void _printMQTTLog(bool show_sub); void _addMQTTLog(const char * topic, const char * payload, const MYESP_MQTTLOGTYPE_t type); AsyncMqttClient mqttClient; // the MQTT class From b037efb48d6ba8980f61de844692c2d82c5c531c Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 19 Jan 2020 14:53:08 +0100 Subject: [PATCH 5/7] minor text changes --- src/ems_devices.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ems_devices.h b/src/ems_devices.h index 9d65b40c4..cf46fba39 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -54,7 +54,7 @@ #define EMS_OFFSET_UBASetPoints_flowtemp 0 // flow temp // SM and HP Types -// Assuming SM100 behaves like SM200 +// Assuming here that the SM200 behaves like SM100 #define EMS_TYPE_SM10Monitor 0x97 // SM10Monitor #define EMS_TYPE_SM100Monitor 0x0262 // SM100Monitor #define EMS_TYPE_SM100Status 0x0264 // SM100Status @@ -112,7 +112,6 @@ #define EMS_OFFSET_RC35StatusMessage_mode 1 // day mode, also summer on RC3's #define EMS_OFFSET_RC35StatusMessage_mode1 0 // for holiday mode - #define EMS_TYPE_RC35Set_HC1 0x3D // for setting values like temp and mode (Working mode HC1) #define EMS_TYPE_RC35Set_HC2 0x47 // for setting values like temp and mode (Working mode HC2) #define EMS_TYPE_RC35Set_HC3 0x51 // for setting values like temp and mode (Working mode HC3) From cd848817691421e5f5d75fdb488c52a97152df89 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 19 Jan 2020 14:53:42 +0100 Subject: [PATCH 6/7] rename 'stats' to 'data' --- src/ems.cpp | 11 +++++++---- src/websrc/myesp.htm | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ems.cpp b/src/ems.cpp index 6287f392a..8217f9f21 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -76,7 +76,7 @@ bool ems_isHT3() { return (EMS_Sys_Status.emsIDMask == 0x80); } -// init stats and counters and buffers +// init EMS device values, counters and buffers void ems_init() { ems_clearDeviceList(); // init the device map @@ -742,12 +742,14 @@ void ems_parseTelegram(uint8_t * telegram, uint8_t length) { * It may happen that we were interrupted (for instance by WIFI activity) and the * buffer isn't valid anymore, so we must not answer at all... */ + /* if (EMS_Sys_Status.emsRxStatus != EMS_RX_STATUS_IDLE) { if (EMS_Sys_Status.emsLogging > EMS_SYS_LOGGING_NONE) { myDebug_P(PSTR("** Warning, we missed the bus - Rx non-idle!")); } return; } + */ /* * check if we just received one byte @@ -1250,7 +1252,7 @@ void _process_MMPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { // Mixer - 0xAB void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { - uint8_t hc = 0; // fixed, for 0xAB (HC1 only + uint8_t hc = 0; // fixed, for 0xAB (HC1 only) EMS_Mixing.hc[hc].active = true; _setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].flowTemp, EMS_OFFSET_MMStatusMessage_flow_temp); @@ -1937,8 +1939,8 @@ void ems_getThermostatValues() { * Generic function to return various settings from the thermostat */ void ems_getBoilerValues() { - ems_doReadCommand(EMS_TYPE_UBAMonitorFast, EMS_Boiler.device_id); // get boiler stats, instead of waiting 10secs for the broadcast - ems_doReadCommand(EMS_TYPE_UBAMonitorSlow, EMS_Boiler.device_id); // get more boiler stats, instead of waiting 60secs for the broadcast + ems_doReadCommand(EMS_TYPE_UBAMonitorFast, EMS_Boiler.device_id); // get boiler data, instead of waiting 10secs for the broadcast + ems_doReadCommand(EMS_TYPE_UBAMonitorSlow, EMS_Boiler.device_id); // get more boiler data, instead of waiting 60secs for the broadcast ems_doReadCommand(EMS_TYPE_UBAParameterWW, EMS_Boiler.device_id); // get Warm Water values ems_doReadCommand(EMS_TYPE_UBAParametersMessage, EMS_Boiler.device_id); // get MC10 boiler values ems_doReadCommand(EMS_TYPE_UBATotalUptimeMessage, EMS_Boiler.device_id); // get uptime from boiler @@ -2567,6 +2569,7 @@ void ems_setFlowTemp(uint8_t temperature) { /** * Set the warm water mode to comfort to Eco/Comfort * 1 = Hot, 2 = Eco, 3 = Intelligent + * to 0x33 */ void ems_setWarmWaterModeComfort(uint8_t comfort) { _EMS_TxTelegram EMS_TxTelegram = EMS_TX_TELEGRAM_NEW; // create new Tx diff --git a/src/websrc/myesp.htm b/src/websrc/myesp.htm index 2ada3ff59..6ed02bd4c 100644 --- a/src/websrc/myesp.htm +++ b/src/websrc/myesp.htm @@ -253,7 +253,7 @@
+ data-content="Enable or Disable an automatic MQTT topic publish with system status">