ESPHome: Wemos ESP32 OLED

My Homeassistant setup works, but I actually want to use some of the Rasperry PIs for something else, so it is time to replace them. A few years back I bought an ESP32 with OLED display. Not exactly this one, but similar to the one used in this tutorial: https://www.instructables.com/ESP32-With-Integrated-OLED-WEMOSLolin-Getting-Star/. Connecting a BME280 to this and installing ESPHome should be easy. And it actually is, except the OLED which I haven't figured out yet.

But first how I got ESPHome on the ESP32. I used the Docker version on a Linux system, so I can use ttyUSB directly. Setup up the device by using the Wizard and then running the first install via USB. I actually updated via USB later too, even with a working wifi setup, because it just worked.

My yaml configuration for the Wemos Lolin ESP32 OLED:

esphome:
  name: wemos1

esp32:
  board: lolin32
  framework:
    type: arduino

# Enable Home Assistant API
api:
  password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# set i2c ports
i2c:
  sda: 4
  scl: 5

sensor:
  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      oversampling: 16x
    pressure:
      name: "BME280 Pressure"
    humidity:
      name: "BME280 Humidity"
    address: 0x76
    update_interval: 60s

# run webserver
web_server:
  port: 80
  local: true

The I2C ports are not the default -- they are GPIO 4 and GPIO 5. The BME280 sensor is using port 0x76 (same as on my Raspberry PIs). The API is activated for Homeassistant without a password (no one except me is in this wifi). And on the Homeassistant side this just works. I got a notification that there is a new integration, accepted it and the sensor values are shown like this:

img1

And finally I activated the web server on port 80 with bundled assets for local (no internet) usage. The website looks like this:

img2

Overall a positive experience. Except for the OLED display. I am pretty sure the values I tried are correct because this is very much standard, but it doesn't work. Maybe in the future I try to use the Arduino Plattform or Circuit-Python to figure out what the correct values are, but not today.

Link to the repo with the yaml file including the OLED display experiments: https://github.com/mfa/ha-sensors/tree/main/esphome/config/wemos1.yaml.