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_componentsdirectory in your ESPHome configuration directory (the directory where your.yamlfiles are located). - Copy the directory (and all of its contents!) of an empty component into your
external_componentsdirectory. You should end up with something like this:external_components/empty_sensor/ - Find the configuration entry for the empty component in
test_empty_components.yamland copy it into your own.yamlfile. - Compile with
esphome compile your_config.yamlwhereyour_config.yamlis your own.yamlfile. - No errors? Great! You can now start modifying the empty component to turn it into your own (external) component.