firmware - webui changes, move pump settings to grow settings, add debug json

This commit is contained in:
DeltaLima 2024-12-11 22:59:25 +01:00
parent a4c0d060e1
commit d0ea1588b5
5 changed files with 140 additions and 84 deletions

View file

@ -6,7 +6,7 @@
// set CANGROW_VER and CANGROW_BUILD if not already done as Compiler Flag // set CANGROW_VER and CANGROW_BUILD if not already done as Compiler Flag
#ifndef CANGROW_VER #ifndef CANGROW_VER
#define CANGROW_VER "v0.0.0-dev" #define CANGROW_VER "0.0.0-dev"
#endif #endif
#ifndef CANGROW_BUILD #ifndef CANGROW_BUILD
#define CANGROW_BUILD "1a2b3c4-0000000000000" #define CANGROW_BUILD "1a2b3c4-0000000000000"

View file

@ -20,12 +20,20 @@ const bool APhidden = false;
// valSoilmoisture - contains the value of getSoilmoisture() // valSoilmoisture - contains the value of getSoilmoisture()
unsigned short valSoilmoisture; unsigned short valSoilmoisture;
// helper variable for pump control with soilmoisture
// average of last readings
unsigned short valSoilmoistureAvg = 0;
unsigned short valSoilmoistureAvg_tmp = 0;
byte valSoilmoistureAvg_count = 0;
short valSoilmoistureRaw;
// valTemperature - contains the value of getTemperature() // valTemperature - contains the value of getTemperature()
float valTemperature; float valTemperature;
// valTemperature - contains the value of getHumidity() // valTemperature - contains the value of getHumidity()
float valHumidity; float valHumidity;
// valWaterlevel - contains the value of getWaterlevel() // valWaterlevel - contains the value of getWaterlevel()
byte valWaterlevel; byte valWaterlevel;
// do we need a restart? (e.g. after wifi settings change) // do we need a restart? (e.g. after wifi settings change)
bool NeedRestart; bool NeedRestart;
bool FirstRun; bool FirstRun;
@ -49,12 +57,7 @@ unsigned long MaintenanceStarted = 0;
byte PumpOnTimePassed = 0; byte PumpOnTimePassed = 0;
bool PumpOnManual = false; bool PumpOnManual = false;
// helper variable for pump control with soilmoisture
// average of last readings
unsigned short valSoilmoistureAvg = 0;
unsigned short valSoilmoistureAvg_tmp = 0;
byte valSoilmoistureAvg_count = 0;
//unsigned short
/* /*
* millis timer * millis timer

View file

@ -203,7 +203,7 @@ int getSoilmoisture(byte moistureSensor, bool returnRAW = false) {
digitalWrite(PINsoilmoisture, HIGH); digitalWrite(PINsoilmoisture, HIGH);
// wait a bit to let the circuit stabilize // wait a bit to let the circuit stabilize
delay(50); //delay(50);
// get analog input value // get analog input value
// get values 10 times and get the middle for more precise data // get values 10 times and get the middle for more precise data

View file

@ -567,6 +567,7 @@ void refreshSensors() {
byte soilmoistureAvgSampleCount = 5; byte soilmoistureAvgSampleCount = 5;
valSoilmoisture = getSoilmoisture(MoistureSensor_Type); valSoilmoisture = getSoilmoisture(MoistureSensor_Type);
valSoilmoistureRaw = getSoilmoisture(MoistureSensor_Type, true);
valHumidity = getHumidity(HumiditySensor_Type); valHumidity = getHumidity(HumiditySensor_Type);
valTemperature = getTemperature(TemperatureSensor_Type); valTemperature = getTemperature(TemperatureSensor_Type);
valWaterlevel = getWaterlevel(); valWaterlevel = getWaterlevel();

View file

@ -210,15 +210,26 @@ void Syslogout() {
void SysMaintenance() { void SysMaintenance() {
String body = returnHTMLheader(); String body = returnHTMLheader();
// when requesting to handle Dimming
if( (webserver.hasArg("DimmOn")) || (webserver.hasArg("DimmOff")) ) {
// check first if PWM is disabled / relais is used
if(UseLEDrelais == true) {
// if not, do it
if( (webserver.hasArg("DimmOn")) ) { if( (webserver.hasArg("DimmOn")) ) {
MaintenanceMode = true; MaintenanceMode = true;
MaintenanceStarted = millis(); MaintenanceStarted = millis();
body += "<div class='infomsg'>&#9208;&#65039; Dimm LED On for "; body += "<div class='infomsg'>&#x26C5; Dimm LED On for ";
body += MaintenanceDuration; body += MaintenanceDuration;
body += "s</div>"; body += "s</div>";
} else if (webserver.hasArg("DimmOff")){ } else if( (webserver.hasArg("DimmOff")) ) {
MaintenanceMode = false; MaintenanceMode = false;
body += "<div class='infomsg'>&#9208;&#65039; Dimm LED Off</div>"; body += "<div class='infomsg'>&#x26C5; Dimm LED Off</div>";
}
} else {
// otherwise nice error
body += "<div class='warnmsg'>&#x26C5; LED setting <pre>Use relais for LED (disable PWM)<pre> is set to <b>Yes</b> in &#128262; Grow settings</div>";
}
} else if(webserver.hasArg("PumpOnManual")) { } else if(webserver.hasArg("PumpOnManual")) {
if(UsePump == true) { if(UsePump == true) {
PumpOnManual = true; PumpOnManual = true;
@ -226,15 +237,15 @@ void SysMaintenance() {
body += PumpOnTime; body += PumpOnTime;
body += "s</div>"; body += "s</div>";
} else { } else {
body += "<div class='warnmsg'>&#x1F4A7; Pump mode is set to <b>Off</b> in &#9881; System settings</div>"; body += "<div class='warnmsg'>&#x1F4A7; Pump mode is set to <b>Off</b> in &#128262; Grow settings</div>";
} }
} }
body += "<h2>&#x1f9f0; Maintenance</h2>"; body += "<h2>&#x1f9f0; Maintenance</h2>";
body += "Dimm LED <a class='button' href='/system/maintenance?DimmOn=1'>On</a>&nbsp;&nbsp;<a class='button' href='/system/maintenance?DimmOff=1'>Off</a><br><br><br>"; body += "Dimm LED <a class='button' href='/system/maintenance?DimmOn=1'>&#x26C5; On</a>&nbsp;&nbsp;<a class='button' href='/system/maintenance?DimmOff=1'>&#x2600;&#xfe0f; Off</a><br><br><br>";
body += "Pump manual <a class='button' href='/system/maintenance?PumpOnManual=1'>Activate for "; body += "Pump manual <a class='button' href='/system/maintenance?PumpOnManual=1'>&#x1F4A7; Activate for ";
body += PumpOnTime; body += PumpOnTime;
body += "s</a><br>"; body += "s</a><br>";
@ -523,26 +534,24 @@ void WEBgrowSettings() {
body += "<b>Grow duration</b><br>";
body += "Vegetation duration: <input class='inputShort' type='number' name='DaysVeg' min='0' max='255' value='"; body += "Vegetation duration: <input class='inputShort' type='number' name='DaysVeg' min='0' max='255' value='";
body += DaysVeg; body += DaysVeg;
body+= "' required> days<br>\n"; body+= "' required> Days<br>\n";
body += "Bloom duration: <input class='inputShort' type='number' name='DaysBloom' min='0' max='255' value='"; body += "Bloom duration: <input class='inputShort' type='number' name='DaysBloom' min='0' max='255' value='";
body += DaysBloom; body += DaysBloom;
body+= "' required> days<br><br>\n"; body+= "' required> Days<br><br>\n";
body += "<b>Light configuration</b><br>";
body += "Time LED ON vegetation: <input class='inputShort' type='number' name='LighthoursVeg' min='0' max='255' value='"; body += "LED ON vegetation: <input class='inputShort' type='number' name='LighthoursVeg' min='0' max='255' value='";
body += LighthoursVeg; body += LighthoursVeg;
body+= "' required> hours<br>\n"; body+= "' required> Hours<br>\n";
body += "Time LED ON bloom: <input class='inputShort' type='number' name='LighthoursBloom' min='0' max='255' value='"; body += "LED ON bloom: <input class='inputShort' type='number' name='LighthoursBloom' min='0' max='255' value='";
body += LighthoursBloom; body += LighthoursBloom;
body+= "' required> hours<br><br>\n"; body+= "' required> Hours<br>\n";
body += "Sunrise: <input class='inputShort' type='number' name='SunriseHour' min='0' max='23' value='"; body += "Sunrise: <input class='inputShort' type='number' name='SunriseHour' min='0' max='23' value='";
body += SunriseHour; body += SunriseHour;
@ -559,7 +568,7 @@ void WEBgrowSettings() {
body += "Fade duration: <input class='inputShort' type='number' name='SunFadeDuration' min='1' max='255' value='"; body += "Fade duration: <input class='inputShort' type='number' name='SunFadeDuration' min='1' max='255' value='";
body += SunFadeDuration; body += SunFadeDuration;
body+= "' required> Minutes<br><br>\n"; body+= "' required> Minutes<br>\n";
if(UseLEDrelais == false) { if(UseLEDrelais == false) {
body += "LED brightness: <input type='range' id='PinLEDPWM' name='PinLEDPWM' min='0' max='255' value='"; body += "LED brightness: <input type='range' id='PinLEDPWM' name='PinLEDPWM' min='0' max='255' value='";
@ -571,7 +580,9 @@ void WEBgrowSettings() {
body += "<option value='0'" + returnStrSelected(PinLEDPWM, 0) + ">Off</option>\n"; body += "<option value='0'" + returnStrSelected(PinLEDPWM, 0) + ">Off</option>\n";
body += "</select><br>\n"; body += "</select><br>\n";
} }
body += "<br>";
body += "<b>Fan configuration</b><br>";
if(UseFANrelais == false) { if(UseFANrelais == false) {
body += "FAN1 speed: <input type='range' id='PinFANPWM' name='PinFANPWM' min='0' max='255' value='"; body += "FAN1 speed: <input type='range' id='PinFANPWM' name='PinFANPWM' min='0' max='255' value='";
body += PinFANPWM; body += PinFANPWM;
@ -588,17 +599,52 @@ void WEBgrowSettings() {
body += "'/> %<br><br>\n"; body += "'/> %<br><br>\n";
body += "<b>Pump configuration</b><br>";
// PumpMode byte
body += "Pump mode: <select id='UsePump' name='UsePump' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='0'" + returnStrSelected(UsePump, 0) + ">Off</option>\n";
body += "<option value='1'" + returnStrSelected(UsePump, 1) + ">1</option>\n";
body += "<option value='2'" + returnStrSelected(UsePump, 2) + ">2</option>\n";
body += "<option value='3'" + returnStrSelected(UsePump, 3) + ">3</option>\n";
body += "</select><br><p class='helpbox'><b>1:</b> Water every few days.<br> \
<b>2:</b> Water if the soil moisture falls below <i>Soilmoisture low</i> value<br> \
<b>3:</b> Water every few days if the soil moisture falls below <i>Soilmoisture low</i> value.</p>\n";
// TODO ugly. can this done be better?
// PumpOnTime int
body += "Pump ON time: <input class='inputShort' type='number' name='PumpOnTime' min='0' max='255' value='";
body += PumpOnTime;
body += "' required> Seconds<br>\n";
// SoilmoistureLow byte
body += "Soilmoisture low: <input class='inputShort' type='number' name='SoilmoistureLow' min='0' value='";
body += SoilmoistureLow;
body += "' required> %<br>\n";
body += "Pump interval vegetation: every <input class='inputShort' type='number' name='PumpIntervalVeg' min='0' max='255' value='"; body += "Pump interval vegetation: every <input class='inputShort' type='number' name='PumpIntervalVeg' min='0' max='255' value='";
body += PumpIntervalVeg; body += PumpIntervalVeg;
body += "' required "; body += "' required> Days<br>\n";
if( (UsePump != 1) && UsePump != 3) { body += "readonly"; }
body += "> days<br>\n";
body += "Pump interval bloom: every <input class='inputShort' type='number' name='PumpIntervalBloom' min='0' max='255' value='"; body += "Pump interval bloom: every <input class='inputShort' type='number' name='PumpIntervalBloom' min='0' max='255' value='";
body += PumpIntervalBloom; body += PumpIntervalBloom;
body += "' required "; body += "' required> Days<br><br>\n";
if((UsePump != 1) && (UsePump != 3)) { body += "readonly"; }
body += "> days<br>\n";
body += "<input type='submit' value='&#x1F4BE; Save settings'>\n"; body += "<input type='submit' value='&#x1F4BE; Save settings'>\n";
@ -657,23 +703,23 @@ void WEBsystemSettings() {
// OutputInvert bool // OutputInvert bool
body += "Invert Outputs: <select id='OutputInvert' name='OutputInvert' required>\n"; body += "Invert Outputs: <select id='OutputInvert' name='OutputInvert' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";} if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='1'" + returnStrSelected(OutputInvert, 1) + ">Yes</option>\n";
body += "<option value='0'" + returnStrSelected(OutputInvert, 0) + ">No</option>\n"; body += "<option value='0'" + returnStrSelected(OutputInvert, 0) + ">No</option>\n";
body += "<option value='1'" + returnStrSelected(OutputInvert, 1) + ">Yes</option>\n";
body += "</select><br>\n"; body += "</select><br>\n";
body += "<p class='helpbox'>When using CanGrow PCB v0.6, set to <b>Yes</b></p>\n"; body += "<p class='helpbox'>When using CanGrow PCB v0.6, set to <b>Yes</b></p>\n";
// UseLEDrelais bool // UseLEDrelais bool
body += "Use relais for LED (disable PWM): <select id='UseLEDrelais' name='UseLEDrelais' required>\n"; body += "Use relais for LED (disable PWM): <select id='UseLEDrelais' name='UseLEDrelais' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";} if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='1'" + returnStrSelected(UseLEDrelais, 1) + ">Yes</option>\n";
body += "<option value='0'" + returnStrSelected(UseLEDrelais, 0) + ">No</option>\n"; body += "<option value='0'" + returnStrSelected(UseLEDrelais, 0) + ">No</option>\n";
body += "<option value='1'" + returnStrSelected(UseLEDrelais, 1) + ">Yes</option>\n";
body += "</select><br>\n"; body += "</select><br>\n";
// UseFANrelais bool // UseFANrelais bool
body += "Use relais for FAN1 (disable PWM): <select id='UseFANrelais' name='UseFANrelais' required>\n"; body += "Use relais for FAN1 (disable PWM): <select id='UseFANrelais' name='UseFANrelais' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";} if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='1'" + returnStrSelected(UseFANrelais, 1) + ">Yes</option>\n";
body += "<option value='0'" + returnStrSelected(UseFANrelais, 0) + ">No</option>\n"; body += "<option value='0'" + returnStrSelected(UseFANrelais, 0) + ">No</option>\n";
body += "<option value='1'" + returnStrSelected(UseFANrelais, 1) + ">Yes</option>\n";
body += "</select><br><br>\n"; body += "</select><br><br>\n";
@ -732,36 +778,11 @@ void WEBsystemSettings() {
body += "</select><br><br>\n"; body += "</select><br><br>\n";
body += "<b>Pump configuration</b><br>";
// PumpMode byte
body += "Pump mode: <select id='UsePump' name='UsePump' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='0'" + returnStrSelected(UsePump, 0) + ">Off</option>\n";
body += "<option value='1'" + returnStrSelected(UsePump, 1) + ">1</option>\n";
body += "<option value='2'" + returnStrSelected(UsePump, 2) + ">2</option>\n";
body += "<option value='3'" + returnStrSelected(UsePump, 3) + ">3</option>\n";
body += "</select><br><p class='helpbox'><b>1:</b> Water every few days.<br> \
<b>2:</b> Water if the soil moisture falls below <i>Soilmoisture low</i> value<br> \
<b>3:</b> Water every few days if the soil moisture falls below <i>Soilmoisture low</i> value.</p>\n";
// TODO ugly. can this done be better?
// PumpOnTime int
body += "Pump ON time: <input class='inputShort' type='number' name='PumpOnTime' min='0' max='255' value='";
body += PumpOnTime;
body += "' required> Seconds<br>\n";
// SoilmoistureLow byte
body += "Soilmoisture low: <input class='inputShort' type='number' name='SoilmoistureLow' min='0' value='";
body += SoilmoistureLow;
body += "' required> %<br><br>\n";
body += "<b>General configuration</b><br>"; body += "<b>General configuration</b><br>";
// NtpOffset int // NtpOffset int
body += "NTP offset: <input class='inputShort' type='number' name='NtpOffset' min='-12' max='14' value='"; body += "NTP offset/UTC timezone: <input class='inputShort' type='number' name='NtpOffset' min='-12' max='14' value='";
body += NtpOffset; body += NtpOffset;
body+= "' required> Hours<br>\n"; body+= "' required> Hours<br>\n";
@ -782,7 +803,7 @@ void WEBsystemSettings() {
body += "ESP32-Cam IP (optional): <input type='text' name='Esp32CamIP' maxlength='16' value='"; body += "ESP32-Cam IP (optional): <input type='text' name='Esp32CamIP' maxlength='16' value='";
body += Esp32CamIP; body += Esp32CamIP;
body += "' ><br>\n"; body += "' ><br><br>\n";
body += "<input type='submit' value='&#x1F4BE; Save settings'>\n"; body += "<input type='submit' value='&#x1F4BE; Save settings'>\n";
@ -851,7 +872,7 @@ void WEBwifiSettings() {
body += "IP: <input type='text' name='WIFIip'><br>\n"; body += "IP: <input type='text' name='WIFIip'><br>\n";
body += "Subnet mask: <input type='text' name='WIFInetmask'><br>\n"; body += "Subnet mask: <input type='text' name='WIFInetmask'><br>\n";
body += "Gateway: <input type='text' name='WIFIgateway'><br>\n"; body += "Gateway: <input type='text' name='WIFIgateway'><br>\n";
body += "DNS: <input type='text' name='WIFIdns'><br>\n"; body += "DNS: <input type='text' name='WIFIdns'><br><br>\n";
body += "<input type='submit' value='&#x1F4BE; Save settings'>\n"; body += "<input type='submit' value='&#x1F4BE; Save settings'>\n";
body += "</form>\n"; body += "</form>\n";
body += FPSTR(HTMLfooter); body += FPSTR(HTMLfooter);
@ -891,6 +912,11 @@ void POSTgrowSettings() {
SunriseMinute = webserver.arg("SunriseMinute").toInt(); SunriseMinute = webserver.arg("SunriseMinute").toInt();
SunFade = webserver.arg("SunFade").toInt(); SunFade = webserver.arg("SunFade").toInt();
SunFadeDuration = webserver.arg("SunFadeDuration").toInt(); SunFadeDuration = webserver.arg("SunFadeDuration").toInt();
UsePump = webserver.arg("UsePump").toInt();
PumpOnTime = webserver.arg("PumpOnTime").toInt();
SoilmoistureLow = webserver.arg("SoilmoistureLow").toInt();
PumpIntervalVeg = webserver.arg("PumpIntervalVeg").toInt(); PumpIntervalVeg = webserver.arg("PumpIntervalVeg").toInt();
PumpIntervalBloom = webserver.arg("PumpIntervalBloom").toInt(); PumpIntervalBloom = webserver.arg("PumpIntervalBloom").toInt();
@ -918,6 +944,15 @@ void POSTgrowSettings() {
EEPROM.put(248, PinFAN2PWM); EEPROM.put(248, PinFAN2PWM);
EEPROM.put(217, SunFade); EEPROM.put(217, SunFade);
EEPROM.put(218, SunFadeDuration); EEPROM.put(218, SunFadeDuration);
// size is 1 byte
EEPROM.put(163, UsePump);
// size is 1 byte
EEPROM.put(164, PumpOnTime);
// size is 1 byte
EEPROM.put(166, SoilmoistureLow);
// size is 1 byte // size is 1 byte
EEPROM.put(241, PumpIntervalVeg); EEPROM.put(241, PumpIntervalVeg);
// size is 1 byte // size is 1 byte
@ -955,6 +990,20 @@ void POSTgrowSettings() {
Serial.print("PinFAN2PWM: "); Serial.print("PinFAN2PWM: ");
Serial.println(PinFAN2PWM); Serial.println(PinFAN2PWM);
Serial.print("UsePump: ");
Serial.println(UsePump);
Serial.print("PumpOnTime: ");
Serial.println(PumpOnTime);
Serial.print("SoilmoistureLow: ");
Serial.println(SoilmoistureLow);
Serial.print("PumpIntervalVeg: ");
Serial.println(PumpIntervalVeg);
Serial.print("PumpIntervalBloom: ");
Serial.println(PumpIntervalBloom);
webserver.sendHeader("Location", String("/growSettings?success"), true); webserver.sendHeader("Location", String("/growSettings?success"), true);
webserver.send(302, "text/plain", "growSettings/save: success!\n"); webserver.send(302, "text/plain", "growSettings/save: success!\n");
} }
@ -968,9 +1017,8 @@ void POSTsystemSettings() {
NtpOffset = webserver.arg("NtpOffset").toInt(); NtpOffset = webserver.arg("NtpOffset").toInt();
MoistureSensor_Type = webserver.arg("MoistureSensor_Type").toInt(); MoistureSensor_Type = webserver.arg("MoistureSensor_Type").toInt();
SoilmoistureLow = webserver.arg("SoilmoistureLow").toInt();
UsePump = webserver.arg("UsePump").toInt();
PumpOnTime = webserver.arg("PumpOnTime").toInt();
UseFan = webserver.arg("UseFan").toInt(); UseFan = webserver.arg("UseFan").toInt();
UseLEDrelais = webserver.arg("UseLEDrelais").toInt(); UseLEDrelais = webserver.arg("UseLEDrelais").toInt();
UseFANrelais = webserver.arg("UseFANrelais").toInt(); UseFANrelais = webserver.arg("UseFANrelais").toInt();
@ -997,14 +1045,10 @@ void POSTsystemSettings() {
EEPROM.put(161, configured); EEPROM.put(161, configured);
// size is 1 byte // size is 1 byte
EEPROM.put(162, UseFan); EEPROM.put(162, UseFan);
// size is 1 byte
EEPROM.put(163, UsePump);
// size is 1 byte
EEPROM.put(164, PumpOnTime);
// size is 1 byte // size is 1 byte
EEPROM.put(165, MoistureSensor_Type); EEPROM.put(165, MoistureSensor_Type);
// size is 1 byte
EEPROM.put(166, SoilmoistureLow);
// size is 2 byte // size is 2 byte
EEPROM.put(167, NtpOffset); EEPROM.put(167, NtpOffset);
// size is 1 byte // size is 1 byte
@ -1058,14 +1102,10 @@ void POSTsystemSettings() {
Serial.println(configured); Serial.println(configured);
Serial.print("UseFan: "); Serial.print("UseFan: ");
Serial.println(UseFan); Serial.println(UseFan);
Serial.print("UsePump: ");
Serial.println(UsePump);
Serial.print("PumpOnTime: ");
Serial.println(PumpOnTime);
Serial.print("MoistureSensor_Type: "); Serial.print("MoistureSensor_Type: ");
Serial.println(MoistureSensor_Type); Serial.println(MoistureSensor_Type);
Serial.print("SoilmoistureLow: ");
Serial.println(SoilmoistureLow);
Serial.print("NtpOffset: "); Serial.print("NtpOffset: ");
Serial.println(NtpOffset); Serial.println(NtpOffset);
Serial.print("UseLEDrelais: "); Serial.print("UseLEDrelais: ");
@ -1213,6 +1253,7 @@ void APIgetSensors() {
jsonSensors["soilmoisture"] = valSoilmoisture; jsonSensors["soilmoisture"] = valSoilmoisture;
jsonSensors["soilmoistureAvg"] = valSoilmoistureAvg; jsonSensors["soilmoistureAvg"] = valSoilmoistureAvg;
jsonSensors["soilmoistureRaw"] = valSoilmoistureRaw;
jsonSensors["temperature"] = valTemperature; jsonSensors["temperature"] = valTemperature;
jsonSensors["humidity"] = valHumidity; jsonSensors["humidity"] = valHumidity;
jsonSensors["waterlevel"] = valWaterlevel; jsonSensors["waterlevel"] = valWaterlevel;
@ -1232,10 +1273,21 @@ void APIgetDebug() {
JsonObject objRuntime = jsonDebug["runtime"].add<JsonObject>(); JsonObject objRuntime = jsonDebug["runtime"].add<JsonObject>();
objRuntime["PumpOnTimePassed"] = PumpOnTimePassed; objRuntime["PumpOnTimePassed"] = PumpOnTimePassed;
objRuntime["PumpOnManual"] = PumpOnManual; objRuntime["PumpOnManual"] = PumpOnManual;
objRuntime["valTemperature"] = valTemperature;
objRuntime["valHumidity"] = valHumidity;
objRuntime["valSoilmoisture"] = valSoilmoisture;
objRuntime["valSoilmoistureRaw"] = valSoilmoistureRaw;
objRuntime["valSoilmoistureAvg"] = valSoilmoistureAvg; objRuntime["valSoilmoistureAvg"] = valSoilmoistureAvg;
objRuntime["valSoilmoistureAvg_tmp"] = valSoilmoistureAvg_tmp; objRuntime["valSoilmoistureAvg_tmp"] = valSoilmoistureAvg_tmp;
objRuntime["valSoilmoistureAvg_count"] = valSoilmoistureAvg_count; objRuntime["valSoilmoistureAvg_count"] = valSoilmoistureAvg_count;
objRuntime["valVPD"] = valVPD; objRuntime["NeedRestart"] = NeedRestart;
objRuntime["FirstRun"] = FirstRun;
objRuntime["ScreenToDisplay"] = ScreenToDisplay;
objRuntime["ScreenIterationPassed"] = ScreenIterationPassed;
objRuntime["DayNight"] = DayNight;
objRuntime["MaintenanceMode"] = MaintenanceMode;
objRuntime["MaintenanceStarted"] = MaintenanceStarted;
// WiFi // WiFi
JsonObject objWiFi = jsonDebug["wifi"].add<JsonObject>(); JsonObject objWiFi = jsonDebug["wifi"].add<JsonObject>();