DeltaLima 2024-12-11 00:30:06 +01:00
parent ebfd33af0c
commit 3ce946b380
4 changed files with 63 additions and 2 deletions

View file

@ -273,6 +273,9 @@ void loop() {
// refresh all sensor values
refreshSensors();
// calculate VPD - https://www.grower.ch/forum/threads/diy-grow-controller-cangrow-projektvorstellung.163654/page-4#post-4294197
valVPD = (((100 - valHumidity) / 100) * (610.7 * (pow(10, (7.5 * valTemperature / (237.3 + valTemperature))))))/1000;
// calculate acutal DayOfGrow
DayOfGrow = int(ceil(float((timeClient.getEpochTime() - GrowStart) / 60 / 60 / 24)));
// decide if we are in Veg or Bloom phase of grow

View file

@ -186,6 +186,24 @@ input[type=text], input[type=date], input[type=number], input[type=password], se
margin-bottom: 3px;
}
}
/* VPD colors */
.vpd_danger1 {
color: #1a6c9c;
}
.vpd_earlyveg {
color: #22ab9c;
}
.vpd_lateveg {
color: #9cc55b;
}
.vpd_latebloom {
color: #9cc55b;
}
.vpd_danger2 {
color: #1a6c9c;
}
</style>
</head>
<body>

View file

@ -34,6 +34,10 @@ byte ScreenToDisplay = 0;
// how many seconds actual screen got displayed
byte ScreenIterationPassed = 0;
// VPD value - https://www.grower.ch/forum/threads/diy-grow-controller-cangrow-projektvorstellung.163654/page-4#post-4294197
float valVPD;
bool MaintenanceMode = false;
unsigned long MaintenanceStarted = 0;

View file

@ -401,7 +401,39 @@ void WEBroot() {
body += "<b>Growlight brightness:</b> ";
body += ((PinLEDPWM * 100) / 255);
body += " %<br>\n";
// VPD
body += "<b>VPD (est.): <span class='";
// apply text color to the value according to this chart
if(valVPD < 0) {
body += "'>";
body += valVPD;
body += "</span></b> (Danger - check for disease!)";
} else if(valVPD < 0.4 ) {
body += "vpd_danger1'>";
body += valVPD;
body += "</span></b> (Danger - under transpiration!)";
} else if(valVPD < 0.8 ) {
body += "vpd_earlyveg'>";
body += valVPD;
body += "</span></b> (Early vegetation)";
} else if(valVPD < 1.2 ) {
body += "vpd_lateveg'>";
body += valVPD;
body += "</span></b> (Late vegetation)";
} else if(valVPD < 1.6 ) {
body += "vpd_latebloom'>";
body += valVPD;
body += "</span></b> (Late bloom)";
} else if(valVPD > 1.6 ) {
body += "vpd_danger2'>";
body += valVPD;
body += "</span></b> (Danger - over transpiration!)";
}
body += "<br>\n";
//~ body += "<form method='post' action='/switch'>\n";
//~ body += "<b>MOSFET:</b> <select id='output' name='output' >\n";
//~ body += "<option disabled value='' selected hidden>---</option>\n";
@ -420,7 +452,7 @@ void WEBroot() {
//~ body += "<input type='submit' value='Save'>\n";
//~ body += "</form><br>\n";
body += "<a class='button' href='/system/maintenance'>&#x1f9f0; Maintenance</a>";
body += "<br><a class='button' href='/system/maintenance'>&#x1f9f0; Maintenance</a>";
body += FPSTR(HTMLfooter);
@ -1175,6 +1207,7 @@ void APIgetSensors() {
jsonSensors["temperature"] = valTemperature;
jsonSensors["humidity"] = valHumidity;
jsonSensors["waterlevel"] = valWaterlevel;
jsonSensors["vpd"] = valVPD;
String body;
serializeJsonPretty(jsonSensors, body);
@ -1193,6 +1226,7 @@ void APIgetDebug() {
objRuntime["valSoilmoistureAvg"] = valSoilmoistureAvg;
objRuntime["valSoilmoistureAvg_tmp"] = valSoilmoistureAvg_tmp;
objRuntime["valSoilmoistureAvg_count"] = valSoilmoistureAvg_count;
objRuntime["valVPD"] = valVPD;
// WiFi
JsonObject objWiFi = jsonDebug["wifi"].add<JsonObject>();
@ -1223,6 +1257,7 @@ void APIgetDebug() {
objSystem["HumiditySensor_Type"] = HumiditySensor_Type;
objSystem["PWMFrequency"] = PWMFrequency;
objSystem["DisplayScreenDuration"] = DisplayScreenDuration;
objSystem["Esp32CamIP"] = Esp32CamIP;
// Grow
JsonObject objGrow = jsonDebug["grow"].add<JsonObject>();
@ -1239,10 +1274,11 @@ void APIgetDebug() {
objGrow["SunFadeDuration"] = SunFadeDuration;
objGrow["PinLEDPWM"] = PinLEDPWM;
objGrow["PinFANPWM"] = PinFANPWM;
objGrow["PinFAN2PWM"] = PinFAN2PWM;
objGrow["DayOfGrow"] = DayOfGrow;
objGrow["PumpIntervalVeg"] = PumpIntervalVeg;
objGrow["PumpIntervalBloom"] = PumpIntervalBloom;
objSystem["PinFAN2PWM"] = PinFAN2PWM;