What is ESPHome for?

published Dec 06, 2022, last modified Feb 15, 2023

A simple explanation of this revolutionary technology for curious minds.

What is ESPHome for?

ESPHome is a free and open technology you can use to put together your own smart connected devices.

With ESPHome you can create, LEGO-style and with little knowledge of programming, all kinds of useful devices based on the extremely cheap and low-power ESP8266 and ESP32 computers.  All you need to know is a tiny bit of electronics — which you can learn along the way.

ESP computers have Wi-FI and Bluetooth connectivity, but they are not full PCs like a Raspberry Pi (on which you would normally install a complete Linux system). Rather, the programming that goes into these devices is far lower level; you could even argue these devices, when programmed, have no “operating system” as we understand normally.  The key thing about these ESP computers is that they can connect to and control an enormous amount of very cheap devices — relays, thermostats, motors, cameras, et cetera — which makes them very popular for consumer products, home automation and industrial control.

Normally, these ESP computers are programmed by writing computer code in an Arduino IDE.  This, of course, drastically limits access to who can use the boards — effectively only to people who know both electronics and low-level microcontroller programming.

Unlike standard Arduino programming for these boards, ESPHome is much more a LEGO assemble-your-device experience; you describe (via YAML) what each component hooked up to the board “means” (in terms of “this device is a light, that gizmo over here is a thermometer, this other gizmo hooked up here is a light sensor”).  Much like LEGO, ESPHome also offers you a giant and ever-growing list of building blocks you can select from.  You just "click things together" in a YAML file, program the computer using that YAML file as guide, and you're done!

Another big difference between Arduino programming is that ESPHome has native compatibility with Home Assistant:

  • Components, sensors and switches you program on your board can automagically appear as entities in Home Assistant directly.  This is a huge time saver and it ensures Home Assistant's view of your connected devices stays true to what they actually do for you.
    • Here is an example.  Suppose you wired up an LED to your ESP device's pin 5.  On the device's YAML configuration you add some very simple YAML (to be programmed into the device) that makes this LED appear as a light in Home Assistant — and toggling that switch in Home Assistant will turn the LED on and off.
  • Sensors from your Home Assistant instance can also appear and be used in automations within your ESPHome device.
    • Another example.  Suppose your Home Assistant knows about your washing machine, and you want your ESPHome device, connected to a speaker, to notify you that the wash is done.  You can reference the state of the washing machine within your ESPHome project's YAML configuration, and add to it an automation to speak The wash is done or play a nice chime through the speaker connected to the ESPHome device.  Whenever the wash is done, Home Assistant would notify your ESPHome device, and then it would react to that event as described.
  • This compatibility with Home Assistant can be turned off as well — useful for projects you put together that won't be talking to Home Assistant.

There is one similarity to standard Arduino programming, in that the initial programming (“flashing”) of the computer must be done via a serial adapter — however, once ESPHome has been installed to the ESP computer, you can subsequently upgrade the computer’s software over the air.

Finally, ESPHome — just like Arduino programming — also lets you write custom code to program your computer as well. This is the Joker card for putting together smart things that simply wouldn’t be possible via the many standard building blocks.

Here is a comparison of ESPHome and Tasmota by Andreas Spiess.  Note that the comparison is now somewhat out of date — some of the disadvantages Andreas mentions are no longer true.

Want an easy and effortless intro to programming microcontrollers? Get into ESPHome!