From 48f63b393425dbfae4c6800a96afa9cd88cfa161 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 26 Oct 2021 00:38:55 +0200 Subject: [PATCH] IAQ --- common/bme680.yaml | 2 ++ common/display.yaml | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/common/bme680.yaml b/common/bme680.yaml index 1dff46e..eb501b8 100644 --- a/common/bme680.yaml +++ b/common/bme680.yaml @@ -31,12 +31,14 @@ sensor: send_every: 12 iaq: name: "${node_name} IAQ" + id: iaq filters: - median: window_size: 12 send_every: 12 iaq_accuracy: name: "${node_name} Numeric IAQ Accuracy" + id: iaq_accuracy filters: - median: window_size: 12 diff --git a/common/display.yaml b/common/display.yaml index 6342ff2..82cc033 100644 --- a/common/display.yaml +++ b/common/display.yaml @@ -70,6 +70,13 @@ display: if (id(temperature).state) { it.printf(2, 21+4, id(font2), COLOR_OFF, "%.1f", id(temperature).state); it.printf(55, 21+4, id(font1), COLOR_OFF, "°C"); it.printf(2, 57+4, id(font2), COLOR_OFF, "%.1f", id(humidity).state); it.printf(55, 57+4, id(font1), COLOR_OFF, "%%"); + if (id(humidity).state < 30) { + it.printf(30, 80, id(font1), COLOR_OFF, "low"); + } else if (id(humidity).state < 60) { + it.printf(30, 80, id(font1), COLOR_OFF, "comfort"); + } else { + it.printf(30, 80, id(font1), COLOR_OFF, "high"); + } it.printf(2, 93+4, id(font2), COLOR_OFF, "%.0f", id(pressure_sealevel).state); it.printf(55, 93+4, id(font1), COLOR_OFF, "hPa"); it.graph(70, 21, id(temperature_graph)); it.graph(70, 57, id(humidity_graph)); @@ -79,7 +86,24 @@ display: it.printf(133, 51, id(icon_font), weather_icon_map[id(weather_icon).state.c_str()].c_str()); } it.printf(133, 21, id(font1), "Temp Out: %.1f°C", id(temperature_outside).state); - it.printf(133, 31, id(font1), "VOC : %.1f k\u03A9", id(voc).state); + if (id(iaq_accuracy).state == 3) { + it.printf(133, 31, id(font1), "IAQ : %.0f ", id(iaq).state); + if (id(iaq).state < 50) { + it.printf(133, 41, id(font1), "excellent"); + } else if (id(iaq).state < 100) { + it.printf(133, 41, id(font1), "fine"); + } else if (id(iaq).state < 150) { + it.printf(133, 41, id(font1), "moderate"); + } else if (id(iaq).state < 200) { + it.printf(133, 41, id(font1), "poor"); + } else if (id(iaq).state < 300) { + it.printf(133, 41, id(font1), "very poor"); + } else if (id(iaq).state < 500) { + it.printf(133, 41, id(font1), "severe"); + } + } else { + it.printf(133, 31, id(font1), "VOC : %.1f k\u03A9", id(voc).state); + } # it.printf(133, 21, id(font1), "PM2.5: %.1f", id(pm2).state); # it.printf(133, 31, id(font1), "PM10 : %.1f", id(pm10).state); # it.printf(133, 51, id(font1), "Lux : %.1f lx", id(lux).state);