Browse Source

IAQ

esphome
Hendrik Langer 3 years ago
parent
commit
48f63b3934
  1. 2
      common/bme680.yaml
  2. 26
      common/display.yaml

2
common/bme680.yaml

@ -31,12 +31,14 @@ sensor:
send_every: 12 send_every: 12
iaq: iaq:
name: "${node_name} IAQ" name: "${node_name} IAQ"
id: iaq
filters: filters:
- median: - median:
window_size: 12 window_size: 12
send_every: 12 send_every: 12
iaq_accuracy: iaq_accuracy:
name: "${node_name} Numeric IAQ Accuracy" name: "${node_name} Numeric IAQ Accuracy"
id: iaq_accuracy
filters: filters:
- median: - median:
window_size: 12 window_size: 12

26
common/display.yaml

@ -70,6 +70,13 @@ display:
if (id(temperature).state) { 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, 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, "%%"); 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.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, 21, id(temperature_graph));
it.graph(70, 57, id(humidity_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, 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, 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, 21, id(font1), "PM2.5: %.1f", id(pm2).state);
# it.printf(133, 31, id(font1), "PM10 : %.1f", id(pm10).state); # it.printf(133, 31, id(font1), "PM10 : %.1f", id(pm10).state);
# it.printf(133, 51, id(font1), "Lux : %.1f lx", id(lux).state); # it.printf(133, 51, id(font1), "Lux : %.1f lx", id(lux).state);

Loading…
Cancel
Save