Ich habe einen AirGradient (Sensor), welchen ich mit ESPHome betreibe, hier der Code dazu:
esphome:
name: airgradient
friendly_name: Airgradient
project:
name: ajfriesen.ESPHome-AirGradient
version: "1.0"
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "vsoZeVQjXPibEY1HgKA5P09T5vYvjN6wEHWp8yPTH+s="
ota:
password: "95eca6d2f6b04a8187ac70c0c0815f44"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Airgradient Fallback Hotspot"
password: "NcBlnyJYDERe"
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
captive_portal:
i2c:
sda: D2
scl: D1
font:
- file: "fonts/helvetica.ttf"
id: opensans
size: 10
display:
- platform: ssd1306_i2c
id: oled
model: "SSD1306 64x48"
# reset_pin: D0
# address: 0x3C
pages:
- id: page1
lambda: |-
it.printf(0, 0, id(opensans), "CO2: %.0f", id(co2).state);
it.printf(0, 10, id(opensans), "PM25: %.0f", id(pm25).state);
it.printf(0, 20, id(opensans), "Hmdty: %.0f", id(humidity).state);
it.printf(0, 30, id(opensans), "Temp: %.0fC", id(temp).state);
rotation: 180°
# - id: page2
# lambda: |-
# it.printf(0, 0, id(opensans), "PM10 : %.0f", id(pm10).state);
# it.printf(0, 10, id(opensans), "PM25 : %.0f", id(pm25).state);
# it.printf(0, 20, id(opensans), "PM100: %.0f", id(pm100).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: uart_1
- rx_pin: D4
tx_pin: D3
baud_rate: 9600
id: uart_2
sensor:
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
filters:
- lambda: return x - 2.7;
humidity:
id: humidity
name: "Humidity"
address: 0x44
update_interval: 5s
- platform: pmsx003
# type can be PMSX003, PMS5003S, PMS5003T, PMS5003ST
# https://esphome.io/components/sensor/pmsx003.html
type: PMSX003
uart_id: uart_1
# pm_1_0:
# id: pm10
# name: "Particulate Matter <1.0µm Concentration"
pm_2_5:
id: pm25
name: "Particulate Matter <2.5µm Concentration"
update_interval: 60s
# pm_10_0:
# id: pm100
# name: "Particulate Matter <10.0µm Concentration"
# formaldehyde:
# id: hcho
# name: "Formaldehyde (HCHO) concentration in µg per cubic meter"
- platform: senseair
uart_id: uart_2
co2:
id: co2
name: "SenseAir CO2 Value"
update_interval: 60s
Nach einem Update von ESPHome, funktioniert leider das Display nicht mehr, ich habe nichts geändert am Code.
Vorher war der Hintergrund schwarz und es waren 4 Zeilen mit den Werten zu lesen, jetzt sieht das Display so aus:
Was kann das sein, die Daten kommen alle rein, sprich der Sensor funktioniert, nur das Display eben nicht.
Liebe Grüße
Andreas