Hi all,
I reflashed my Airgradient PRO with ESPhome in order to easily manage and integrate from HomeAssistant.
Sometimes it happened that SHT31 and SGP41 stops reporting data and the OLED display freeze.
here the logs i collected
below my configuration file
anyboday has some idea?
thanks
bye
Marco
# Airgradient Pro presoldered edition
# D1 mini v4.0.0 with usb c port
substitutions:
devicename: "airgradient-pro"
upper_devicename: "Airgradient Pro"
esphome:
name: "${devicename}"
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
# name_add_mac_suffix: true
platform: ESP8266
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxxxxxxxxxxxxxxxxxx="
ota:
password: "xxxxxxxxxxxxxxxxxxxxxxxx"
# dashboard_import:
# package_import_url: github://esphome/esphome-project-template/project-template-esp32.yaml@v6
# package_import_url: github://ajfriesen/ESPHome-AirGradient/main/air-gradient.yaml
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 15min
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${upper_devicename} Fallback Hotspot
password: "xxxxxxxxxxxxxxxxx"
switch:
- platform: safe_mode
name: "Flash Mode (Safe Mode)"
- platform: restart
name: "Airgradient pro restart"
captive_portal:
i2c:
sda: D2
scl: D1
font:
# - file: "font/t0-16.bdf"
# - file: "font/monofont.ttf"
- file: "font/LiberationSans-Regular.ttf"
id: opensans
size: 24
display:
- platform: ssd1306_i2c
id: oled
address: 0x3c
rotation: 180°
model: "SH1106 128x64"
pages:
# - id: page1
# lambda: |-
# it.printf(0, 0, id(opensans), "CO2: %.0f ppm", id(co2).state);
# it.printf(0, 20, id(opensans), "PM25: %.0f, VOC: %.0f", id(pm25).state, id(voc).state);
# it.printf(0, 40, id(opensans), "T: %.1f°C, H: %.0f %%", id(temp).state, id(humidity).state);
- id: display_temp_hum
lambda: |-
it.printf(0, 0, id(opensans), "Temp: %.1f °C", id(temp).state);
it.printf(0, 24, id(opensans), "Hum: %.0f%%", id(humidity).state);
- id: display_pm2
lambda: |-
it.print(0, 0, id(opensans), "PM2.5");
it.printf(0, 24, id(opensans), "%.0f ug/m3",id(pm25).state);
- id: display_co2
lambda: |-
it.print(0, 0, id(opensans), "CO2");
it.printf(0, 24, id(opensans), "%.0f ppm",id(co2).state);
# - id: display_eco2
# lambda: |-
# it.print(0, 0, id(opensans), "eCO2");
# it.printf(64, 24, id(opensans), TextAlign::TOP_RIGHT, "%.0f",id(eco2).state);
- id: display_tvoc
lambda: |-
it.print(0, 0, id(opensans), "VOC");
it.printf(64, 24, id(opensans), TextAlign::TOP_RIGHT, "%.0f",id(voc).state);
# Maybe add a page later
interval:
- interval: 5s
then:
- display.page.show_next: oled
- component.update: oled
uart:
- rx_pin: D5
tx_pin: D6
baud_rate: 9600
id: uart1
- rx_pin: D4
tx_pin: D3
baud_rate: 9600
id: uart2
sensor:
- platform: sht3xd
temperature:
id: temp
name: ${upper_devicename} Temperature
humidity:
id: humidity
name: ${upper_devicename} Humidity
address: 0x44
update_interval: 30s
- platform: pmsx003
type: PMSX003
uart_id: uart1
update_interval: 60000ms
pm_2_5:
id: pm25
name: "${upper_devicename} Particulate Matter <2.5µm Concentration"
pm_10_0:
id: pm100
name: "${upper_devicename} Particulate Matter <10.0µm Concentration"
# formaldehyde:
# id: hcho
# name: "Formaldehyde (HCHO) concentration in µg per cubic meter"
- platform: senseair
uart_id: uart2
co2:
id: co2
name: "${upper_devicename} SenseAir CO2 Value"
update_interval: 60s
- platform: sgp4x
# https://esphome.io/components/sensor/sgp4x.html
nox:
name: "${upper_devicename} NOx index"
id: nox
accuracy_decimals: 1
voc:
name: "${upper_devicename} VOC index"
id: voc
accuracy_decimals: 1
update_interval: 60s
compensation:
humidity_source: humidity
temperature_source: temp
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 30s
id: airgradient_wifi_signal