diff --git a/Code/data/config.html b/Code/data/config.html
index 8190b24d..3361e2c6 100644
--- a/Code/data/config.html
+++ b/Code/data/config.html
@@ -140,6 +140,7 @@
+
@@ -290,12 +291,13 @@
Command queue
const setR = 21;
const resetrinsefiltertimer = 22;
const resetcleanfiltertimer = 23;
+const setpower = 24;
const commandlist = [
'Set target', 'Set unit', 'Set bubbles', 'Set heat', 'Set pump', 'Reset queue', 'Reboot ESP',
'Internal cmd', 'Reset times', 'Reset Cl timer', 'Reset change filter timer', 'Set jets', 'Set brightness',
'Beep', 'Set ambient temp F.', 'Set ambient temp C.', 'Reset daily meter', 'Take control', 'Full power',
- 'Print text', 'Set ready', 'Set R', 'Reset rinse filter timer', 'Reset clean filter timer'
+ 'Print text', 'Set ready', 'Set R', 'Reset rinse filter timer', 'Reset clean filter timer', 'Set power'
];
function totimestamp()
diff --git a/Code/data/mqtt.html b/Code/data/mqtt.html
index 23cea464..2b8bbe7f 100644
--- a/Code/data/mqtt.html
+++ b/Code/data/mqtt.html
@@ -46,34 +46,31 @@
|
- IP Address: |
+ MQTT host addr: |
-
- .
- .
- .
+
|
Port: |
- |
+ |
Username: |
- |
+ |
Password: |
- |
+ |
Client ID: |
- |
+ |
Base Topic: |
- |
+ |
Telemetry Interval (s): |
@@ -179,10 +176,10 @@
var json = JSON.parse(req.responseText);
console.log(json);
document.getElementById('enableMqtt').checked = json.enableMqtt;
- document.getElementById('mqttIpAddress1').value = json.mqttIpAddress[0];
- document.getElementById('mqttIpAddress2').value = json.mqttIpAddress[1];
- document.getElementById('mqttIpAddress3').value = json.mqttIpAddress[2];
- document.getElementById('mqttIpAddress4').value = json.mqttIpAddress[3];
+ document.getElementById('mqttHost').value = json.mqttHost;
+ // document.getElementById('mqttIpAddress2').value = json.mqttIpAddress[1];
+ // document.getElementById('mqttIpAddress3').value = json.mqttIpAddress[2];
+ // document.getElementById('mqttIpAddress4').value = json.mqttIpAddress[3];
document.getElementById('mqttPort').value = json.mqttPort;
document.getElementById('mqttUsername').value = json.mqttUsername;
document.getElementById('mqttPassword').value = json.mqttPassword;
@@ -203,12 +200,13 @@
req.open('POST', '/setmqtt/');
var json = {
'enableMqtt':(document.getElementById('enableMqtt').checked),
- 'mqttIpAddress':[
- parseInt(document.getElementById('mqttIpAddress1').value),
- parseInt(document.getElementById('mqttIpAddress2').value),
- parseInt(document.getElementById('mqttIpAddress3').value),
- parseInt(document.getElementById('mqttIpAddress4').value)
- ],
+ // 'mqttIpAddress':[
+ // parseInt(document.getElementById('mqttIpAddress1').value),
+ // parseInt(document.getElementById('mqttIpAddress2').value),
+ // parseInt(document.getElementById('mqttIpAddress3').value),
+ // parseInt(document.getElementById('mqttIpAddress4').value)
+ // ],
+ 'mqttHost':(document.getElementById('mqttHost').value),
'mqttPort':parseInt(document.getElementById('mqttPort').value),
'mqttUsername':(document.getElementById('mqttUsername').value),
'mqttPassword':(document.getElementById('mqttPassword').value),
diff --git a/Code/lib/BWC_unified/FW_VERSION.h b/Code/lib/BWC_unified/FW_VERSION.h
index db8781ed..2335b3d7 100644
--- a/Code/lib/BWC_unified/FW_VERSION.h
+++ b/Code/lib/BWC_unified/FW_VERSION.h
@@ -1 +1 @@
-#define FW_VERSION "2024-07-23-1743"
+#define FW_VERSION "2024-10-07-1913"
diff --git a/Code/lib/BWC_unified/bwc.cpp b/Code/lib/BWC_unified/bwc.cpp
index 62b6b737..4f8a2c26 100644
--- a/Code/lib/BWC_unified/bwc.cpp
+++ b/Code/lib/BWC_unified/bwc.cpp
@@ -445,8 +445,8 @@ void BWC::_handleCommandQ() {
bool BWC::_handlecommand(Commands cmd, int64_t val, const String& txt="")
{
bool restartESP = false;
-
- dsp->text += String(" ") + txt;
+
+ _format_text(txt);
switch (cmd)
{
case SETTARGET:
@@ -595,6 +595,10 @@ bool BWC::_handlecommand(Commands cmd, int64_t val, const String& txt="")
_vt_calibrated = true;
_save_settings_needed = true;
break;
+ case SETPOWER:
+ val = std::clamp((int)val, 0, 1);
+ cio->cio_toggles.power_change = (val != cio->cio_states.power);
+ break;
default:
break;
}
@@ -615,6 +619,63 @@ bool BWC::_handlecommand(Commands cmd, int64_t val, const String& txt="")
return false;
}
+void BWC::_format_text(const String &txt)
+{
+ dsp->text += ' ';
+
+ /* Check for special character '<>' surrounding variable field */
+ /* Example "T