Customizing the Firmware
The Glow's firmware is built on ESPHome, a platform designed for customization through simple YAML configurations. Whether you need to tweak the device's functionality or adapt it for different use cases, the process is straightforward.
This guide will walk you through how to adopt the device and customize its firmware using the ESPHome Dashboard.
Adopting the Device
Before making any changes to the firmware, you first need to adopt the device into the ESPHome. Once your ESPHome Dashboard is up and running, and the Glow is connected to your local network, you should see an option to adopt it.
Following the adoption steps will automatically:
- Create a unique ESPHome configuration file for your device.
- Set up a secure API encryption key, allowing communication between Home Assistant and your device.
- Configure the device's network settings, such as Wi-Fi credentials.
- Upload the customized firmware onto the Glow.
Component Structure
The firmware is designed to be flexible for different ESP boards by breaking it into separate "components". Each main function of the device is kept in its own YAML file, making it easier to manage. The base configuration includes a few key components that handle the important functions of the device.
Component | Description |
---|---|
basis.yaml | Handles the basic, essential functionality of the device. |
pulse_meter.yaml | Manages pulse metering, useful for tracking energy usage. |
status_led.yaml | Controls the status LED, allowing customization of its behavior or color based on the device's state. |
updates.yaml | Provides Over-the-Air (OTA) update capabilities for easy firmware updates. |
Making Your First Customization
Once your device is adopted, you can start customizing its behavior by editing the configuration files. In the ESPHome dashboard, click on EDIT next to the device to open the YAML editor, where you can modify the configuration directly.
The YAML configuration may seem short and incomplete because it relies on remote packages, which are loaded during the firmware build process. If you want to customize or modify anything, it's important to first find the used ESPHome component ID.
When you open the YAML editor, you'll see the default configuration for your Glow device. You can adjust this configuration or add new functionality by extending the existing components. For example, to change the behavior of the pulse_meter, you can use the !extend feature to easily make the necessary changes.
Here's an example of adding an internal_filter to the pulse meter configuration:
sensor:
- id: !extend sensor_energy_pulse_meter
internal_filter: 100ms