diff --git a/WLAN_Thermometer.ino b/WLAN_Thermometer.ino index 4164e0e..7d09470 100644 --- a/WLAN_Thermometer.ino +++ b/WLAN_Thermometer.ino @@ -1,6 +1,6 @@ // Use from 0 to 4. Higher number, more debugging messages and memory usage. -#define _WIFIMGR_LOGLEVEL_ 1 -#define DEBUG 1 +#define _WIFIMGR_LOGLEVEL_ 0 +#define DEBUG 0 #include #include @@ -44,6 +44,7 @@ DHT dht(TEMP_SENS_PIN, DHTTYPE); const uint8_t degree_sign[8] = { B00010, B00101, B00010, B00000, B00000, B00000, B00000, B00000 }; uint8_t add_summertime = 0; bool last_reset_ap_check = false; +bool minmax_enabled = false; enum { ACT, @@ -68,7 +69,6 @@ void setup() lcd.setCursor(2, 1); lcd.print(F("(c)parasiTstudio")); - DEBUG_MSG("Mode Client\n"); WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP WiFiManager wm; @@ -186,47 +186,67 @@ void loop() client.println("\n"); client.println("\n"); client.println("\n"); - client.println("Temperatur KircheGratenstadt Staaken\n"); + client.println("Temperatur Kirche Gartenstadt Staaken\n"); client.println("\n"); client.println("\n"); client.println("\n"); client.println("
\n"); - client.println("

Temperatur Kirche

\n"); + client.println("

Temperatur

\n"); client.print("

Aktuell: "); client.print(temp[ACT]); client.println(" °C

\n"); client.print("

Minimum: "); if (millis() > FIRST_MIN_MAX) + { client.print(temp[MIN]); - client.println(" °C

\n"); + client.println(" °C"); + } + client.print("\n"); client.print("

Maximum: "); if (millis() > FIRST_MIN_MAX) + { client.print(temp[MAX]); + client.println(" °C"); + } + client.print("

\n"); + client.println("
\n"); + client.println("

Gefühlte Temperatur

\n"); + client.print("

Aktuell: "); + client.print(heat[ACT]); client.println(" °C

\n"); + client.print("

Minimum: "); + if (millis() > FIRST_MIN_MAX) + { + client.print(heat[MIN]); + client.println(" °C"); + } + client.print("

\n"); + client.print("

Maximum: "); + if (millis() > FIRST_MIN_MAX) + { + client.print(heat[MAX]); + client.println(" °C"); + } + client.print("

\n"); + client.println("
\n"); client.println("

Luftfeuchtigkeit

\n"); client.print("

Aktuell: "); client.print(hum[ACT]); client.println(" %

\n"); client.print("

Minimum: "); if (millis() > FIRST_MIN_MAX) + { client.print(hum[MIN]); - client.println(" %

\n"); + client.println(" %"); + } + client.println("\n"); client.print("

Maximum: "); if (millis() > FIRST_MIN_MAX) + { client.print(hum[MAX]); - client.println(" %

\n"); - client.println("

Gefühlte Temperatur

\n"); - client.print("

Aktuell: "); - client.print(heat[ACT]); - client.println(" °C

\n"); - client.print("

Minimum: "); - if (millis() > FIRST_MIN_MAX) - client.print(heat[MIN]); - client.println(" °C

\n"); - client.print("

Maximum: "); - if (millis() > FIRST_MIN_MAX) - client.print(heat[MAX]); - client.println(" °C

\n"); + client.println(" %"); + } + client.println("\n"); DateTimeParts p = DateTime.getParts(); char dt[21]; @@ -236,6 +256,7 @@ void loop() else add_summertime = 0; + client.println("
\n"); client.print("

"); sprintf(dt, "%02d.%02d.%4d %02d:%02d:%02d", p.getMonthDay(), p.getMonth() + 1, p.getYear(), p.getHours() + add_summertime, p.getMinutes(), p.getSeconds()); @@ -321,7 +342,7 @@ void show_time(void) } sprintf(dt, "%02d.%02d.%4d %02d:%02d:%02d", p.getMonthDay(), p.getMonth() + 1, p.getYear(), p.getHours() + add_summertime, p.getMinutes(), p.getSeconds()); - DEBUG_MSG("%d", dt); + DEBUG_MSG("%s", dt); if (add_summertime > 0) DEBUG_MSG(" Summertime\n"); else @@ -346,13 +367,14 @@ void show_temperature(void) lcd.print(temp[ACT], 1); lcd.write(0); lcd.print("C"); - lcd.setCursor(0, 2); - lcd.print("Min: "); if (millis() > FIRST_MIN_MAX) + { + lcd.setCursor(0, 2); + lcd.print("Min: "); lcd.print(temp[MIN], 1); - lcd.print(" Max: "); - if (millis() > FIRST_MIN_MAX) + lcd.print(" Max: "); lcd.print(temp[MAX], 1); + } lcd.setCursor(0, 3); lcd.print("LF: "); lcd.print(hum[ACT], 1); @@ -404,7 +426,10 @@ void get_sensor_data(void) hum[ACT] = constrain(dht.readHumidity(), 0.0, 100.0); heat[ACT] = constrain(dht.computeHeatIndex(temp[ACT], hum[ACT], false), -40.0, 80.0); - if (millis() > FIRST_MIN_MAX) + if (minmax_enabled == false && millis() > FIRST_MIN_MAX) + minmax_enabled = true; + + if (minmax_enabled == true) { if (temp[ACT] < temp[MIN]) temp[MIN] = temp[ACT];