This tutorial describes how to integrate Atom-Lite with Home Assistant for light control.
After installing the ESPHome Builder add-on, select Show in sidebar on its management page to add it to the left sidebar.
Click the Online Flashing button below and follow the prompts to flash the firmware and configure Wi-Fi, allowing you to quickly try Atom-Lite with Home Assistant.
For detailed flashing and configuration instructions, see Online ESPHome Firmware Flashing and Configuration.
After completing online flashing, skip the "Firmware Compilation & Flashing" section and continue directly with 4. Getting Started.
NEW DEVICE in the bottom right corner to create a new device.
CONTINUE button.
Atom-Lite.
Use recommended settings, then select ESP32 to enter the details page.
M5Stack-ATOM on the details page, select it, and click the NEXT button.
key and click INSTALL to enter the installation step.
Manual download to start the program compilation and wait for the compilation and installation to complete.
Atom-Lite device. Click the EDIT button to enter the yaml file editing page.
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: 1sESP-IDF. The NeoPixelBus Light component previously used with Arduino does not support the ESP-IDF framework. Use the ESP32 RMT LED Strip component with newer ESPHome versions.
SAVE button to save the yaml file first, then click the INSTALL button to start compiling the firmware and flashing.
Manual download again to start compiling the firmware and wait for completion.
DOWNLOAD button, and the flashing method selection interface will appear. Here we select Factory format to save to the local machine.
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.
Open ESPHome Web to enter the flashing interface.
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).
INSTALL to enter the local firmware file selection interface.
INSTALL and wait for the flashing to finish.
Flashing completed:
Settings to enter the settings interface to view the device at Discovered, click ADD to add the device.
Settings to enter the settings interface and select Devices & services.
ESP in the search bar to find ESPHome, enter and select Atom-Lite.
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.
Overview menu to enter the component control interface, click the edit button in the upper right corner to enter the editing interface.
By card interface, search for Light and select the Atom RGB Light entity component.
The component configuration is as follows:
The status of the RGB light will not only be reflected on the component but can also be directly controlled through the component.
