m5stack co2 sensor
This commit is contained in:
@@ -46,12 +46,12 @@ ip5306:
|
||||
# Buttons
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
id: M5_BtnA
|
||||
id: m5stackfire_button_left
|
||||
pin:
|
||||
number: 39
|
||||
inverted: true
|
||||
- platform: gpio
|
||||
id: M5_BtnB
|
||||
id: m5stackfire_button_middle
|
||||
pin:
|
||||
number: 38
|
||||
inverted: true
|
||||
@@ -59,11 +59,14 @@ binary_sensor:
|
||||
then:
|
||||
- switch.toggle: backlight
|
||||
- platform: gpio
|
||||
id: M5_BtnC
|
||||
id: m5stackfire_button_right
|
||||
pin:
|
||||
number: 37
|
||||
inverted: true
|
||||
|
||||
- platform: gpio
|
||||
pin: 36
|
||||
name: m5stackfire-motion
|
||||
device_class: motion
|
||||
# GPIO pin of the display backlight
|
||||
switch:
|
||||
- platform: gpio
|
||||
@@ -88,6 +91,19 @@ light:
|
||||
restore_mode: ALWAYS_OFF
|
||||
id: side_light
|
||||
default_transition_length: 0s
|
||||
- platform: partition
|
||||
name: "${friendly_name} Side Light Right"
|
||||
segments:
|
||||
- id: side_light
|
||||
from: 0
|
||||
to: 4
|
||||
- platform: partition
|
||||
name: "${friendly_name} Side Light Left"
|
||||
segments:
|
||||
- id: side_light
|
||||
from: 5
|
||||
to: 9
|
||||
|
||||
|
||||
i2c:
|
||||
sda: 21
|
||||
@@ -103,7 +119,13 @@ spi:
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 24
|
||||
size: 18
|
||||
|
||||
image:
|
||||
- file: m5stack_display.png
|
||||
id: img_background
|
||||
type: RGB24
|
||||
|
||||
|
||||
display:
|
||||
- platform: ili9xxx
|
||||
@@ -113,9 +135,10 @@ display:
|
||||
reset_pin: 33
|
||||
id: my_display
|
||||
lambda: |-
|
||||
it.printf(80, 0, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "CO2 Value %.1f", id(co2value).state );
|
||||
it.printf(80, 30, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "CO2 Temp %.1f", id(co2temp).state );
|
||||
|
||||
it.image(0, 0, id(img_background));
|
||||
it.printf(240, 67, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.0f ppm", id(co2value).state );
|
||||
it.printf(240, 125, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.1f °C", id(co2temp).state );
|
||||
it.printf(240, 184, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.1f %%", id(m5stackfire_dht22_humidity).state );
|
||||
|
||||
#display:
|
||||
# - platform: ili9xxx
|
||||
@@ -176,4 +199,15 @@ sensor:
|
||||
update_interval: 5s
|
||||
automatic_baseline_calibration: false
|
||||
uart_id: uart_co2
|
||||
id: my_mhz19
|
||||
id: my_mhz19
|
||||
- platform: dht
|
||||
pin: 26
|
||||
temperature:
|
||||
id: m5stackfire_dht22_temperature
|
||||
name: "DHT22 Temperature"
|
||||
humidity:
|
||||
id: m5stackfire_dht22_humidity
|
||||
name: "DHT22 humidity"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user