diff --git a/things.ino b/things.ino
index 055b2d0..340aa4b 100644
--- a/things.ino
+++ b/things.ino
@@ -363,15 +363,17 @@ void setup() {
response += "\r\n";
response += "
Sensor Status
\r\n";
response += "\r\n";
- response += "Temperature | ";
- response += str_temperature;
- response += "°C |
\r\n";
- response += "Humidity | ";
- response += str_humidity;
- response += "%RH |
\r\n";
- response += "Heat Index | ";
- response += str_heatindex;
- response += "°C |
\r\n";
+ if (capability_dht) {
+ response += "Temperature | ";
+ response += str_temperature;
+ response += "°C |
\r\n";
+ response += "Humidity | ";
+ response += str_humidity;
+ response += "%RH |
\r\n";
+ response += "Heat Index | ";
+ response += str_heatindex;
+ response += "°C |
\r\n";
+ }
response += "
\r\n";
response += "\r\n";
response += "\r\n";
@@ -407,10 +409,12 @@ void setup() {
mqtt["server"] = mqtt_server;
mqtt["port"] = mqtt_port;
mqtt["topic"] = mqtt_topic;
- JsonObject& dht = json.createNestedObject("dht");
- dht["temperature"] = str_temperature;
- dht["humidity"] = str_humidity;
- dht["heatindex"] = str_heatindex;
+ if (capability_dht) {
+ JsonObject& dht = json.createNestedObject("dht");
+ dht["temperature"] = str_temperature;
+ dht["humidity"] = str_humidity;
+ dht["heatindex"] = str_heatindex;
+ }
String response;
json.printTo(response);
http_server.send(200, "text/plain", response);