prefixkit Ask an engineerAsk Support RU

ESPHome devices

Lanbon L9 Smart Light Switch: ESPHome

Lanbon L9 Smart Light Switch (wall switches, ESP32): GPIO pinout and a starter ESPHome config with relays, buttons, LED. Local Home Assistant control with no cloud.

Type
Wall switches
Chip
ESP32
Region standard
US

Pinout

PinFunction
GPIO17DC Pin
GPIO21CS Pin
GPIO13WR Pin
GPIO18RD Pin
GPIO6Data D0
GPIO7Data D1
GPIO15Data D2
GPIO16Data D3
GPIO10Data D4
GPIO9Data D5
GPIO46Data D6
GPIO3Data D7
GPIO4Reset Pin
GPIO0i2c SCL
GPIO35i2c SCA
GPIO32LCD Backlight (output, ledc)
GPIO36Load Relay (output, switch)
GPIO5HLW8012 CF Pin (input, pulse_meter)
GPIO11mmWave Proximity Sensor (input, binary_sensor)
GPIO2mmWave Proximity Sensor (output, unknown)
GPIO1mmWave Proximity Sensor (output, unknown)

Find it in shops: AliExpress

Links open a search in the shop; some are affiliate links: buying through them costs you nothing extra and supports this site. We do not sell devices or get them from manufacturers.

Starter ESPHome config

Built from the pinout above. Keys and the Wi-Fi password come from secrets.yaml in ESPHome. Check the pins against your hardware revision before flashing: one model can ship with different boards.

substitutions:
  name: lanbon-l9-smart-light-sw

esphome:
  name: ${name}
  friendly_name: "Lanbon L9 Smart Light Switch"

esp32:
  board: esp32dev

logger:
api:
  encryption:
    key: !secret api_key
ota:
  - platform: esphome
    password: !secret ota_password
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap: {}
captive_portal:

switch:
  - platform: gpio
    pin: GPIO36
    id: relay1
    name: "Relay"  # Load Relay (output, switch)
    restore_mode: RESTORE_DEFAULT_OFF

status_led:
  pin:
    number: GPIO32
    inverted: false  # LCD Backlight (output, ledc)

# Other pins from the pinout:
#   GPIO17: DC Pin
#   GPIO21: CS Pin
#   GPIO13: WR Pin
#   GPIO18: RD Pin
#   GPIO6: Data D0
#   GPIO7: Data D1
#   GPIO15: Data D2
#   GPIO16: Data D3
#   GPIO10: Data D4
#   GPIO9: Data D5
#   GPIO46: Data D6
#   GPIO3: Data D7
#   GPIO4: Reset Pin
#   GPIO0: i2c SCL
#   GPIO35: i2c SCA
#   GPIO11: mmWave Proximity Sensor (input, binary_sensor)
#   GPIO2: mmWave Proximity Sensor (output, unknown)
#   GPIO1: mmWave Proximity Sensor (output, unknown)

How to flash

  • Most devices are flashed over UART: a 3.3 V USB-TTL adapter to RX, TX, GND and 3V3, holding GPIO0 to ground at power-on (ESP8266/ESP32). Mains power disconnected.
  • Beken (BK72xx) and Realtek chips are flashed with ltchiptool, or with cloudcutter without opening the case if the firmware allows it.
  • Details and board photos: the device page in the ESPHome database.

A config from scratch: ESPHome generator. Which pins are safe: pinout.

Similar devices

Idea?