Metainformationen zur Seite
  •  

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
digitales:hardware:displays:ssd1306_oled_display [14.04.2023] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1digitales:hardware:displays:ssd1306_oled_display [25.04.2025] (aktuell) – ↷ Links angepasst, weil Seiten im Wiki verschoben wurden cs
Zeile 1: Zeile 1:
 +{{tag>Code Display Hardware Nuetzliche_Links}}
 +
 +====== SSD1306 OLED Display Over I²C ======
 +
 +===== Spezifikation =====
 +
 +|{{..:ssd1306-full.jpg?direct&415x232|ssd1306-full.jpg}}|
 +
 +|screen size|1.3" (3.3 cm|
 +|number of pixels|128×64|
 +|colour depth|monochrome (white)|
 +|pixel pitch|0.23 x 0.23 mm|
 +|pixel size|0.21 x 0.21 mm|
 +|Brightness|100 cd/m2 at 12 V|
 +|Dimensions| |
 +
 +|
 +
 +===== Code =====
 +
 +<file yaml flur-temperatur.yaml>
 +substitutions:
 +  devicename: flur-temperatur
 +  upper_devicename: Flur Temperatur
 +
 +esphome:
 +  name: $devicename
 +  friendly_name: $upper_devicename
 +
 +esp8266:
 +  board: d1_mini
 +
 +# Enable logging
 +logger:
 +
 +packages:
 +  wifi: !include packages/wifi.yaml
 +  mqtt: !include packages/mqtt.yaml
 +  ota:  !include packages/ota.yaml
 +  time: !include packages/time.yaml
 +  font: !include packages/font.yaml
 +
 +# Enable Home Assistant API
 +api:
 +
 +captive_portal:
 +
 +i2c:
 +  sda: D2
 +  scl: D1
 +  scan: false
 +
 +sensor:
 +  - platform: dht
 +    pin: D0
 +    temperature:
 +      name: "Flur Temperature"
 +      id: dht22_temperature
 +      accuracy_decimals: 1
 +
 +      filters:
 +        - offset: -2.3
 +        - delta: 0.1
 +    humidity:
 +      name: "Flur Humidity"
 +      id: dht22_humidity
 +      accuracy_decimals: 1
 +      filters:
 +        - offset: -7.1
 +        - delta: 0.1
 +    update_interval: 120s
 +
 +display:
 +  - platform: ssd1306_i2c
 +    model: "SSD1306 128x64"
 +    address: 0x3C
 +    lambda: |-
 +      // Titel
 +      it.printf(64, 0, id(f_top), TextAlign::TOP_CENTER, "DHT22");
 +
 +      // Zeit
 +      it.strftime(0, 48, id(f_time), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());
 +
 +      // Feuchtigkeit
 +      if (id(dht22_humidity).has_state()) {
 +        it.printf(128, 14, id(f_data), TextAlign::TOP_RIGHT , "%.1f %%", id(dht22_humidity).state);
 +      }
 +
 +      // Temperatur
 +      if (id(dht22_temperature).has_state()) {
 +        it.printf(128, 32, id(f_data), TextAlign::TOP_RIGHT , "%.1f°C", id(dht22_temperature).state);
 +      }
 +
 +
 +</file>
 +
 +===== Nützliche Links =====
 +
 +  * [[https://esphome.io/components/display/ssd1306.html|ESPHome SSD1306 OLED Display]]
 +