feature/InfluxDB-Connection-Update #1

Merged
klaute merged 39 commits from feature/InfluxDB-Connection-Update into master 2022-05-23 17:36:59 +02:00
2 changed files with 25 additions and 12 deletions
Showing only changes of commit 676a67c3c0 - Show all commits

View file

@ -19,8 +19,8 @@
#define WIFI_AUTOCONNECT_TIMEOUT_S 120
#define WIFI_CONFIG_PORTAL_TIMEOUT_S 120
#define UPDATE_SENSOR_INTERVAL_S 300
#define UPDATE_WEBSERVER_INTVERVAL_S 1
#define DELAY_LOOP_MS 60
#define UPDATE_WEBSERVER_INTVERVAL_S 1 // Do not change, bigger values will prevent using the webinterface
#define DELAY_LOOP_MS 50
#define POWERSAVING_SLEEP_S 600
#define EMERGENCY_SLEEP_S 172800 // Sleep for 2 days to recover
#define ENERGY_SAVING_ITERATIONS 30

View file

@ -83,16 +83,29 @@ void showHTMLMain(void)
void hb_webstat_send(void)
{
httpServer.send(200, "text/html", hb_ws_msg_start +
unsigned int timestamp = 0;
for (int i = 0; i < VALUES; i++)
{
timestamp += int(_webUpdater_sensValues[i]) + millis();
}
String msg = hb_ws_msg_start +
hb_ws_msg_temp +
String(_webUpdater_sensValues[SENSOR_TEMPERATURE], 2) + ", " +
String(_webUpdater_sensValues[SENSOR_TEMPERATURE], 2) +
", " +
hb_ws_msg_humi +
String(int(_webUpdater_sensValues[SENSOR_HUMIDITY]), 2) + ", " +
String(_webUpdater_sensValues[SENSOR_HUMIDITY], 2) +
", " +
hb_ws_msg_light +
String(int(_webUpdater_sensValues[SENSOR_LIGHT]), 2) + ", " +
String(_webUpdater_sensValues[SENSOR_LIGHT], 2) +
", " +
hb_ws_msg_windspeed +
String(_webUpdater_sensValues[SENSOR_WINDSPEED], 2) +
hb_ws_msg_end);
", " +
"\"timestamp\": " +
String(timestamp) +
hb_ws_msg_end;
httpServer.send(200, "text/html", msg);
}
void resetWifiManager()