diff --git a/CHANGELOG.md b/CHANGELOG.md index 83f447f48..8b70a3088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Merged with @susisstrolch's TxMode2 branch for improved support for sending EMS packages, and removed tx_mode command - Renamed heartbeat to mqtt_heartbeat +- Renamed MQTT topic "wwactivated" to "boiler_cmd_wwactivated" ## [1.9.0b1_web] 2019-08-02 diff --git a/src/MyESP.cpp b/src/MyESP.cpp index 0599e7a59..4fb0b7732 100644 --- a/src/MyESP.cpp +++ b/src/MyESP.cpp @@ -35,7 +35,7 @@ MyESP::MyESP() { _general_hostname = strdup("myesp"); _app_name = strdup("MyESP"); _app_version = strdup(MYESP_VERSION); - _app_helpurl = nullptr; + _app_url = nullptr; _app_updateurl = nullptr; // general @@ -351,7 +351,6 @@ void MyESP::_mqttOnMessage(char * topic, char * payload, size_t len) { } // MQTT subscribe -// to MQTT_BASE/app_hostname/topic void MyESP::mqttSubscribe(const char * topic) { if (mqttClient.connected() && (strlen(topic) > 0)) { unsigned int packetId = mqttClient.subscribe(_mqttTopic(topic), _mqtt_qos); @@ -360,7 +359,6 @@ void MyESP::mqttSubscribe(const char * topic) { } // MQTT unsubscribe -// to MQTT_BASE with app_hostname/topic void MyESP::mqttUnsubscribe(const char * topic) { if (mqttClient.connected() && (strlen(topic) > 0)) { unsigned int packetId = mqttClient.unsubscribe(_mqttTopic(topic)); @@ -1224,7 +1222,15 @@ void MyESP::showSystemStats() { uint32_t rem = t % 3600L; uint8_t m = rem / 60; uint8_t s = rem % 60; - myDebug_P(PSTR(" [APP] Uptime: %d days %d hours %d minutes %d seconds"), d, h, m, s); + myDebug_P(PSTR(" [APP] Uptime: %d day%s %d hour%s %d minute%s %d second%s"), + d, + (d == 1) ? "" : "s", + h, + (h == 1) ? "" : "s", + m, + (m == 1) ? "" : "s", + s, + (s == 1) ? "" : "s"); myDebug_P(PSTR(" [APP] System Load: %d%%"), getSystemLoadAverage()); @@ -2311,7 +2317,7 @@ void MyESP::_sendCustomStatus() { root["command"] = "custom_status"; root["version"] = _app_version; root["customname"] = _app_name; - root["helpurl"] = _app_helpurl; + root["appurl"] = _app_url; root["updateurl"] = _app_updateurl; // add specific custom stuff @@ -2368,7 +2374,7 @@ void MyESP::_sendStatus() { uint32_t rem = t % 3600L; uint8_t m = rem / 60; uint8_t sec = rem % 60; - sprintf(uptime, "%d days %d hours %d minutes %d seconds", d, h, m, sec); + sprintf(uptime, "%d day%s %d hour%s %d minute%s %d second%s", d, (d == 1) ? "" : "s", h, (h == 1) ? "" : "s", m, (m == 1) ? "" : "s", sec, (sec == 1) ? "" : "s"); root["uptime"] = uptime; char buffer[400]; @@ -2579,11 +2585,11 @@ void MyESP::_bootupSequence() { } // setup MyESP -void MyESP::begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_helpurl, const char * app_updateurl) { +void MyESP::begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_updateurl) { _general_hostname = strdup(app_hostname); _app_name = strdup(app_name); _app_version = strdup(app_version); - _app_helpurl = strdup(app_helpurl); + _app_url = strdup(app_url); _app_updateurl = strdup(app_updateurl); _telnet_setup(); // Telnet setup, called first to set Serial diff --git a/src/MyESP.h b/src/MyESP.h index b189f7bfa..146adc2af 100644 --- a/src/MyESP.h +++ b/src/MyESP.h @@ -285,7 +285,7 @@ class MyESP { // general void end(); void loop(); - void begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_helpurl, const char * app_updateurl); + void begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_updateurl); void resetESP(); int getWifiQuality(); void showSystemStats(); @@ -373,7 +373,7 @@ class MyESP { char * _general_hostname; char * _app_name; char * _app_version; - char * _app_helpurl; + char * _app_url; char * _app_updateurl; bool _suspendOutput; bool _general_serial; diff --git a/src/custom.htm b/src/custom.htm index 80001392d..a5fe891f9 100644 --- a/src/custom.htm +++ b/src/custom.htm @@ -163,7 +163,9 @@ EMS Bus stats - + + + @@ -189,10 +191,17 @@ Central Heating: - Selected Flow Temperature: - - Boiler Temperature: - + + Selected Flow Temperature: + + Current Flow Temperature: + + + + Boiler Temperature: + + Return Temperature: + diff --git a/src/custom.js b/src/custom.js index 31a1aa04a..f7c5d2f7d 100644 --- a/src/custom.js +++ b/src/custom.js @@ -112,6 +112,8 @@ function listCustomStats() { document.getElementById("b2").innerHTML = ajaxobj.boiler.b2; document.getElementById("b3").innerHTML = ajaxobj.boiler.b3 + " ℃"; document.getElementById("b4").innerHTML = ajaxobj.boiler.b4 + " ℃"; + document.getElementById("b5").innerHTML = ajaxobj.boiler.b5 + " ℃"; + document.getElementById("b6").innerHTML = ajaxobj.boiler.b6 + " ℃"; } else { document.getElementById("boiler_show").style.display = "none"; } diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 7a59e56ba..485607c15 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -1522,18 +1522,20 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) { if (type == MQTT_CONNECT_EVENT) { myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_TEMP); myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_MODE); - myESP.mqttSubscribe(TOPIC_BOILER_WWACTIVATED); - myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWTEMP); - myESP.mqttSubscribe(TOPIC_BOILER_CMD_COMFORT); - myESP.mqttSubscribe(TOPIC_BOILER_CMD_FLOWTEMP); - myESP.mqttSubscribe(TOPIC_SHOWER_TIMER); - myESP.mqttSubscribe(TOPIC_SHOWER_ALERT); - myESP.mqttSubscribe(TOPIC_SHOWER_COLDSHOT); myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_HC); myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_DAYTEMP); myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_NIGHTTEMP); myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_HOLIDAYTEMP); + myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWACTIVATED); + myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWTEMP); + myESP.mqttSubscribe(TOPIC_BOILER_CMD_COMFORT); + myESP.mqttSubscribe(TOPIC_BOILER_CMD_FLOWTEMP); + + myESP.mqttSubscribe(TOPIC_SHOWER_TIMER); + myESP.mqttSubscribe(TOPIC_SHOWER_ALERT); + myESP.mqttSubscribe(TOPIC_SHOWER_COLDSHOT); + // publish the status of the Shower parameters myESP.mqttPublish(TOPIC_SHOWER_TIMER, EMSESP_Status.shower_timer ? "1" : "0"); myESP.mqttPublish(TOPIC_SHOWER_ALERT, EMSESP_Status.shower_alert ? "1" : "0"); @@ -1597,7 +1599,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) { } // wwActivated - if (strcmp(topic, TOPIC_BOILER_WWACTIVATED) == 0) { + if (strcmp(topic, TOPIC_BOILER_CMD_WWACTIVATED) == 0) { if ((message[0] == '1' || strcmp(message, "on") == 0) || (strcmp(message, "auto") == 0)) { ems_setWarmWaterActivated(true); } else if (message[0] == '0' || strcmp(message, "off") == 0) { @@ -1678,13 +1680,13 @@ void WebCallback(JsonObject root) { if (ems_getBusConnected()) { if (ems_getTxDisabled()) { emsbus["ok"] = false; - emsbus["msg"] = "EMS Bus Connected, Rx active but Tx has been disabled (listen mode)"; + emsbus["msg"] = "EMS Bus Connected with Rx active but Tx has been disabled (in listen only mode)."; } else if (ems_getTxCapable()) { emsbus["ok"] = true; - emsbus["msg"] = "EMS Bus Connected, Rx and Tx active"; + emsbus["msg"] = "EMS Bus Connected with both Rx and Tx active."; } else { emsbus["ok"] = false; - emsbus["msg"] = "EMS Bus Connected, Tx is not working"; + emsbus["msg"] = "EMS Bus Connected but Tx is not working."; } } else { emsbus["ok"] = false; @@ -1760,8 +1762,14 @@ void WebCallback(JsonObject root) { if (EMS_Boiler.selFlowTemp != EMS_VALUE_INT_NOTSET) boiler["b3"] = EMS_Boiler.selFlowTemp; + if (EMS_Boiler.curFlowTemp != EMS_VALUE_INT_NOTSET) + boiler["b4"] = EMS_Boiler.curFlowTemp / 10; + if (EMS_Boiler.boilTemp != EMS_VALUE_USHORT_NOTSET) - boiler["b4"] = (double)EMS_Boiler.boilTemp / 10; + boiler["b5"] = (double)EMS_Boiler.boilTemp / 10; + + if (EMS_Boiler.retTemp != EMS_VALUE_USHORT_NOTSET) + boiler["b6"] = (double)EMS_Boiler.retTemp / 10; } else { boiler["ok"] = false; @@ -1888,7 +1896,7 @@ void setup() { myESP.setSettings(LoadSaveCallback, SetListCallback, false); // default is Serial off myESP.setWeb(WebCallback); // web custom settings myESP.setOTA(OTACallback_pre, OTACallback_post); // OTA callback which is called when OTA is starting and stopping - myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION, APP_HELPURL, APP_UPDATEURL); + myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION, APP_URL, APP_UPDATEURL); // at this point we have all the settings from our internall SPIFFS config file // fire up the UART now diff --git a/src/my_config.h b/src/my_config.h index dc5c1c877..74e86c134 100644 --- a/src/my_config.h +++ b/src/my_config.h @@ -15,9 +15,9 @@ #define TOPIC_THERMOSTAT_CMD_TEMP "thermostat_cmd_temp" // for received thermostat temp changes via MQTT #define TOPIC_THERMOSTAT_CMD_MODE "thermostat_cmd_mode" // for received thermostat mode changes via MQTT #define TOPIC_THERMOSTAT_CMD_HC "thermostat_cmd_hc" // for received thermostat hc number changes via MQTT -#define TOPIC_THERMOSTAT_CMD_DAYTEMP "thermostat_daytemp" // RC35 specific -#define TOPIC_THERMOSTAT_CMD_NIGHTTEMP "thermostat_nighttemp" // RC35 specific -#define TOPIC_THERMOSTAT_CMD_HOLIDAYTEMP "thermostat_holidayttemp" // RC35 specific +#define TOPIC_THERMOSTAT_CMD_DAYTEMP "thermostat_daytemp" // for received thermostat day temp (RC35 specific) +#define TOPIC_THERMOSTAT_CMD_NIGHTTEMP "thermostat_nighttemp" // for received thermostat night temp (RC35 specific) +#define TOPIC_THERMOSTAT_CMD_HOLIDAYTEMP "thermostat_holidayttemp" // for received thermostat holiday temp (RC35 specific) #define THERMOSTAT_CURRTEMP "thermostat_currtemp" // current temperature #define THERMOSTAT_SELTEMP "thermostat_seltemp" // selected temperature #define THERMOSTAT_HC "thermostat_hc" // which heating circuit number @@ -29,13 +29,13 @@ #define THERMOSTAT_CIRCUITCALCTEMP "thermostat_circuitcalctemp" // RC35 specific // MQTT for boiler -#define TOPIC_BOILER_DATA "boiler_data" // for sending boiler values to MQTT -#define TOPIC_BOILER_TAPWATER_ACTIVE "tapwater_active" // if hot tap water is running -#define TOPIC_BOILER_HEATING_ACTIVE "heating_active" // if heating is on -#define TOPIC_BOILER_WWACTIVATED "wwactivated" // for receiving MQTT message to change water on/off -#define TOPIC_BOILER_CMD_WWTEMP "boiler_cmd_wwtemp" // for received boiler wwtemp changes via MQTT -#define TOPIC_BOILER_CMD_COMFORT "boiler_cmd_comfort" // for received boiler ww comfort setting via MQTT -#define TOPIC_BOILER_CMD_FLOWTEMP "boiler_cmd_flowtemp" // for received boiler flowtemp value via MQTT +#define TOPIC_BOILER_DATA "boiler_data" // for sending boiler values to MQTT +#define TOPIC_BOILER_TAPWATER_ACTIVE "tapwater_active" // if hot tap water is running +#define TOPIC_BOILER_HEATING_ACTIVE "heating_active" // if heating is on +#define TOPIC_BOILER_CMD_WWACTIVATED "boiler_cmd_wwactivated" // for received message to change water on/off +#define TOPIC_BOILER_CMD_WWTEMP "boiler_cmd_wwtemp" // for received boiler wwtemp changes via MQTT +#define TOPIC_BOILER_CMD_COMFORT "boiler_cmd_comfort" // for received boiler ww comfort setting via MQTT +#define TOPIC_BOILER_CMD_FLOWTEMP "boiler_cmd_flowtemp" // for received boiler flowtemp value via MQTT // MQTT for SM10/SM100 Solar Module #define TOPIC_SM_DATA "sm_data" // topic name diff --git a/src/version.h b/src/version.h index e0e440f1a..75b19f8a1 100644 --- a/src/version.h +++ b/src/version.h @@ -2,5 +2,5 @@ #define APP_NAME "EMS-ESP" #define APP_VERSION "1.9.0b2_web" #define APP_HOSTNAME "ems-esp" -#define APP_HELPURL "https://github.com/proddy/EMS-ESP/wiki" +#define APP_URL "https://github.com/proddy/EMS-ESP" #define APP_UPDATEURL "https://api.github.com/repos/proddy/EMS-ESP/releases/latest" diff --git a/src/websrc/index.html b/src/websrc/index.html index 16e446175..d81d1ac0c 100644 --- a/src/websrc/index.html +++ b/src/websrc/index.html @@ -72,12 +72,28 @@ + +
+
+
+
+
+ + +
+
+
+
+ @@ -142,7 +158,7 @@
Warning! This action cannot be undone. This will permanently delete all - the settings and logs. Please make sure you've made a backup first.
+ the settings and logs. Please make sure you've made a backup before resetting!
- Warning! Please make sure you've made a backup first + Warning! Please make sure you've made a backup first before updating