this post was submitted on 28 Sep 2026
9 points (100.0% liked)
homeassistant
20809 readers
480 users here now
Home Assistant is open source home automation that puts local control and privacy first.
Powered by a worldwide community of tinkerers and DIY enthusiasts.
Home Assistant can be self-installed on ProxMox, Raspberry Pi, or even purchased pre-installed: Home Assistant: Installation
Discussion of Home-Assistant adjacent topics is absolutely fine, within reason.
If you're not sure, DM @GreatAlbatross@feddit.uk
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
ESPHome is by-and-large a build system to build bespoke C++ programs. The python files you're seeing describe how that yaml file maps to the C++ files.
The core idea is that end users (including people managing custom sensors) as much as possible only have to interact with the yaml file. The yaml file lists what components you want to run and their configurations. A component is in general a subdirectory of esphome/esphome and is intended to be independent of other components.
Those github references in the yaml pull in external components from the community. It's roughly equivalent to dropping another folder into the source tree (noting again that you shouldn't usually need to have the source tree at all).
Running esphome copies all used components into a separate source tree, with substitutions and variables set according to the yaml configuration (defined by the component's python files) and builds a bespoke binary for you that will run on your device.
If you want to include code that's not already an ESPHome component, you will need to make it into one. You can do this in place in the source tree or by creating an external component yourself. You will want to use an existing component as a template for this. Have a look for if ESPHome itself or a community component already exists first because it will make your life so much easier.
TL;DR the python code converts the yaml into a (pure) C++ program.