This repository contains a number of examples in the form of empty components which can be used as templates to quickly develop your own (external) components for ESPHome.
All examples are in the components
directory of this repository. The
test_empty_components.yaml
file contains configuration examples for the various
components.
The easiest way to develop components/platforms for use within ESPHome is to use external components. To use a particular component from this repository for your project:
- Create an
external_components
directory in your ESPHome configuration directory (the directory where your.yaml
files are located). - Copy the directory (and all of its contents!) of an empty component into your
external_components
directory. You should end up with something like this:external_components/empty_sensor/
- Find the configuration entry for the empty component in
test_empty_components.yaml
and copy it into your own.yaml
file. - Compile with
esphome compile your_config.yaml
whereyour_config.yaml
is your own.yaml
file. - No errors? Great! You can now start modifying the empty component to turn it into your own (external) component.