Skip to main content
Detailed explanation of the ESPHome configuration for the ED1 board.

File structure

ed1-hoas
ed1-message.sample.yaml
ed1-mqtt.sample.yaml
ed1-status.sample.yaml
secrets.yaml
secrets.sample.yaml
packages
core.yaml
hardware.yaml
display.yaml
fonts.yaml
buzzer.yaml
buttons.yaml
sensors.yaml
bluetooth.yaml
ir-receiver.yaml
led-matrix.yaml
mqtt.yaml
stepper.yaml

Modular package system

This project uses ESPHome’s package system for modularity. Each sample config uses !include to import reusable components from the packages/ directory.

Basic structure

Extending package components

Use !extend to override or add to components defined in packages:

Creating a new configuration

  1. Copy an existing sample (e.g., ed1-message.sample.yaml)
  2. Update the substitutions section with your device name
  3. Add or remove packages as needed
  4. Override display lambda and button behaviors for your use case

Secrets setup

  1. Copy the sample file:
  2. Edit secrets.yaml with your values:
  3. Generate an API key:

Package reference

The following sections describe what each package contains. These are automatically included when you use !include packages/<name>.yaml.

Core configuration (packages/core.yaml)

  • name: Device hostname (lowercase, hyphens only)
  • friendly_name: Display name in Home Assistant
  • board: Generic ESP32 dev board
  • framework: Arduino for best compatibility

Connectivity (packages/core.yaml)

  • ap: Fallback access point if WiFi fails
  • captive_portal: Web config when in AP mode

Hardware buses (packages/hardware.yaml)

  • scan: true: Logs detected I2C devices on boot

Fonts (packages/fonts.yaml)

The font file is included in the fonts/ directory.

TFT display (packages/display.yaml)

Display layout: Model Options:
  • INITR_GREENTAB: Use with row_start: 3 for 1.44” 128x128 displays (equivalent to Adafruit’s INITR_144GREENTAB)
  • INITR_BLACKTAB: Alternative initialization
  • INITR_18REDTAB: For 1.8” displays

LED matrix display (packages/led-matrix.yaml)

pixel_mapper: Handles the serpentine wiring pattern where odd columns are reversed.

LED matrix light (packages/led-matrix.yaml)

  • platform: esp32_rmt_led_strip: ESPHome native driver using ESP-IDF 5.x RMT
  • rgb_order: GRB: Color order (Green-Red-Blue)
  • chipset: WS2812: LED chipset type
  • color_correct: Reduces brightness to 40% (power savings)
Note: We use esp32_rmt_led_strip instead of neopixelbus for compatibility with the IR receiver. Both use the RMT peripheral but the native driver uses the newer ESP-IDF 5.x API.

Bluetooth proxy (packages/bluetooth.yaml)

Extends Home Assistant’s Bluetooth range. The ED1 acts as a BLE relay.

MQTT (packages/mqtt.yaml)

Optional package for MQTT broker connectivity. Can be used alongside or instead of the native API.
Topics:
  • ed1/<device_name>/message - Subscribe to receive messages
  • ed1/<device_name>/status - Publishes online/offline
Usage:
  1. Add MQTT credentials to secrets.yaml
  2. Include the package: mqtt: !include packages/mqtt.yaml
  3. Send messages via CLI: mosquitto_pub -t ed1/ed1-message/message -m "Hello!"
Choosing API vs MQTT:
  • Use native API for Home Assistant integration (auto-discovery, encryption)
  • Use MQTT for multi-system integration (Node-RED, scripts, other devices)
  • Both can be used simultaneously

Stepper motors (packages/stepper.yaml)

Controls two 28BYJ-48 stepper motors via the MCP23009 I2C GPIO expander and ULN2004A Darlington drivers.
Technical Details:
  • Uses direct I2C register writes (not ESPHome’s mcp23008 component)
  • Full-step mode: 512 steps = 1 complete revolution
  • Non-blocking interval-based stepping (2ms per step)
  • Compatible with MicroBlocks “ED1 Stepper Motor” library
Exposed Entities: Usage Example:
Step Counts:
  • 128 steps = 1/4 turn (90°)
  • 256 steps = 1/2 turn (180°)
  • 512 steps = 1 full turn (360°)

Buzzer (packages/buzzer.yaml)

The buzzer uses PWM via the LEDC (LED Control) peripheral. Turning the switch on activates the buzzer with a continuous tone.

IR receiver (packages/ir-receiver.yaml)

  • dump: all: Logs all received IR codes (useful for debugging)
  • on_nec/on_samsung: Protocol-specific handlers
  • IR codes appear in ESPHome logs, not as Home Assistant entities
  • Use to trigger automations based on remote control buttons

Touch buttons (packages/buttons.yaml)

Threshold Tuning:
  • Default: 500
  • If too sensitive: Increase threshold
  • If not responding: Decrease threshold
  • Enable setup_mode: true temporarily to see raw values

Sensors (packages/sensors.yaml)

Note: The wifi_rssi global provides a safe integer value for display code. Before the first WiFi signal reading (~10 seconds after boot), the sensor returns NaN which can cause display issues when cast to int. The global defaults to -100 dBm and updates on each reading.

Text input (packages/led-matrix.yaml)

Allows Home Assistant to send text to display on the LED matrix.

Customization

Change display content

Modify the lambda in the display section:

Add button actions

Adjust matrix brightness

Change color_correct values (0-100%):

Troubleshooting

Device not detected via USB

The ED1 uses a CP2102N USB-to-UART chip. Install the driver:
  • Download from Silicon Labs CP210x Drivers
  • Install for your OS (Windows, macOS, Linux)
  • Reconnect the USB cable
  • The device should appear as /dev/ttyUSB0 (Linux), /dev/cu.SLAB_USBtoUART (macOS), or COM3 (Windows)

Display shows garbage

  • Check model setting matches your display
  • Try adjusting col_start and row_start offsets
  • Verify SPI pins are correct

Touch buttons not working

  • Enable setup_mode: true in esp32_touch
  • Check logs for raw touch values
  • Adjust threshold based on idle vs touched values

LED matrix wrong colors

  • Change rgb_order from GRB to RGB or BRG
  • Some strips use different color orders

WiFi connection issues

  • Check signal strength sensor
  • Reduce update_interval on sensors to reduce traffic
  • Try static IP configuration

Device not discovered

  • Ensure API encryption key matches
  • Check Home Assistant logs for connection attempts
  • Verify device is on same network subnet