Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
010f5f1646 | |||
fa283bcd09 |
|
@ -1,36 +1,33 @@
|
|||
substitutions:
|
||||
node_name: !env_var co2ampel
|
||||
|
||||
esphome:
|
||||
name: 'co2ampel_${node_name}'
|
||||
name: co2ampel_${node_name}
|
||||
platform: ESP32
|
||||
board: esp32doit-devkit-v1
|
||||
on_boot:
|
||||
- display.page.show: boot
|
||||
on_loop:
|
||||
- display.page.show: co2
|
||||
|
||||
ota:
|
||||
safe_mode: true
|
||||
safe_mode: True
|
||||
password: !secret ota_passwd
|
||||
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_passwd
|
||||
ap:
|
||||
ssid: co2ampel
|
||||
password: ''
|
||||
|
||||
captive_portal: null
|
||||
|
||||
ssid: "co2ampel"
|
||||
password: ""
|
||||
captive_portal:
|
||||
mqtt:
|
||||
broker: co2.cyber23.de
|
||||
topic_prefix: 'co2ampel/${node_name}'
|
||||
topic_prefix: co2ampel/${node_name}
|
||||
birth_message:
|
||||
topic: 'co2ampel/${node_name}/status'
|
||||
topic: co2ampel/${node_name}/status
|
||||
payload: online
|
||||
will_message:
|
||||
topic: 'co2ampel/${node_name}/status'
|
||||
topic: co2ampel/${node_name}/status
|
||||
payload: offline
|
||||
|
||||
uart:
|
||||
|
@ -40,14 +37,11 @@ uart:
|
|||
id: uart_mhz19
|
||||
|
||||
light:
|
||||
- platform: fastled_clockless
|
||||
chipset: WS2812B
|
||||
- platform: neopixelbus
|
||||
pin: GPIO4
|
||||
num_leds: 12
|
||||
max_refresh_rate: 500ms
|
||||
rgb_order: GRB
|
||||
name: ws2812 ring
|
||||
id: ws2812
|
||||
name: "ws2812 ring"
|
||||
id: "ws2812"
|
||||
restore_mode: ALWAYS_OFF
|
||||
|
||||
output:
|
||||
|
@ -61,10 +55,10 @@ sensor:
|
|||
automatic_baseline_calibration: true
|
||||
uart_id: uart_mhz19
|
||||
temperature:
|
||||
name: '${node_name} Temperature'
|
||||
name: ${node_name} Temperature
|
||||
id: mhz19_temp
|
||||
co2:
|
||||
name: '${node_name} PPM'
|
||||
name: ${node_name} PPM
|
||||
id: mhz19_co2
|
||||
on_value:
|
||||
then:
|
||||
|
@ -75,12 +69,8 @@ sensor:
|
|||
above: 0
|
||||
below: 800
|
||||
then:
|
||||
- light.turn_on:
|
||||
- light.turn_off:
|
||||
id: ws2812
|
||||
brightness: 80%
|
||||
red: 0%
|
||||
green: 100%
|
||||
blue: 0%
|
||||
- display.page.show: co2
|
||||
else:
|
||||
if:
|
||||
|
@ -94,7 +84,7 @@ sensor:
|
|||
id: ws2812
|
||||
brightness: 80%
|
||||
red: 50%
|
||||
green: 40%
|
||||
green: 50%
|
||||
blue: 0%
|
||||
- display.page.show: co2
|
||||
else:
|
||||
|
@ -110,6 +100,15 @@ sensor:
|
|||
red: 100%
|
||||
green: 0%
|
||||
blue: 0%
|
||||
# - output.turn_on: buzzer
|
||||
# - output.ledc.set_frequency:
|
||||
# id: buzzer
|
||||
# frequency: "5000Hz"
|
||||
# - output.set_level:
|
||||
# id: buzzer
|
||||
# level: "20%"
|
||||
# - delay: 10ms
|
||||
# - output.turn_off: buzzer
|
||||
- delay: 500ms
|
||||
- light.toggle: ws2812
|
||||
- delay: 500ms
|
||||
|
@ -118,7 +117,7 @@ sensor:
|
|||
- light.toggle: ws2812
|
||||
- delay: 500ms
|
||||
- light.toggle: ws2812
|
||||
- lambda: >-
|
||||
- lambda: |-
|
||||
static int num_executions = 0;
|
||||
ESP_LOGD("main", "I am at execution number %d", num_executions);
|
||||
num_executions += 1;
|
||||
|
@ -128,14 +127,14 @@ i2c:
|
|||
scl: GPIO22
|
||||
|
||||
font:
|
||||
- file: font.ttf
|
||||
- file: "font.ttf"
|
||||
id: cust_font
|
||||
size: 65
|
||||
size: 70
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
model: SSD1306 128x64
|
||||
address: 60
|
||||
model: "SSD1306 128x64"
|
||||
address: 0x3C
|
||||
brightness: 100%
|
||||
update_interval: 10s
|
||||
pages:
|
||||
|
@ -145,7 +144,7 @@ display:
|
|||
- id: co2
|
||||
lambda: |-
|
||||
int ergb;
|
||||
ergb = id(mhz19_co2).state;
|
||||
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);
|
||||
|
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
@ -1,8 +0,0 @@
|
|||
| | Backplates | Frontplates | Topplates | Bottomplates | Circles | Side L | Side R | Deckel |
|
||||
|-----------|------------|-------------|-----------|--------------|---------|--------|--------|--------|
|
||||
| Pattern 1 | 18 | 17 | 2 | 2 | | | | |
|
||||
| Pattern 2 | | | | | 135 | | | |
|
||||
| Pattern 3 | | | | | | 40 | 40 | |
|
||||
| Pattern 4 | | | 40 | 40 | | | | |
|
||||
| Pattern 5 | | | 20 | 20 | | 20 | 20 | |
|
||||
| Pattern 6 | | | | | | | | 135 |
|
Before Width: | Height: | Size: 593 KiB |
Before Width: | Height: | Size: 212 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 160 KiB |