i'm running the script from bruh automation, FULL CODE RAW
here is the thing:
i want to change the output of the dh11 temperature and humidity, because they show up like 45.00 and 23.00
so i want to get rid of the tho zeroes.
what i did try was this in the void sendState() section for my mqtt json string :
float t = dht.readTemperature();
root["temperature"] = t ,0 ;
in the monitor it shows up loke this : "temperature":31,"
there is a comma i can't get rid of it...
when i use this in the void LOOP section it shows up correctly but i can't use it :
float t = dht.readTemperature();
if (isnan(t) || isnan(h)) {
Serial.println("Error dht sensor");
} else {
t = t - 1.00; //correction
Serial.print("humid: ");
Serial.print(h,0);
Serial.print(" %\t ");
Serial.print("Temperature: ");
Serial.print (t,0);
Serial.println("*C");
}