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: 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:

  name: wemos1

  board: lolin32
    type: arduino

# Enable Home Assistant API
  password: ""

  ssid: !secret wifi_ssid
  password: !secret wifi_password

# set i2c ports
  sda: 4
  scl: 5

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

# run webserver
  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:


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


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: