pdf-icon

Atom-Lite HA Light Home Assistant Integration

This tutorial will guide you through completing the integration of Atom-Lite with Home Assistant for light control.

Preparation

  • Refer to the Home Assistant Official Documentation to install Home Assistant.
  • Install the ESPHome Builder add-on in Settings -> Add-ons -> Add-on STORE.
  • After the ESPHome Builder add-on is successfully installed, select Show in sidebar on its management page to add it to the left navigation bar.
  • This tutorial refers to the ESPHome Official Documentation; you can visit it if needed.

Note

Firmware Compilation Tip:
Compiling firmware through HA is resource-intensive. The first compilation may take a long time to download resources, depending on the device deploying the HA service and the network quality. If compilation fails, you can also click the web tools flash button below to flash the pre-packaged firmware. After flashing, follow the prompts to configure Wi-Fi connection information. (In case of configuration failure, disconnect and refresh the page to try again).

Create Device

  1. Open the ESPHome add-on page, click NEW DEVICE in the bottom right corner to create a new device.
  1. When the New device prompt appears, click the CONTINUE button.
  1. Enter a name for the device. This name can be customized; here we enter Atom-Lite.
  1. Subsequently, the device type selection screen appears. First, uncheck Use recommended settings, then select ESP32 to enter the details page.
  1. Find M5Stack-ATOM on the details page, select it, and click the NEXT button.
  1. When the device configuration success screen appears, copy the key and click INSTALL to enter the installation step.
  1. Select Manual download to start the program compilation and wait for the compilation and installation to complete.

Modify Configuration

  1. When the above steps are completed, go back to the ESPHome Builder main interface and you will find an additional Atom-Lite device. Click the EDIT button to enter the yaml file editing page.
  1. Copy the following code into the yaml file, and modify the ssid and password at the illustrated positions to your Wi-Fi account and password.
esphome:
  name: atom-lite
  friendly_name: Atom-Lite

esp32:
  board: m5stack-atom
  flash_size: 4MB
  framework:
    type: esp-idf

logger:
api:
  encryption:
    key: "*********"

ota:
  - platform: esphome
    password: "*****************"

wifi:
  ssid: "*********"
  password: "***********"
  ap:
    ssid: "Atom-Lite Fallback Hotspot"
    password: "jFsIc2XGuKRe"

captive_portal:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      mode: INPUT
      inverted: true
    name: "Atom Button"
    id: atom_button
    filters:
      - delayed_on: 50ms
      - delayed_off: 50ms
    on_multi_click:
      - timing:
          - ON for at most 0.8s
          - OFF for at most 0.5s
          - ON for at most 0.8s
          - OFF for at least 0.2s
        then:
          - logger.log: "Double Clicked"
          - light.turn_on:
              id: atom_light
              red: 100%
              blue: 50%
              green: 20%
              brightness: 50%
      - timing:
          - ON for at least 0.8s
        then:
          - logger.log: "Single Long Clicked"
          - light.turn_on:
              id: atom_light
              green: 100%
              blue: 50%
              red: 30%
              brightness: 100%

light:
  - platform: esp32_rmt_led_strip
    rgb_order: GRB
    pin: GPIO27
    num_leds: 1
    chipset: SK6812
    name: "Atom RGB Light"
    id: atom_light
    restore_mode: RESTORE_DEFAULT_OFF
    effects:
      - random:
          name: "Random"
          transition_length: 1s
          update_interval: 1s
Update Notes
Starting from ESPHome 2025.10, Arduino is no longer used as a separate Framework but as a component of ESP-IDF. The original NeoPixelBus Light under Arduino does not support the ESP-IDF framework. For the new version of ESPHome, please use the ESP32 RMT LED Strip component.
  1. Click the SAVE button to save the yaml file first, then click the INSTALL button to start compiling the firmware and flashing.
  1. Click Manual download again to start compiling the firmware and wait for completion.

Download and Flash Firmware

  1. Wait for the compilation to complete, click the DOWNLOAD button, and the flashing method selection interface will appear. Here we select Factory format to save to the local machine.
  1. Wait for the program local download to complete.
  1. Go back to the main interface, select INSTALL to enter the flashing selection interface, this time select Plug into this computer, and connect the device to the computer with USB to flash.
  1. Select Open ESPHome Web to enter the flashing interface.
  1. Click the CONNECT button first, then select the serial port device connected to the computer and connect (if no serial port appears here, please check if the hardware connection is incorrect).
  1. Click INSTALL to enter the local firmware file selection interface.
  1. Select the firmware file just saved locally, click INSTALL and wait for the flashing to finish.

Flashing completed:

Quick Start

  1. After completing the firmware flashing, the device will automatically connect to Wi-Fi when powered on. Click Settings to enter the settings interface to view the device at Discovered, click ADD to add the device.
  1. Click Settings to enter the settings interface and select Devices & services.
  1. Search for ESP in the search bar to find ESPHome, enter and select Atom-Lite.
  1. In the Atom-Lite configuration page, you can see two Entities: Atom RGB Light and Atom Button. Automation is achieved by configuring various Entities to implement logic. We click the + sign to add Automations, and then follow the guide operations.

In this way, we used two entities, Atom Button and Atom RGB Light, to form an Automation. The effect of this automation is that clicking the button will toggle the light state.

  1. Click the Overview menu to enter the component control interface, click the edit button in the upper right corner to enter the editing interface.
  1. In the By card interface, search for Light and select the Atom RGB Light entity component.

The component configuration is as follows:

  1. Double-click the button and the RGB light switches to pink.
  1. Long press the button for more than 2 seconds, and the RGB light switches to green.

The status of the RGB light will not only be reflected on the component but can also be directly controlled through the component.

On This Page