ESPHOME
Build your own smart home sensors
Discover how to install micro controllers and simple electronics to make our homes almost as smart as Matt Holder.
Credit: https://esphome.io
OUR EXPERT
Matt Holder has been a fan of the open source methodology for over two decades and uses Linux and other tools where possible.
This project uses the Lolin D1 mini, just 34mm across, shown here with its GPIO pin out.
E
SPHome is a project that comes under the banner of Nabu Casa (the company started by Home Assistant’s founder to provide funding for core developers). ESPHome creates firmware for microcontroller boards, which can communicate with Home Assistant. Communication is two-way and microcontroller outputs can be controlled from Lovelace dashboards/automations as well as data from the microcontroller being fed back to Home Assistant.
Around five years ago the ESP8266 model of microcontroller changed the world by offering a small, cheap circuit board. These boards contain a Wi-Fi controller, as well as support for many communication standards. These boards support digital input/output, analogue outputs, and pseudo-analogue output using Pulse Width Modulation – PWM is a way of turning a digital signal on and off very quickly so that the average value appears to be less than the full voltage.
As well as General Purpose Input Output (GPIO), these boards support I2C, SPI, one-wire serial and various other standards. GPIO is found on a lot of devices these days and is defined as a maximum voltage of 3.3V for digital I/O and for analogue input too. Be aware devices that use 5V digital signals will cause a failure unless additional circuitry is utilised.
As described in the boxout (bottom right), communication between ESPHome and Home Assistant is reliable and is performed via an API. Data can be encrypted, but because the data is retained on the home network, this is probably unnecessary.
ESPHome can be run as a standalone system, but the easiest way to use it is to add it as an Add-On in the Add-Ons section of Home Assistant (see LXF287-289). Navigate to Configuration>Add-Ons, Backups and Supervisor and search for ESPHome. Once installed, ensure that Start at boot, Watchdog, AutoUpdate and Show in sidebar are enabled. Add-Ons are essentially docker containers and run on the host’s operating system. This author is able to run the operating system, Home Assistant, ESPHome, Studio Code Server and other add-ons in a performant manner on a Raspberry Pi 4.
Get an overview of ESPHome
Once the Add-On has been installed, open it from the Add-Ons page and a new window will open. This is the overview screen for ESPHome, which will display all configured projects and the status of them, including whether a firmware update is available and whether the project is online or not.