One day I felt like dressing up my desk, so I dug out a XIAO ESP32-C3 and its tiny OLED base—and, lucky me, a Seeed IoT Button. With ESPHome and Home Assistant, a tap wakes the display and LED, another tap flips the message (“Hello Atom!” ⇄ “Happy Today”), and you can even reboot the XIAO remotely. It’s tiny and simple—a playful prototype—but I hope it sparks your next idea.
A few lines of YAML later, ESPHome exposed everything I needed to HA: the OLED text, an on/off “screen” switch, the Grove LED, even a restart control. The IoT Button becomes a pocket remote—map single/double/long presses however you like. No firmware tangles, just tweak automations and watch the gadget change in real time over OTA.
Now it lives beside my keyboard: a friendly mood light, a micro message board, a little badge for quick reminders. It’s intentionally minimal, but that’s the point—start small, ship fast, and remix: swap the LED for a sensor, rotate messages on a schedule, or let HA push notifications straight to the screen.
Actually, for a cleaner setup, I removed the LED from the Grove LED-Blue module and connected it directly to the XIAO using jumper wires.
1.Prepare HA & ESPHome
- Install the ESPHome add-on in Home Assistant.
- Create fonts/ under /config/esphome/, copy Roboto-Regular.ttf there.
- Create secrets.yaml if you haven’t, and add wifi_ssid, wifi_password, api_key, ota_pass.
2.Flash the XIAO
- Use ESPHome “Install” to compile/flash via USB-C.
- After first flash, future updates can be OTA from the ESPHome dashboard.
3.Add to Home Assistant
- HA should auto-discover the ESPHome device. Accept it in Settings → Devices & Services.
- You’ll see entities like Grove LED, OLED Screen, OLED Text, and XIAO ESP32C3 Restart.
4. Wire
- OLED is on the expansion board already.
- Plug the Grove LED into A0/D0 (or D10 if you prefer GPIO10). No code changes needed unless you move to GPIO10.
I've set up 5 automations for it myself in Home Assistant. You can see the specifics in the table below, but of course, feel free to create your own, more interesting ones.
Motion Table
- OLED blank/garbled: Confirm I²C
0x3C
, pinsSDA=GPIO6 / SCL=GPIO7
. Check ESPHome logs; make sure the font file exists and path is correct. - Strapping pin warning (GPIO2): It’s a reminder that the pin is sampled at boot. The Grove LED typically won’t hold it. If you ever see odd boot behavior, move the LED to D10/ GPIO10 and update the YAML pin.
- No entities in HA: Check the ESPHome device is online, API key matches, and your HA instance can reach the device’s IP.
- Text too wide: Shorten the text or slightly reduce font size; 20pt fits most short phrases on 128×64.
- Chinese characters: Use a CJK font (e.g., Noto Sans CJK). Firmware size will increase significantly.
- PWM dimming: Swap the LED switch for
output: ledc
+light: monochromatic
to get brightness and fades - Auto pages: Cycle pages on the OLED (clock, countdown, weather) using an
interval:
and page index. - Sensors: Add Grove temp/humidity or gesture sensors; show readings on the display.
- HA-pushed notifications: Use HA automations to push reminders (Pomodoro end, doorbell, calendar alerts) into
OLED Text
. - Enclosure: 3D-print a tiny case or laser-cut a stand; cut a window for the OLED.
Comments