From 74d4adef50a8df70b1226a36a1533c667ae13343 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 12 Jan 2025 21:42:06 +0100 Subject: [PATCH] Added Test for I2c and AHT20 to Mini OLED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Datei zum Testen von I2c Aht 20 zu Mini Oled Hinzugefügt und eingebaut --- Mini-OLED.yml | 39 ++++++++++++++++++--------------------- i2c-test.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 21 deletions(-) create mode 100644 i2c-test.yml diff --git a/Mini-OLED.yml b/Mini-OLED.yml index adacd50..830777d 100644 --- a/Mini-OLED.yml +++ b/Mini-OLED.yml @@ -1,6 +1,6 @@ esphome: - name: oled-tim - friendly_name: OLED Tim + name: oled-tim-mini + friendly_name: OLED Tim Mini esp8266: board: esp01_1m @@ -53,17 +53,6 @@ time: timezone: Europe/Berlin sensor: - - platform: homeassistant - id: tim_zimmer_temp - entity_id: sensor.esphome_web_ebe170_tim_zimmer_temperatur - internal: true - - - platform: homeassistant - id: tim_zimmer_hum - entity_id: sensor.esphome_web_ebe170_tim_zimmer_luftfeuchte - internal: true - - - platform: homeassistant id: sollar_power entity_id: sensor.shellyplus1pm_4855199bbb3c_switch_0_power @@ -79,6 +68,15 @@ sensor: entity_id: sensor.p1p_01s00c343000157_druckfortschritt internal: true + - platform: aht10 + variant: AHT10 + temperature: + name: "Tim Schreibtisch Temperatur" + id: "tim_schreib_temp" + humidity: + name: "Tim Schreibtisch Luftfeuchte" + id: "tim_schreib_hum" + text_sensor: - platform: homeassistant id: P1P_Status @@ -87,8 +85,8 @@ text_sensor: i2c: - sda: 4 - scl: 5 + sda: 4 #Lila / D2 + scl: 5 #Grau / D1 scan: True display: @@ -107,14 +105,13 @@ display: } // Print inside temperature (from homeassistant sensor) - if (id(tim_zimmer_temp).has_state()) { - it.printf(126, 0, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(tim_zimmer_temp).state); + if (id(tim_schreib_temp).has_state()) { + it.printf(126, 0, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(tim_schreib_temp).state); } - - + // Print Inside Humidity (from homeassistant sensor) - if (id(tim_zimmer_hum).has_state()) { - it.printf(126, 32, id(font3), TextAlign::CENTER_RIGHT , "%.1f%%", id(tim_zimmer_hum).state); + if (id(tim_schreib_hum).has_state()) { + it.printf(126, 32, id(font3), TextAlign::CENTER_RIGHT , "%.1f%%", id(tim_schreib_hum).state); } // Print Solar Power (from homeassistant sensor) diff --git a/i2c-test.yml b/i2c-test.yml new file mode 100644 index 0000000..ab103aa --- /dev/null +++ b/i2c-test.yml @@ -0,0 +1,33 @@ +esphome: + name: oled-tim-mini + friendly_name: OLED Tim Mini + +esp8266: + board: esp01_1m + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "tY/skPnkQn1sZRBYYJ4LL571z+aA1P463WvaX58ju2w=" + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Esphome-Web-D05329" + password: "ZqgvIQnFz4Ib" + +captive_portal: + +i2c: + sda: 4 #Lila / D2 + scl: 5 #Grau / D1 + scan: True