From bf12994b4f1b3d9ef3db85c4aceea385ad8bff38 Mon Sep 17 00:00:00 2001 From: smash Date: Sun, 1 Nov 2020 14:09:22 +0100 Subject: [PATCH] display only n/100 digits for fewer distraction, changed thresholds, changed font to 'Gidole regular' --- co2sensor.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/co2sensor.yaml b/co2sensor.yaml index 32a3a9f..1a6101a 100644 --- a/co2sensor.yaml +++ b/co2sensor.yaml @@ -78,7 +78,7 @@ sensor: sensor.in_range: id: mhz19_co2 above: 800 - below: 1500 + below: 1000 then: - light.turn_on: id: ws2812 @@ -92,7 +92,7 @@ sensor: condition: sensor.in_range: id: mhz19_co2 - above: 1500 + above: 1000 then: - light.turn_on: id: ws2812 @@ -109,6 +109,10 @@ sensor: # level: "20%" # - delay: 10ms # - output.turn_off: buzzer + - delay: 500ms + - light.toggle: ws2812 + - delay: 500ms + - light.toggle: ws2812 - delay: 500ms - light.toggle: ws2812 - delay: 500ms @@ -125,7 +129,7 @@ i2c: font: - file: "font.ttf" id: cust_font - size: 28 + size: 70 display: - platform: ssd1306_i2c @@ -136,8 +140,11 @@ display: pages: - id: boot lambda: |- - it.printf(64, 32, id(cust_font), COLOR_ON, TextAlign::TOP_CENTER, "starte..."); + it.printf(64, 0, id(cust_font), COLOR_ON, TextAlign::TOP_CENTER, ":-)"); - id: co2 lambda: |- - it.printf(64, 32, id(cust_font), COLOR_ON, TextAlign::TOP_CENTER, "%.0fPPM", id(mhz19_co2).state); + int ergb; + ergb = id(mhz19_co2).state/100; + it.printf(64, 0, id(cust_font), COLOR_ON, TextAlign::TOP_CENTER, "%.0i", ergb); +# it.printf(64, 16, id(cust_font), COLOR_ON, TextAlign::TOP_CENTER, "%.0fPPM", id(mhz19_co2).state); # it.printf(64, 40, id(cust_font),TextAlign::TOP_CENTER, "%.0f°C", id(mhz19_temp).state);