ESPHome: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
Line 1: Line 1:
Its home is at https://esphome.io
What is ESPHome? Use it to set up ESP8266 and ESP32 devices to work with Home Assistant.
 
It requires a configuration file to load firmware into your device. That's it.
See the README but basically set up is
See the README but basically set up is


Line 14: Line 14:


  esphome run esp12e.yaml
  esphome run esp12e.yaml
To use it in Home Assistant, install the ESPHome integration. Once you do, it will find your ESPHome devices. This is slick.


My yaml file includes "ota:" which adds the "over-the-air" updates capability.
My yaml file includes "ota:" which adds the "over-the-air" updates capability.
Line 20: Line 22:
out of the wall to update it, it can happen over-the-air and in-the-wall.
out of the wall to update it, it can happen over-the-air and in-the-wall.


Check /etc/hosts on Bellman to find the correct IP address; this is for wemos2
Check /etc/hosts on Bellman to find the correct IP address; this is for wemos02
  esphome --device 192.168.123.204 --client-id wemos2 --verbose run wemos2.yaml
  esphome --device 192.168.123.204 --client-id wemos02 --verbose run wemos02.yaml
 
== Motion sensor ==
 
I built up a protoboard with a Wemos D1 Mini, an OLED display, two push buttons,
an LED, and a RADAR motion sensor.
 
Everything is exposed in Home Assistant via the integration, so for example, when I push
a button, "wemos02 button 1" in Home Assistant changes state from OFF to ON.
 
Communication runs both directions, so in Home Assistant I can adjust the brightness of the
LEDs on my little board.
 
According to Adafruit, the pixels will dim out after 1000 hours of use so
I need to switch it off when it's not needed.


== Resources ==
== Resources ==

Revision as of 04:50, 2 October 2021

What is ESPHome? Use it to set up ESP8266 and ESP32 devices to work with Home Assistant. It requires a configuration file to load firmware into your device. That's it. See the README but basically set up is

conda create -n esphome
conda activate esphome
pip install esphome

Then build a yaml file, possibly with

esphome wizard esp12e.yaml

and install

esphome run esp12e.yaml

To use it in Home Assistant, install the ESPHome integration. Once you do, it will find your ESPHome devices. This is slick.

My yaml file includes "ota:" which adds the "over-the-air" updates capability. After the first successful upload over USB, it is faster to use OTA subsquently, and it is no longer necessary to pull the (for example) Martin Jerry S-01 switch out of the wall to update it, it can happen over-the-air and in-the-wall.

Check /etc/hosts on Bellman to find the correct IP address; this is for wemos02

esphome --device 192.168.123.204 --client-id wemos02 --verbose run wemos02.yaml

Motion sensor

I built up a protoboard with a Wemos D1 Mini, an OLED display, two push buttons, an LED, and a RADAR motion sensor.

Everything is exposed in Home Assistant via the integration, so for example, when I push a button, "wemos02 button 1" in Home Assistant changes state from OFF to ON.

Communication runs both directions, so in Home Assistant I can adjust the brightness of the LEDs on my little board.

According to Adafruit, the pixels will dim out after 1000 hours of use so I need to switch it off when it's not needed.

Resources

ESPHome page Automations