disable beep, changed: mqtt server, default wifi, enabled captive portal when no freifunk is around, red will double blink, enabled ota, individual node name from env 'co2ampel', bug fixed that would not show ppm

This commit is contained in:
smash 2020-09-15 12:54:25 +02:00
parent e3d40d4c9c
commit 3ae0758bd6
1 changed files with 32 additions and 16 deletions

View File

@ -1,23 +1,33 @@
substitutions:
node_name: !env_var co2ampel
esphome: esphome:
name: co2_sensor_lab name: co2ampel_${node_name}
platform: ESP32 platform: ESP32
board: esp32doit-devkit-v1 board: esp32doit-devkit-v1
on_boot: on_boot:
- display.page.show: boot - display.page.show: boot
ota:
safe_mode: True
password: !secret ota_passwd
logger: logger:
level: DEBUG level: DEBUG
wifi: wifi:
ssid: !secret wifi_ssid ssid: !secret wifi_ssid
password: !secret wifi_passwd password: !secret wifi_passwd
ap:
ssid: "co2ampel"
password: ""
captive_portal:
mqtt: mqtt:
broker: mqtt.unhb broker: co2.cyber23.de
topic_prefix: co2ampel/${node_name}
birth_message: birth_message:
topic: co2_sensor/status topic: co2ampel/${node_name}/status
payload: online payload: online
will_message: will_message:
topic: co2_sensor/status topic: co2ampel/${node_name}/status
payload: offline payload: offline
uart: uart:
@ -45,10 +55,10 @@ sensor:
automatic_baseline_calibration: true automatic_baseline_calibration: true
uart_id: uart_mhz19 uart_id: uart_mhz19
temperature: temperature:
name: "MH-Z19 Temperature" name: ${node_name} Temperature
id: mhz19_temp id: mhz19_temp
co2: co2:
name: "MH-Z19 CO2" name: ${node_name} PPM
id: mhz19_co2 id: mhz19_co2
on_value: on_value:
then: then:
@ -76,6 +86,7 @@ sensor:
red: 50% red: 50%
green: 50% green: 50%
blue: 0% blue: 0%
- display.page.show: co2
else: else:
if: if:
condition: condition:
@ -89,19 +100,24 @@ sensor:
red: 100% red: 100%
green: 0% green: 0%
blue: 0% blue: 0%
- output.turn_on: buzzer # - output.turn_on: buzzer
- output.ledc.set_frequency: # - output.ledc.set_frequency:
id: buzzer # id: buzzer
frequency: "5000Hz" # frequency: "5000Hz"
- output.set_level: # - output.set_level:
id: buzzer # id: buzzer
level: "80%" # level: "20%"
# - delay: 10ms
# - output.turn_off: buzzer
- delay: 500ms - delay: 500ms
- output.turn_off: buzzer - light.toggle: ws2812
- delay: 500ms
- light.toggle: ws2812
- lambda: |- - lambda: |-
static int num_executions = 0; static int num_executions = 0;
ESP_LOGD("main", "I am at execution number %d", num_executions); ESP_LOGD("main", "I am at execution number %d", num_executions);
num_executions += 1; num_executions += 1;
- display.page.show: co2
i2c: i2c:
sda: GPIO21 sda: GPIO21
scl: GPIO22 scl: GPIO22