diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index 4efbb8f..3db581a 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -951,15 +951,11 @@ void POSTsetOutput() { void APIgetSensors() { JsonDocument jsonSensors; - - JsonArray arraySoilmoisture = jsonSensors["soilmoisture"].to(); - arraySoilmoisture.add(getSoilmoisture(1)); - arraySoilmoisture.add(getSoilmoisture(2)); - JsonArray arrayTemperature = jsonSensors["temperature"].to(); - arrayTemperature.add(getTemperature(1)); - arrayTemperature.add(getTemperature(2)); - jsonSensors["humidity"] = getHumidity(); - jsonSensors["chirpLight"] = getLightchirp(); + + jsonSensors["soilmoisture"] = valSoilmoisture; + jsonSensors["temperature"] = valTemperature; + jsonSensors["humidity"] = valHumidity; + jsonSensors["waterlevel"] = valWaterlevel; String body; serializeJsonPretty(jsonSensors, body);