Don't publish invalid sensor readings to MQTT

This commit is contained in:
Juerd Waalboer 2020-12-22 05:19:51 +01:00
parent e5167278ee
commit 5687e04440
1 changed files with 1 additions and 0 deletions

View File

@ -363,6 +363,7 @@ void loop() {
mqtt_interval,
[] {
if (!mqtt_enabled) return;
if (co2 <= 0) return;
connect_mqtt();
String message = mqtt_template;
message.replace("{}", String(co2));